CMake: fix CMAKE_BUILD_TYPE and BITS check

(cherry picked from commit 165ad14b0f)
pull/830/head
Joshua Cooper 2022-02-05 15:34:24 -05:00 committed by Rémi Verschelde
parent bf0d95369d
commit 43fae056d0
1 changed files with 8 additions and 6 deletions

View File

@ -52,7 +52,7 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${BUILD_PATH}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BUILD_PATH}") SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${BUILD_PATH}")
# Default build type is Debug in the SConstruct # Default build type is Debug in the SConstruct
if(CMAKE_BUILD_TYPE STREQUAL "") if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
endif() endif()
@ -67,6 +67,13 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
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 # Input from user for godot headers and the api file
set(GODOT_HEADERS_DIR "godot-headers" CACHE STRING "") set(GODOT_HEADERS_DIR "godot-headers" CACHE STRING "")
set(GODOT_CUSTOM_API_FILE "godot-headers/api.json" CACHE STRING "") set(GODOT_CUSTOM_API_FILE "godot-headers/api.json" CACHE STRING "")
@ -190,11 +197,6 @@ set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS ${GODOT_LI
# Create the correct name (godot.os.build_type.system_bits) # Create the correct name (godot.os.build_type.system_bits)
set(BITS 32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITS 64)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
string(TOLOWER "${CMAKE_SYSTEM_NAME}" SYSTEM_NAME) string(TOLOWER "${CMAKE_SYSTEM_NAME}" SYSTEM_NAME)
string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE) string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE)