Skip to content

build: cleanup some of the link rules #2596

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
Jan 6, 2020
Merged
Show file tree
Hide file tree
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
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ endif()

option(BUILD_SHARED_LIBS "build shared libraries" ON)

find_package(CURL CONFIG)
if(CURL_FOUND)
include(CMakeExpandImportedTargets)
cmake_expand_imported_targets(CURL_LIBRARIES LIBRARIES CURL::libcurl)
else()
find_package(CURL REQUIRED)
endif()
find_package(ICU COMPONENTS uc i18n REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(dispatch CONFIG REQUIRED)

include(SwiftSupport)
Expand Down
24 changes: 14 additions & 10 deletions CoreFoundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ target_compile_definitions(CoreFoundation
$<$<COMPILE_LANGUAGE:ASM>:CF_CHARACTERSET_UNICODE_DATA_L="CharacterSets/CFUnicodeData-L.mapping">)
target_include_directories(CoreFoundation
PRIVATE
${PROJECT_SOURCE_DIR}
${ICU_INCLUDE_DIR})
${PROJECT_SOURCE_DIR})
target_link_libraries(CoreFoundation PRIVATE
Threads::Threads
${CMAKE_DL_LIBS}
Expand All @@ -390,6 +389,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL Android)
target_link_libraries(CoreFoundation PRIVATE
log)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CoreFoundation PRIVATE
ICU::uc
ICU::i18n)
endif()

add_framework(CFURLSessionInterface
${FRAMEWORK_LIBRARY_TYPE}
Expand All @@ -409,10 +413,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
PRIVATE
CURL_STATICLIB)
endif()
target_include_directories(CFURLSessionInterface PRIVATE
${CURL_INCLUDE_DIRS})
target_link_libraries(CFURLSessionInterface PRIVATE
${CURL_LIBRARIES})
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CFURLSessionInterface PRIVATE
CURL::libcurl)
endif()

add_framework(CFXMLInterface
${FRAMEWORK_LIBRARY_TYPE}
Expand All @@ -427,10 +431,10 @@ add_framework(CFXMLInterface
SOURCES
Parsing.subproj/CFXMLInterface.c)
add_dependencies(CFXMLInterface CoreFoundation)
target_include_directories(CFXMLInterface PRIVATE
${LIBXML2_INCLUDE_DIR})
target_link_libraries(CFXMLInterface PRIVATE
${LIBXML2_LIBRARIES})
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_libraries(CFXMLInterface PRIVATE
LibXml2::LibXml2)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL Windows)
add_library(CoreFoundationResources OBJECT
Expand Down
251 changes: 0 additions & 251 deletions CoreFoundation/cmake/modules/FindICU.cmake

This file was deleted.

7 changes: 0 additions & 7 deletions Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ target_compile_definitions(Foundation PRIVATE
DEPLOYMENT_RUNTIME_SWIFT)
target_compile_options(Foundation PUBLIC
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
target_compile_options(Foundation PRIVATE
"SHELL:-Xcc -I${ICU_INCLUDE_DIR}")
if(CMAKE_SYSTEM_NAME STREQUAL Windows AND CMAKE_VERSION VERSION_LESS 3.16)
# Work around for CMake 15 which doesn't link in the resource file
# target properly
Expand All @@ -153,8 +151,6 @@ if(ENABLE_TESTING)
-enable-testing)
endif()
target_link_libraries(Foundation PRIVATE
${ICU_UC_LIBRARY}
${ICU_I18N_LIBRARY}
CoreFoundation
uuid)
target_link_libraries(Foundation PUBLIC
Expand Down Expand Up @@ -219,8 +215,6 @@ if(ENABLE_TESTING)
-enable-testing)
endif()
target_link_libraries(FoundationNetworking PRIVATE
${CURL_LIBRARIES}
${ZLIB_LIBRARIES}
Foundation
CFURLSessionInterface)
set_target_properties(FoundationNetworking PROPERTIES
Expand All @@ -245,7 +239,6 @@ if(ENABLE_TESTING)
-enable-testing)
endif()
target_link_libraries(FoundationXML PRIVATE
${LIBXML2_LIBRARIES}
Foundation
CFXMLInterface)
set_target_properties(FoundationXML PROPERTIES
Expand Down