File tree Expand file tree Collapse file tree 12 files changed +353
-0
lines changed Expand file tree Collapse file tree 12 files changed +353
-0
lines changed Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ cmake_minimum_required (VERSION 3.16)
11+ project (swift-numerics
12+ LANGUAGES Swift)
13+
14+ list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} /cmake/modules)
15+
16+ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
17+ set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
18+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
19+ set (CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} /swift)
20+
21+ include (CTest)
22+ include (SwiftSupport)
23+
24+ add_subdirectory (Sources )
25+ if (BUILD_TESTING)
26+ add_subdirectory (Tests)
27+ endif ()
28+
29+ get_property (SWIFT_NUMERICS_EXPORTS GLOBAL PROPERTY SWIFT_NUMERICS_EXPORTS)
30+ export (TARGETS ${SWIFT_NUMERICS_EXPORTS}
31+ NAMESPACE SwiftNumerics::
32+ FILE swift-numerics-config.cmake
33+ EXPORT_LINK_INTERFACE_LIBRARIES)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_subdirectory (_NumericsShims)
11+ add_subdirectory (ComplexModule)
12+ add_subdirectory (Numerics)
13+ add_subdirectory (RealModule)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (ComplexModule
11+ Arithmetic.swift
12+ Complex.swift
13+ Differentiable.swift)
14+ set_target_properties (ComplexModule PROPERTIES
15+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
16+ target_link_libraries (ComplexModule PUBLIC
17+ RealModule)
18+
19+
20+ _install_target(ComplexModule)
21+ set_property (GLOBAL APPEND PROPERTY SWIFT_NUMERICS_EXPORTS ComplexModule)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (Numerics
11+ Numerics.swift)
12+ set_target_properties (Numerics PROPERTIES
13+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
14+ target_link_libraries (Numerics PUBLIC
15+ ComplexModule
16+ RealModule)
17+
18+
19+ _install_target(Numerics)
20+ set_property (GLOBAL APPEND PROPERTY SWIFT_NUMERICS_EXPORTS Numerics)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (RealModule
11+ AlgebraicField.swift
12+ Double+Real.swift
13+ ElementaryFunctions.swift
14+ Float+Real.swift
15+ Float80+Real.swift
16+ Real.swift
17+ RealFunctions.swift)
18+ set_target_properties (RealModule PROPERTIES
19+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
20+ target_link_libraries (RealModule PUBLIC
21+ _NumericsShims)
22+
23+
24+ _install_target(RealModule)
25+ set_property (GLOBAL APPEND PROPERTY SWIFT_NUMERICS_EXPORTS RealModule)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (_NumericsShims INTERFACE )
11+ target_include_directories (_NumericsShims INTERFACE
12+ include )
13+
14+ set_property (GLOBAL APPEND PROPERTY SWIFT_NUMERICS_EXPORTS _NumericsShims)
Original file line number Diff line number Diff line change 1+ module _NumericsShims {
2+ header "_NumericsShims.h"
3+ }
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ find_package (dispatch CONFIG QUIET )
11+ find_package (Foundation CONFIG QUIET )
12+ find_package (XCTest CONFIG QUIET )
13+
14+ add_subdirectory (ComplexTests)
15+ add_subdirectory (RealTests)
16+
17+ add_executable (SwiftNumericsTestRunner
18+ WindowsMain.swift)
19+ target_link_libraries (SwiftNumericsTestRunner PRIVATE
20+ ComplexTests
21+ RealTests)
22+
23+ add_test (NAME SwiftNumericsTestRunner
24+ COMMAND SwiftNumericsTestRunner)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (ComplexTests
11+ ArithmeticTests.swift
12+ DifferentiableTests.swift
13+ PropertyTests.swift)
14+ set_target_properties (ComplexTests PROPERTIES
15+ INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
16+ target_compile_options (ComplexTests PRIVATE
17+ -enable-testing)
18+ target_link_libraries (ComplexTests PUBLIC
19+ $<$<NOT :$<PLATFORM_ID:Darwin>>:Foundation>
20+ ComplexModule
21+ XCTest)
Original file line number Diff line number Diff line change 1+ #[[
2+ This source file is part of the Swift Numerics open source project
3+
4+ Copyright (c) 2019 Apple Inc. and the Swift Numerics project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ #]]
9+
10+ add_library (RealTests
11+ IntegerExponentTests.swift
12+ RealTests.swift
13+ RealTestSupport.swift)
14+ target_compile_options (RealTests PRIVATE
15+ -enable-testing)
16+ target_link_libraries (RealTests PUBLIC
17+ $<$<NOT :$<PLATFORM_ID:Darwin>>:Foundation>
18+ RealModule
19+ XCTest)
You can’t perform that action at this time.
0 commit comments