Skip to content

Set CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY for any target in mbedtls-sys build script #384

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
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
6 changes: 3 additions & 3 deletions mbedtls-sys/build/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ impl super::BuildConfig {
.define("Python3_FIND_FRAMEWORK", "LAST")
// Ensure same installation directory is used on all platforms
.define("LIB_INSTALL_DIR", INSTALL_DIR)
// We're building a static library, not an executable, so the try_compile stage of the
// cmake build should try to compile a static library as well.
.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY")
.build_target("install");
for cflag in &self.cflags {
cmk.cflag(cflag);
Expand All @@ -45,9 +48,6 @@ impl super::BuildConfig {
// When building on Linux, -rdynamic flag is added automatically. Changing the
// CMAKE_SYSTEM_NAME to Generic avoids this.
cmk.define("CMAKE_SYSTEM_NAME", "Generic");
// The compiler test requires _exit which is not available. By just trying to
// compile a library, we can fix it.
cmk.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY");
}

let dst = cmk.build();
Expand Down