Skip to content

Commit e5ba407

Browse files
authored
Merge pull request #22 from etcwilde/ewilde/cmake4-updates
CMake 4.0.1 fixes
2 parents 71d49a1 + 18ed217 commit e5ba407

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
hash: 2dd48ccd3e3d872ee4cc916f3f4e24812612421007e895f82bf9fc7e49831d62
2323
- version: 3.30.8
2424
hash: adc81f2944e6f86b44e86acea3abea1651ed7890206933484b8b74ac1280314f
25+
- version: 4.0.1
26+
hash: d66c11c010588c8256ee20a26b45977cd5b2f4aee2b742d4b8a353769940d147
2527
steps:
2628
- name: Clone Repo
2729
uses: actions/checkout@v4

3_bidirectional_cxx_interop/cmake/modules/AddSwift.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ function(_swift_generate_cxx_header target header)
3434
list(TRANSFORM ARG_SEARCH_PATHS PREPEND "-I")
3535
endif()
3636

37-
if(APPLE)
37+
if(APPLE AND CMAKE_OSX_SYSROOT)
3838
set(SDK_FLAGS "-sdk" "${CMAKE_OSX_SYSROOT}")
3939
elseif(WIN32)
4040
set(SDK_FLAGS "-sdk" "$ENV{SDKROOT}")
41-
elseif(DEFINED ${CMAKE_SYSROOT})
41+
elseif(CMAKE_SYSROOT)
4242
set(SDK_FLAGS "-sdk" "${CMAKE_SYSROOT}")
4343
endif()
4444

@@ -54,7 +54,7 @@ function(_swift_generate_cxx_header target header)
5454
DEPENDS ${_SwiftSources}
5555
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
5656
COMMAND
57-
${CMAKE_Swift_COMPILER} -frontend -typecheck
57+
${CMAKE_Swift_COMPILER} -typecheck
5858
${ARG_SEARCH_PATHS}
5959
${_SwiftSources}
6060
${SDK_FLAGS}

3_bidirectional_cxx_interop/cmake/modules/InitializeSwift.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ endfunction()
2626
function(_setup_swift_paths)
2727
# If we haven't set the swift library search paths, do that now
2828
if(NOT SWIFT_LIBRARY_SEARCH_PATHS)
29-
if(APPLE)
29+
if(CMAKE_OSX_SYSROOT)
3030
set(SDK_FLAGS "-sdk" "${CMAKE_OSX_SYSROOT}")
3131
endif()
3232

0 commit comments

Comments
 (0)