1
1
cmake_minimum_required (VERSION 3.29 )
2
2
3
- set (CMAKE_POSITION_INDEPENDENT_CODE YES )
4
-
5
- list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /../cmake/modules" )
6
-
7
3
if ($ENV{BUILD_NUMBER} )
8
4
math (EXPR BUILD_NUMBER "$ENV{BUILD_NUMBER} % 65535" )
9
5
set (BUILD_NUMBER ".${BUILD_NUMBER} " )
@@ -12,6 +8,11 @@ project(SwiftDifferentiation
12
8
LANGUAGES Swift C
13
9
VERSION 6.1.0${BUILD_NUMBER} )
14
10
11
+ set (CMAKE_POSITION_INDEPENDENT_CODE YES )
12
+ set (CMAKE_Swift_LANGUAGE_VERSION 5 )
13
+
14
+ list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /../cmake/modules" )
15
+
15
16
if (NOT PROJECT_IS_TOP_LEVEL )
16
17
message (SEND_ERROR "Swift Differentiation must build as a standalone project" )
17
18
endif ()
@@ -24,11 +25,13 @@ find_package(SwiftCore)
24
25
find_package (math )
25
26
26
27
include (gyb )
28
+ include (AvailabilityMacros )
29
+ include (CatalystSupport )
27
30
28
- option (SwiftDifferentiation_ENABLE_VECTOR_TYPES "Enable vector support"
31
+ option (${PROJECT_NAME} _ENABLE_VECTOR_TYPES "Enable vector support"
29
32
${SwiftCore_ENABLE_VECTOR_TYPES} )
30
33
31
- option (SwiftDifferentiation_ENABLE_LIBRARY_EVOLUTION "Enable library evolution"
34
+ option (${PROJECT_NAME} _ENABLE_LIBRARY_EVOLUTION "Enable library evolution"
32
35
${SwiftCore_ENABLE_LIBRARY_EVOLUTION} )
33
36
34
37
add_compile_options (
@@ -66,7 +69,26 @@ add_library(swift_Differentiation
66
69
linker-support/magic-symbols-for-install-name.c )
67
70
68
71
set_target_properties (swift_Differentiation PROPERTIES
69
- Swift_MODULE_NAME _Differentiation
70
- Swift_COMPILATION_MODE wholemodule )
72
+ Swift_MODULE_NAME _Differentiation )
73
+
74
+ if (APPLE AND BUILD_SHARED_LIBS )
75
+ target_link_options (swift_Differentiation PRIVATE "SHELL:-Xlinker -headerpad_max_install_names" )
76
+ endif ()
71
77
72
78
target_link_libraries (swift_Differentiation PRIVATE swiftCore math )
79
+
80
+ set (${PROJECT_NAME} _INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR} /swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS} >>:_static>$<$<BOOL:${Supplemental_INSTALL_NESTED_SUBDIR} >:/${Supplemental_PLATFORM_SUBDIR} /${Supplemental_ARCH_SUBDIR} >" CACHE STRING "" )
81
+ set (${PROJECT_NAME} _INSTALL_SWIFTMODULEDIR "${CMAKE_INSTALL_LIBDIR} /swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS} >>:_static>$<$<BOOL:${Supplemental_INSTALL_NESTED_SUBDIR} >:/${Supplemental_PLATFORM_SUBDIR} >" CACHE STRING "" )
82
+
83
+ install (TARGETS swift_Differentiation
84
+ EXPORT SwiftSupplementalTargets
85
+ COMPONENT SwiftCore_runtime
86
+ ARCHIVE DESTINATION "${${PROJECT_NAME} _INSTALL_LIBDIR}"
87
+ LIBRARY DESTINATION "${${PROJECT_NAME} _INSTALL_LIBDIR}"
88
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR} " )
89
+ emit_swift_interface (swift_Differentiation )
90
+ install_swift_interface (swift_Differentiation )
91
+
92
+ # Configure plist creation for Darwin platforms.
93
+ generate_plist ("${CMAKE_PROJECT_NAME} " "${CMAKE_PROJECT_VERSION} " swift_Differentiation )
94
+ embed_manifest (swift_Differentation )
0 commit comments