Skip to content

Improve flags handling for Windows build #1831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ endif()

if(CMAKE_SYSTEM_NAME STREQUAL Android OR CMAKE_SYSTEM_NAME STREQUAL Linux)
set(deployment_target -DDEPLOYMENT_TARGET_LINUX)
set(Foundation_rpath_flags -Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN")
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(deployment_target -DDEPLOYMENT_TARGET_MACOSX)
elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(deployment_target -DDEPLOYMENT_TARGET_FREEBSD)
set(Foundation_rpath_flags -Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN")
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(deployment_target -DDEPLOYMENT_TARGET_WINDOWS)
endif()
Expand Down Expand Up @@ -278,6 +280,7 @@ add_swift_library(Foundation
${deployment_target}
${deployment_enable_libdispatch}
-F${install_dir}/System/Library/Frameworks
-D_DLL
LINK_FLAGS
-L${install_dir}/usr/lib
-lCoreFoundation
Expand All @@ -287,7 +290,7 @@ add_swift_library(Foundation
${libdispatch_ldflags}
-L${CMAKE_CURRENT_BINARY_DIR}
-luuid
-Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN"
${Foundation_rpath_flags}
SWIFT_FLAGS
-DDEPLOYMENT_RUNTIME_SWIFT
${deployment_enable_libdispatch}
Expand Down