Skip to content

Commit 5015ee1

Browse files
authored
Merge pull request #12895 from davezarzycki/cmake_localize_hack2
[CMake] Localize a build hack
2 parents 97ac580 + 986beb7 commit 5015ee1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
8181
# HACK: this ugly tweaking is to prevent the propagation of the flag from LLVM
8282
# into swift. The use of this flag pollutes all targets, and we are not able
8383
# to remove it on a per-target basis which breaks cross-compilation.
84-
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
84+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
85+
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
86+
endif()
8587

8688
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
8789
string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MAJOR

stdlib/public/SwiftRemoteMirror/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# HACK: Force this library to build with undefined symbols.
2+
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
3+
14
# libswiftRemoteMirror.dylib should not have runtime dependencies; it's
25
# always built as a shared library.
36
if(SWIFT_BUILD_DYNAMIC_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)

0 commit comments

Comments
 (0)