Skip to content

Commit

Permalink
Check sizeof(int) and sizeof(size_t)
Browse files Browse the repository at this point in the history
  • Loading branch information
TurkeyMcMac committed Oct 23, 2022
1 parent 0a82cb4 commit e86d23d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
project(minetest)

INCLUDE(CheckTypeSize)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckLibraryExists)

check_type_size(int SIZEOF_INT BUILTIN_TYPES_ONLY LANGUAGE CXX)
if(SIZEOF_INT LESS 4)
message(FATAL_ERROR "Minetest will not work with int less than 32 bits wide.")
endif()

check_type_size(size_t SIZEOF_SIZE_T LANGUAGE CXX)
if(SIZEOF_SIZE_T LESS 4)
message(FATAL_ERROR "Minetest will not work with size_t less than 32 bits wide.")
endif()

# Add custom SemiDebug build mode
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-O1 -g -Wall" CACHE STRING
"Flags used by the C++ compiler during semidebug builds."
Expand Down

0 comments on commit e86d23d

Please sign in to comment.