Attempt 2 at making warnings work
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
This commit is contained in:
parent
44d6dac407
commit
d6ec92cba5
2 changed files with 25 additions and 26 deletions
|
@ -25,13 +25,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|||
message(STATUS "Compiling with clang")
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Using GCC
|
||||
set(COMPILER_IS_GCC true)
|
||||
message(STATUS "Compiling with gcc")
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# Using Intel C++
|
||||
set(COMPILER_IS_ICC true)
|
||||
message(STATUS "Compiling with ICC")
|
||||
|
|
|
@ -6,30 +6,6 @@ endif()
|
|||
|
||||
project(bin2h LANGUAGES C)
|
||||
|
||||
# Has to be placed after "project()"
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Using Clang (this is a match so that we also get "AppleClang" which is the Apple-provided Clang
|
||||
set(COMPILER_IS_CLANG true)
|
||||
message(STATUS "Compiling with clang")
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||
# Using GCC
|
||||
set(COMPILER_IS_GCC true)
|
||||
message(STATUS "Compiling with gcc")
|
||||
endif()
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||
# Using Intel C++
|
||||
set(COMPILER_IS_ICC true)
|
||||
message(STATUS "Compiling with ICC")
|
||||
endif()
|
||||
|
||||
if (COMPILER_IS_CLANG OR COMPILER_IS_GCC OR COMPILER_IS_ICC)
|
||||
set(COMPILER_IS_GCC_COMPATIBLE true)
|
||||
message(STATUS "Compiling with a GCC-compatible compiler")
|
||||
endif()
|
||||
|
||||
add_executable(bin2h "bin2h.c")
|
||||
|
||||
set_target_properties(bin2h PROPERTIES
|
||||
|
@ -38,6 +14,29 @@ set_target_properties(bin2h PROPERTIES
|
|||
C_EXTENSIONS OFF
|
||||
)
|
||||
|
||||
# Has to be placed after "project()"
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# Using Clang (this is a match so that we also get "AppleClang" which is the Apple-provided Clang
|
||||
set(COMPILER_IS_CLANG true)
|
||||
message(STATUS "Compiling with clang")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# Using GCC
|
||||
set(COMPILER_IS_GCC true)
|
||||
message(STATUS "Compiling with gcc")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# Using Intel C++
|
||||
set(COMPILER_IS_ICC true)
|
||||
message(STATUS "Compiling with ICC")
|
||||
endif()
|
||||
|
||||
if (COMPILER_IS_CLANG OR COMPILER_IS_GCC OR COMPILER_IS_ICC)
|
||||
set(COMPILER_IS_GCC_COMPATIBLE true)
|
||||
message(STATUS "Compiling with a GCC-compatible compiler")
|
||||
endif()
|
||||
|
||||
if (WARNINGS)
|
||||
# HACK : Replace this with CMake provided stuff when possible (when CMake makes avoiding this possible (it isn't currently))
|
||||
|
|
Loading…
Add table
Reference in a new issue