ref: d6ec92cba5885dbca1ad11464e08ce5be74e20af
parent: 44d6dac407d8dc158468fba33dd4b92e7d734d32
author: Gabriel Ravier <gabravier@gmail.com>
date: Sun Oct 27 17:02:59 EDT 2019
Attempt 2 at making warnings work Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,13 +25,13 @@
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")
--- a/bin2h/CMakeLists.txt
+++ b/bin2h/CMakeLists.txt
@@ -6,6 +6,14 @@
project(bin2h LANGUAGES C)
+add_executable(bin2h "bin2h.c")
+
+set_target_properties(bin2h PROPERTIES
+ C_STANDARD 90
+ C_STANDARD_REQUIRED ON
+ 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
@@ -13,13 +21,13 @@
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")
@@ -29,15 +37,6 @@
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
- C_STANDARD 90
- C_STANDARD_REQUIRED ON
- C_EXTENSIONS OFF
-)
-
if (WARNINGS)
# HACK : Replace this with CMake provided stuff when possible (when CMake makes avoiding this possible (it isn't currently))
--
⑨