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()
2525include (CTest)
2626include (SwiftSupport)
2727
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+
2840add_subdirectory (Sources )
2941if (BUILD_TESTING)
3042 add_subdirectory (Tests)
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ add_library(Atomics
3131
3232set_target_properties (Atomics PROPERTIES
3333 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} >" )
3437if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
3538 target_compile_options (Atomics PUBLIC
3639 "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -mcx16>" )
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ add_library(_AtomicsShims STATIC
1111 src/_AtomicsShims.c)
1212target_include_directories (_AtomicsShims PUBLIC
1313 include )
14+ target_compile_options (_AtomicsShims PUBLIC
15+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:${ATOMICS_SWIFT_FLAGS} >"
16+ "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:${ATOMICS_C_FLAGS} >" )
1417if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
1518 target_compile_options (_AtomicsShims PUBLIC
1619 "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -mcx16>" )
You can’t perform that action at this time.
0 commit comments