Skip to content

Commit adae4d7

Browse files
committed
cmake: another fix for include all header files in Xcode projects.
Header files from within the lib directory were missing. Also: use get_filename_component instead of regex matching.
1 parent 9faf023 commit adae4d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,15 +435,15 @@ function(add_swift_host_library name)
435435
endif()
436436

437437
if(XCODE)
438-
string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
439-
list(GET split_path -1 dir)
438+
get_filename_component(base_dir ${CMAKE_CURRENT_SOURCE_DIR} NAME)
440439

441440
file(GLOB_RECURSE ASHL_HEADERS
442-
${SWIFT_SOURCE_DIR}/include/swift${dir}/*.h
443-
${SWIFT_SOURCE_DIR}/include/swift${dir}/*.def
441+
${SWIFT_SOURCE_DIR}/include/swift/${base_dir}/*.h
442+
${SWIFT_SOURCE_DIR}/include/swift/${base_dir}/*.def
443+
${CMAKE_CURRENT_SOURCE_DIR}/*.h
444444
${CMAKE_CURRENT_SOURCE_DIR}/*.def)
445445
file(GLOB_RECURSE ASHL_TDS
446-
${SWIFT_SOURCE_DIR}/include/swift${dir}/*.td)
446+
${SWIFT_SOURCE_DIR}/include/swift${base_dir}/*.td)
447447

448448
set_source_files_properties(${ASHL_HEADERS} ${ASHL_TDS} PROPERTIES
449449
HEADER_FILE_ONLY true)

0 commit comments

Comments
 (0)