mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
Added GLM_QUIET
This commit is contained in:
parent
abb52b7dae
commit
aff5b7a02d
@ -11,6 +11,7 @@ include(CMakePackageConfigHelpers)
|
|||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
|
option(GLM_QUIET "No CMake Message" OFF)
|
||||||
option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF)
|
option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF)
|
||||||
option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF)
|
option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF)
|
||||||
option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF)
|
option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF)
|
||||||
@ -22,27 +23,37 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||||||
if(GLM_TEST_ENABLE_CXX_20)
|
if(GLM_TEST_ENABLE_CXX_20)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
add_definitions(-DGLM_FORCE_CXX2A)
|
add_definitions(-DGLM_FORCE_CXX2A)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with C++20 features")
|
message(STATUS "GLM: Build with C++20 features")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(GLM_TEST_ENABLE_CXX_17)
|
elseif(GLM_TEST_ENABLE_CXX_17)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
add_definitions(-DGLM_FORCE_CXX17)
|
add_definitions(-DGLM_FORCE_CXX17)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with C++17 features")
|
message(STATUS "GLM: Build with C++17 features")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(GLM_TEST_ENABLE_CXX_14)
|
elseif(GLM_TEST_ENABLE_CXX_14)
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
add_definitions(-DGLM_FORCE_CXX14)
|
add_definitions(-DGLM_FORCE_CXX14)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with C++14 features")
|
message(STATUS "GLM: Build with C++14 features")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(GLM_TEST_ENABLE_CXX_11)
|
elseif(GLM_TEST_ENABLE_CXX_11)
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
add_definitions(-DGLM_FORCE_CXX11)
|
add_definitions(-DGLM_FORCE_CXX11)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with C++11 features")
|
message(STATUS "GLM: Build with C++11 features")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(GLM_TEST_ENABLE_CXX_98)
|
elseif(GLM_TEST_ENABLE_CXX_98)
|
||||||
set(CMAKE_CXX_STANDARD 98)
|
set(CMAKE_CXX_STANDARD 98)
|
||||||
add_definitions(-DGLM_FORCE_CXX98)
|
add_definitions(-DGLM_FORCE_CXX98)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with C++98 features")
|
message(STATUS "GLM: Build with C++98 features")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
|
option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
|
||||||
@ -65,7 +76,9 @@ endif()
|
|||||||
|
|
||||||
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
|
option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
|
||||||
if(GLM_TEST_ENABLE_FAST_MATH)
|
if(GLM_TEST_ENABLE_FAST_MATH)
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message(STATUS "GLM: Build with fast math optimizations")
|
message(STATUS "GLM: Build with fast math optimizations")
|
||||||
|
endif()
|
||||||
|
|
||||||
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
|
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
|
||||||
add_compile_options(-ffast-math)
|
add_compile_options(-ffast-math)
|
||||||
@ -171,23 +184,31 @@ endif()
|
|||||||
# Compiler and default options
|
# Compiler and default options
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler")
|
message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_compile_options(-Werror -Weverything)
|
add_compile_options(-Werror -Weverything)
|
||||||
add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types)
|
add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types)
|
||||||
add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral)
|
add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral)
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
|
message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_compile_options(-O2)
|
add_compile_options(-O2)
|
||||||
add_compile_options(-Wno-long-long)
|
add_compile_options(-Wno-long-long)
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler")
|
message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||||
|
endif()
|
||||||
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
if(NOT GLM_QUIET)
|
||||||
message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
|
message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_compile_options(/W4 /WX)
|
add_compile_options(/W4 /WX)
|
||||||
add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
|
add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
|
||||||
|
Loading…
Reference in New Issue
Block a user