build: replace deprecated CMAKE_COMPILER_IS_GNUCC variable

Instead use the recommended form `CMAKE_C_COMPILER_ID MATCHES "GNU"`
This commit is contained in:
Dundar Göc
2022-08-26 14:30:55 +02:00
committed by dundargoc
parent 42aeb5c5b1
commit b9aafb85e6

View File

@@ -96,7 +96,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# Work around some old, broken detection by CMake for knowing when to use the # Work around some old, broken detection by CMake for knowing when to use the
# isystem flag. Apple's compilers have supported this for quite some time # isystem flag. Apple's compilers have supported this for quite some time
# now. # now.
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ") set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
endif() endif()
endif() endif()
@@ -170,7 +170,7 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3")
string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
endif() endif()
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_C_COMPILER_ID MATCHES "GNU")
check_c_compiler_flag(-Og HAS_OG_FLAG) check_c_compiler_flag(-Og HAS_OG_FLAG)
else() else()
set(HAS_OG_FLAG 0) set(HAS_OG_FLAG 0)