Skip to content
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

Fix macos-11 for CMake >= 3.19 #164

Merged
merged 1 commit into from
Apr 11, 2022
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
15 changes: 14 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
os:
- windows-2019 # windows-latest is currently not having a supported MSVC compiler
- ubuntu-latest
- macos-10.15 # macos-11 is currently not working.
- macos-10.15
arch:
- x86_64
- i686
Expand All @@ -42,6 +42,19 @@ jobs:
generator:
- default # This is just whatever the platform default is
- ninja
include:
- os: macos-latest
arch: x86_64
abi: darwin
cmake: 3.19.0
rust: 1.44.1
generator: default
- os: macos-latest
arch: x86_64
abi: darwin
cmake: 3.19.0
rust: stable
generator: ninja
exclude:
# Something's busted when building with Visual Studio with CMake 3.12 - perhaps should
# look into this at some point
Expand Down
15 changes: 15 additions & 0 deletions cmake/CorrosionGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ function(_generator_add_target manifest ix cargo_version profile)
TARGET ${target_name}-static
PROPERTY INTERFACE_LINK_LIBRARIES ${libs}
)
if(is_macos)
set_property(TARGET ${target_name}-static
PROPERTY INTERFACE_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
)
endif()
endif()

if(libs_debug)
Expand All @@ -297,6 +302,11 @@ function(_generator_add_target manifest ix cargo_version profile)
if(has_cdylib)
add_library(${target_name}-shared SHARED IMPORTED GLOBAL)
add_dependencies(${target_name}-shared cargo-build_${target_name})
if(is_macos)
set_property(TARGET ${target_name}-shared
PROPERTY INTERFACE_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
)
endif()
endif()

add_library(${target_name} INTERFACE)
Expand All @@ -315,6 +325,11 @@ function(_generator_add_target manifest ix cargo_version profile)
elseif(is_executable)
add_executable(${target_name} IMPORTED GLOBAL)
add_dependencies(${target_name} cargo-build_${target_name})
if(is_macos)
set_property(TARGET ${target_name}
PROPERTY INTERFACE_LINK_DIRECTORIES "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
)
endif()
else()
message(FATAL_ERROR "unknown target type")
endif()
Expand Down