CMake: fix CMAKE_BUILD_TYPE and BITS check

pull/687/head
Joshua Cooper 2022-02-05 15:34:24 -05:00 committed by Rémi Verschelde
parent 9b4519280a
commit 165ad14b0f
1 changed files with 7 additions and 5 deletions

View File

@ -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)
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(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 "")