File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ endif()
25
25
include (CTest)
26
26
include (SwiftSupport)
27
27
28
+ set (ATOMICS_SWIFT_FLAGS)
29
+ set (ATOMICS_C_FLAGS)
30
+
31
+ if (CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.9)
32
+ list (APPEND ATOMICS_SWIFT_FLAGS
33
+ "-enable-experimental-feature BuiltinModule"
34
+ "-DATOMICS_NATIVE_BUILTINS"
35
+ "-Xcc" "-DATOMICS_NATIVE_BUILTINS=1" )
36
+ list (APPEND ATOMICS_C_FLAGS
37
+ "-DATOMICS_NATIVE_BUILTINS=1" )
38
+ endif ()
39
+
28
40
add_subdirectory (Sources )
29
41
if (BUILD_TESTING)
30
42
add_subdirectory (Tests)
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ add_library(Atomics
31
31
32
32
set_target_properties (Atomics PROPERTIES
33
33
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
34
+ target_compile_options (Atomics PUBLIC
35
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:${ATOMICS_SWIFT_FLAGS} >"
36
+ "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:${ATOMICS_C_FLAGS} >" )
34
37
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
35
38
target_compile_options (Atomics PUBLIC
36
39
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -mcx16>" )
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ add_library(_AtomicsShims STATIC
11
11
src/_AtomicsShims.c)
12
12
target_include_directories (_AtomicsShims PUBLIC
13
13
include )
14
+ target_compile_options (_AtomicsShims PUBLIC
15
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:${ATOMICS_SWIFT_FLAGS} >"
16
+ "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:${ATOMICS_C_FLAGS} >" )
14
17
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
15
18
target_compile_options (_AtomicsShims PUBLIC
16
19
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -mcx16>" )
You can’t perform that action at this time.
0 commit comments