From 165ad14b0fe39234dd257e421948c23f6571177f Mon Sep 17 00:00:00 2001 From: Joshua Cooper Date: Sat, 5 Feb 2022 15:34:24 -0500 Subject: [PATCH] CMake: fix CMAKE_BUILD_TYPE and BITS check --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f95ebe6..a0c6be6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${BUILD_PATH}") SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BUILD_PATH}") # Default build type is Debug in the SConstruct -if(CMAKE_BUILD_TYPE STREQUAL "") +if("${CMAKE_BUILD_TYPE}" STREQUAL "") set(CMAKE_BUILD_TYPE Debug) endif() @@ -66,10 +66,12 @@ if(FLOAT_TYPE EQUAL 64) set(FLOAT_TYPE_FLAG "double" CACHE STRING "") endif(FLOAT_TYPE EQUAL 64) -set(BITS 32) -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(BITS 64) -endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +if(NOT DEFINED BITS) + set(BITS 32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(BITS 64) + endif(CMAKE_SIZEOF_VOID_P EQUAL 8) +endif() # Input from user for godot headers and the api file set(GODOT_HEADERS_DIR "godot-headers" CACHE STRING "")