CMake: fix CMAKE_SYSTEM_VERSION spelling and add CXX passthrough

This commit is contained in:
Syping 2024-03-06 16:25:48 +01:00
parent 6220277305
commit 67b4b73400

View file

@ -30,6 +30,9 @@ if (DEFINED CMAKE_C_COMPILER_TARGET)
endif() endif()
if (DEFINED CMAKE_CXX_COMPILER) if (DEFINED CMAKE_CXX_COMPILER)
list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}") list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
list(APPEND CMAKE_PASSTHROUGH_ENV "CXX=${CMAKE_CXX_COMPILER}")
elseif ($ENV{MSYSTEM} STREQUAL "CLANG64")
list(APPEND CMAKE_PASSTHROUGH_ENV "CXX=clang++")
endif() endif()
if (DEFINED CMAKE_CXX_COMPILER_TARGET) if (DEFINED CMAKE_CXX_COMPILER_TARGET)
list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_CXX_COMPILER_TARGET=${CMAKE_CXX_COMPILER_TARGET}") list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_CXX_COMPILER_TARGET=${CMAKE_CXX_COMPILER_TARGET}")
@ -49,7 +52,7 @@ endif()
if (DEFINED CMAKE_SYSTEM_PROCESSOR AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR) if (DEFINED CMAKE_SYSTEM_PROCESSOR AND NOT CMAKE_SYSTEM_PROCESSOR STREQUAL CMAKE_HOST_SYSTEM_PROCESSOR)
list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}") list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}")
endif() endif()
if (DEFINED CMAKE_SYSTEM_VERSION AND NOT CMAKE_SYTEM_VERSION STREQUAL CMAKE_HOST_SYSTEM_VERSION) if (DEFINED CMAKE_SYSTEM_VERSION AND NOT CMAKE_SYSTEM_VERSION STREQUAL CMAKE_HOST_SYSTEM_VERSION)
list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}") list(APPEND CMAKE_PASSTHROUGH_ARGS "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}")
endif() endif()
if (DEFINED CMAKE_TOOLCHAIN_FILE) if (DEFINED CMAKE_TOOLCHAIN_FILE)