Skip to content

Commit b11977a

Browse files
authored
Merge pull request #29319 from compnerd/atomic-flag
build-script: handle special build rules for non-atomic runtime
2 parents 203a2b6 + b855260 commit b11977a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stdlib/public/runtime/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,16 @@ if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
163163
INSTALL_IN_COMPONENT never_install)
164164
endif()
165165

166+
if(SWIFT_STDLIB_USE_NONATOMIC_RC)
167+
set(_RUNTIME_NONATOMIC_FLAGS -DSWIFT_STDLIB_USE_NONATOMIC_RC)
168+
endif()
166169
add_swift_target_library(swiftRuntime OBJECT_LIBRARY
167170
${swift_runtime_sources}
168171
${swift_runtime_objc_sources}
169172
${swift_runtime_leaks_sources}
170-
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
173+
C_COMPILE_FLAGS
174+
${swift_runtime_library_compile_flags}
175+
${_RUNTIME_NONATOMIC_FLAGS}
171176
LINK_FLAGS ${swift_runtime_linker_flags}
172177
SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
173178
INSTALL_IN_COMPONENT never_install)

utils/build-script-impl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,6 @@ function swift_c_flags() {
12781278
if [[ $(is_cmake_release_build_type "${SWIFT_BUILD_TYPE}") ]] ; then
12791279
echo -n " -fno-stack-protector"
12801280
fi
1281-
if [[ "$(true_false "${SWIFT_STDLIB_USE_NONATOMIC_RC}")" == "TRUE" ]]; then
1282-
echo -n " -DSWIFT_STDLIB_USE_NONATOMIC_RC"
1283-
fi
12841281
}
12851282

12861283
function cmake_config_opt() {

0 commit comments

Comments
 (0)