diff options
author | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-10 15:27:37 +0400 |
---|---|---|
committer | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2011-07-10 15:27:37 +0400 |
commit | 5c373b56d6460f68f251098ea50c736236b4683d (patch) | |
tree | 5865babefc0c34a729f62efaa50e49077f6f6df8 /CMakeLists.txt | |
parent | 1f81b7e4b971b809bbb919afdd017314dd1f7916 (diff) |
CMakeLists: Make sure that a non-negative 'int' can be cast to a 'size_t'. Fix required CMake version.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d69952..080cbeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(BADVPN C) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") @@ -39,6 +39,11 @@ if (NOT (INT_SIZE GREATER "3")) message(FATAL_ERROR "int must be at least 32 bits") endif () +check_type_size(size_t SIZE_SIZE) +if (NOT (SIZE_SIZE GREATER INT_SIZE OR SIZE_SIZE EQUAL INT_SIZE)) + message(FATAL_ERROR "size_t must be greater or equal than int") +endif () + add_definitions(-std=gnu99 -Werror=implicit-function-declaration -Wno-unused-value -Wno-parentheses -Wno-switch-enum -Wredundant-decls) # platform-specific stuff |