Disable compiler runtime-test for cmake when cross-compiling to None platform.
CMake implicitly runs a compiler test when it detects a new project. This normally compiles a minimal executable and runs it. When cross-compiling to a None platform this will fail for all CMake packages and the user is forced to override this manually through overlays. This commit changes Cmake's behavior when cross compiling so that it compiles a static library as a test instead.
This commit is contained in:
@@ -20,11 +20,13 @@ let
|
||||
"-DCMAKE_HOST_SYSTEM_VERSION=${stdenv.buildPlatform.uname.release}"
|
||||
] ++ optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
"-DCMAKE_CROSSCOMPILING_EMULATOR=env"
|
||||
] ++ optionals (stdenv.hostPlatform.isNone) [
|
||||
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
|
||||
] ++ optionals stdenv.hostPlatform.isStatic [
|
||||
"-DCMAKE_LINK_SEARCH_START_STATIC=ON"
|
||||
]);
|
||||
|
||||
makeCMakeFlags = { cmakeFlags ? [], ... }: cmakeFlags ++ cmakeFlags';
|
||||
makeCMakeFlags = { cmakeFlags ? [ ], ... }: cmakeFlags ++ cmakeFlags';
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user