Skip to content

Commit 9287d48

Browse files
committed
Update CMake build to pass -I ICU_INCLUDE_DIR
- This allows building with a non system libicu.
1 parent 3f144c7 commit 9287d48

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ExternalProject_Add(CoreFoundation
3939
-DCF_ENABLE_LIBDISPATCH=${FOUNDATION_ENABLE_LIBDISPATCH}
4040
-DCF_PATH_TO_LIBDISPATCH_SOURCE=${FOUNDATION_PATH_TO_LIBDISPATCH_SOURCE}
4141
-DCF_PATH_TO_LIBDISPATCH_BUILD=${FOUNDATION_PATH_TO_LIBDISPATCH_BUILD}
42+
-DICU_INCLUDE_DIR=${ICU_INCLUDE_DIR}
4243
INSTALL_COMMAND
4344
${CMAKE_COMMAND} -E env --unset=DESTDIR ${CMAKE_COMMAND} --build . --target install)
4445
ExternalProject_Get_Property(CoreFoundation install_dir)
@@ -240,6 +241,7 @@ add_swift_library(Foundation
240241
-DDEPLOYMENT_RUNTIME_SWIFT
241242
${deployment_enable_libdispatch}
242243
-Fsystem;${install_dir}/System/Library/Frameworks
244+
-I;${ICU_INCLUDE_DIR}
243245
${libdispatch_cflags}
244246
${swift_enable_testing}
245247
${swift_optimization_flags})
@@ -259,6 +261,7 @@ add_swift_executable(plutil
259261
${deployment_enable_libdispatch}
260262
-Fsystem;${install_dir}/System/Library/Frameworks
261263
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
264+
-I;${ICU_INCLUDE_DIR}
262265
${libdispatch_cflags}
263266
${swift_enable_testing}
264267
${swift_optimization_flags})
@@ -277,6 +280,7 @@ if(ENABLE_TESTING)
277280
SWIFT_FLAGS
278281
-Fsystem;${install_dir}/System/Library/Frameworks
279282
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
283+
-I;${ICU_INCLUDE_DIR}
280284
${libdispatch_cflags})
281285
add_dependencies(xdgTestHelper Foundation CoreFoundation)
282286

@@ -405,6 +409,7 @@ if(ENABLE_TESTING)
405409
-Fsystem;${install_dir}/System/Library/Frameworks
406410
-I;${CMAKE_CURRENT_BINARY_DIR}/swift
407411
-I;${FOUNDATION_PATH_TO_XCTEST_BUILD}/swift
412+
-I;${ICU_INCLUDE_DIR}
408413
${libdispatch_cflags}
409414
${swift_optimization_flags})
410415
add_dependencies(TestFoundation Foundation CoreFoundation xdgTestHelper)

CoreFoundation/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ else()
358358
"/usr/include"
359359
"/usr/include/libxml2")
360360
endif()
361+
target_include_directories(CoreFoundation
362+
PRIVATE
363+
${ICU_INCLUDE_DIR})
364+
361365
target_compile_options(CoreFoundation
362366
PRIVATE
363367
$<$<COMPILE_LANGUAGE:C>:-include;${CMAKE_SOURCE_DIR}/Base.subproj/CoreFoundation_Prefix.h>)

0 commit comments

Comments
 (0)