Skip to content

build: define the deployment target when building Foundation #1785

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 1 commit into from
Nov 24, 2018
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
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ if(FOUNDATION_ENABLE_LIBDISPATCH)
set(libdispatch_ldflags -L;${FOUNDATION_PATH_TO_LIBDISPATCH_BUILD};-L;${FOUNDATION_PATH_TO_LIBDISPATCH_BUILD}/src;-ldispatch)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Android OR CMAKE_SYSTEM_NAME STREQUAL Linux)
set(deployment_target -DDEPLOYMENT_TARGET_LINUX)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(deployment_target -DDEPLOYMENT_TARGET_MACOSX)
elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
set(deployment_target -DDEPLOYMENT_TARGET_FREEBSD)
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(deployment_target -DDEPLOYMENT_TARGET_WINDOWS)
endif()

add_swift_library(Foundation
MODULE_NAME
Foundation
Expand Down Expand Up @@ -228,6 +238,7 @@ add_swift_library(Foundation
TARGET
${CMAKE_C_COMPILER_TARGET}
CFLAGS
${deployment_target}
${deployment_enable_libdispatch}
-F${install_dir}/System/Library/Frameworks
LINK_FLAGS
Expand All @@ -252,6 +263,7 @@ add_swift_executable(plutil
SOURCES
Tools/plutil/main.swift
CFLAGS
${deployment_target}
${deployment_enable_libdispatch}
-F${install_dir}/System/Library/Frameworks
LINK_FLAGS
Expand All @@ -271,6 +283,7 @@ add_dependencies(plutil Foundation CoreFoundation)
if(ENABLE_TESTING)
add_swift_executable(xdgTestHelper
CFLAGS
${deployment_target}
${deployment_enable_libdispatch}
-F${install_dir}/System/Library/Frameworks
LINK_FLAGS
Expand Down