Skip to content

Commit abe21cb

Browse files
authored
Merge pull request #384 from fortanix/pieagt/mbedtls-sys-always-set-cmake-try-compile-target-type
Set `CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` for any target in mbedtls-sys build script
2 parents ba1ee71 + a1efcda commit abe21cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mbedtls-sys/build/cmake.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ impl super::BuildConfig {
2323
.define("Python3_FIND_FRAMEWORK", "LAST")
2424
// Ensure same installation directory is used on all platforms
2525
.define("LIB_INSTALL_DIR", INSTALL_DIR)
26+
// We're building a static library, not an executable, so the try_compile stage of the
27+
// cmake build should try to compile a static library as well.
28+
.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY")
2629
.build_target("install");
2730
for cflag in &self.cflags {
2831
cmk.cflag(cflag);
@@ -45,9 +48,6 @@ impl super::BuildConfig {
4548
// When building on Linux, -rdynamic flag is added automatically. Changing the
4649
// CMAKE_SYSTEM_NAME to Generic avoids this.
4750
cmk.define("CMAKE_SYSTEM_NAME", "Generic");
48-
// The compiler test requires _exit which is not available. By just trying to
49-
// compile a library, we can fix it.
50-
cmk.define("CMAKE_TRY_COMPILE_TARGET_TYPE", "STATIC_LIBRARY");
5151
}
5252

5353
let dst = cmk.build();

0 commit comments

Comments
 (0)