mirror of
https://github.com/CNugteren/CLBlast.git
synced 2024-08-27 15:27:01 +02:00
Fixes for CMake policy CMP0054
This commit is contained in:
parent
7ad5cc89d0
commit
9bccc2544a
|
@ -37,40 +37,40 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH false) # Don't add the automatically deter
|
||||||
# ==================================================================================================
|
# ==================================================================================================
|
||||||
|
|
||||||
# Compiler-version check (requires at least CMake 2.8.10)
|
# Compiler-version check (requires at least CMake 2.8.10)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
|
||||||
message(FATAL_ERROR "GCC version must be at least 4.7")
|
message(FATAL_ERROR "GCC version must be at least 4.7")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
|
||||||
message(FATAL_ERROR "Clang version must be at least 3.3")
|
message(FATAL_ERROR "Clang version must be at least 3.3")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||||
message(FATAL_ERROR "AppleClang version must be at least 5.0")
|
message(FATAL_ERROR "AppleClang version must be at least 5.0")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Intel)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
|
||||||
message(FATAL_ERROR "ICC version must be at least 14.0")
|
message(FATAL_ERROR "ICC version must be at least 14.0")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
|
||||||
message(FATAL_ERROR "MS Visual Studio version must be at least 18.0")
|
message(FATAL_ERROR "MS Visual Studio version must be at least 18.0")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# C++ compiler settings
|
# C++ compiler settings
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
|
||||||
set(FLAGS "/Ox")
|
set(FLAGS "/Ox")
|
||||||
set(FLAGS "${FLAGS} /wd4715")
|
set(FLAGS "${FLAGS} /wd4715")
|
||||||
else()
|
else()
|
||||||
set(FLAGS "-O3 -std=c++11")
|
set(FLAGS "-O3 -std=c++11")
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
|
||||||
set(FLAGS "${FLAGS} -Wall -Wno-comment -Wno-return-type -Wno-switch -Wno-missing-noreturn")
|
set(FLAGS "${FLAGS} -Wall -Wno-comment -Wno-return-type -Wno-switch -Wno-missing-noreturn")
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0)
|
||||||
set(FLAGS "${FLAGS} -Wno-attributes -Wno-unused-variable")
|
set(FLAGS "${FLAGS} -Wno-attributes -Wno-unused-variable")
|
||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||||
set(FLAGS "${FLAGS} -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded")
|
set(FLAGS "${FLAGS} -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded")
|
||||||
set(FLAGS "${FLAGS} -Wno-missing-prototypes -Wno-float-equal -Wno-switch-enum -Wno-switch")
|
set(FLAGS "${FLAGS} -Wno-missing-prototypes -Wno-float-equal -Wno-switch-enum -Wno-switch")
|
||||||
set(FLAGS "${FLAGS} -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-noreturn")
|
set(FLAGS "${FLAGS} -Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-noreturn")
|
||||||
|
@ -80,7 +80,7 @@ endif()
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
|
||||||
|
|
||||||
# C compiler settings (for the sample)
|
# C compiler settings (for the sample)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
|
||||||
set(CFLAGS "/Ox")
|
set(CFLAGS "/Ox")
|
||||||
else()
|
else()
|
||||||
set(CFLAGS "-O3 -std=c99")
|
set(CFLAGS "-O3 -std=c99")
|
||||||
|
|
Loading…
Reference in a new issue