From 0b181cec03a17b4f8427cd2e4a387812332161d7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 30 Jan 2024 12:13:38 -0500 Subject: CMakeDetermineSystem: Clarify comment when CMAKE_SYSTEM_NAME is already set --- Modules/CMakeDetermineSystem.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index fff4e9d..f338aac 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -177,11 +177,9 @@ if(CMAKE_TOOLCHAIN_FILE) endif() endif() - -# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file -# or it was set via -DCMAKE_SYSTEM_NAME=... -# if that's the case, assume we are crosscompiling if(CMAKE_SYSTEM_NAME) + # CMAKE_SYSTEM_NAME was set by a toolchain file or on the command line. + # Assume it set CMAKE_SYSTEM_VERSION and CMAKE_SYSTEM_PROCESSOR too. if(NOT DEFINED CMAKE_CROSSCOMPILING) set(CMAKE_CROSSCOMPILING TRUE) endif() @@ -193,6 +191,7 @@ elseif(CMAKE_VS_WINCE_VERSION) set(CMAKE_CROSSCOMPILING TRUE) set(PRESET_CMAKE_SYSTEM_NAME TRUE) else() + # Build for the host platform and architecture by default. set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") if(NOT DEFINED CMAKE_SYSTEM_VERSION) set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") -- cgit v0.12 From 79ce5ef4e0fe982f663ca4e4a4870ce8007ecba6 Mon Sep 17 00:00:00 2001 From: Pavel Ferencz Date: Sat, 27 Jan 2024 22:56:46 +0200 Subject: CMakeDetermineSystem: Simplify cross-compiling logging decision --- Modules/CMakeDetermineSystem.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index f338aac..1ccde43 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -183,13 +183,11 @@ if(CMAKE_SYSTEM_NAME) if(NOT DEFINED CMAKE_CROSSCOMPILING) set(CMAKE_CROSSCOMPILING TRUE) endif() - set(PRESET_CMAKE_SYSTEM_NAME TRUE) elseif(CMAKE_VS_WINCE_VERSION) set(CMAKE_SYSTEM_NAME "WindowsCE") set(CMAKE_SYSTEM_VERSION "${CMAKE_VS_WINCE_VERSION}") set(CMAKE_SYSTEM_PROCESSOR "${MSVC_C_ARCHITECTURE_ID}") set(CMAKE_CROSSCOMPILING TRUE) - set(PRESET_CMAKE_SYSTEM_NAME TRUE) else() # Build for the host platform and architecture by default. set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") @@ -205,7 +203,6 @@ else() ) endif() set(CMAKE_CROSSCOMPILING FALSE) - set(PRESET_CMAKE_SYSTEM_NAME FALSE) endif() include(Platform/${CMAKE_SYSTEM_NAME}-Determine OPTIONAL) @@ -223,7 +220,7 @@ endif() # in this case there is no CMAKE_BINARY_DIR if(CMAKE_BINARY_DIR) # write entry to the log file - if(PRESET_CMAKE_SYSTEM_NAME) + if(CMAKE_CROSSCOMPILING) message(CONFIGURE_LOG "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n" "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n" -- cgit v0.12