@@ -20,8 +20,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
2020 add_compile_options (-Weverything )
2121endif ()
2222
23- if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
24- if (CMAKE_BUILD_TYPE MATCHES "Release" )
23+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
24+ if (CMAKE_BUILD_TYPE STREQUAL "Release" )
2525 # "Release" uses -O3 by default
2626 add_compile_options (-O2 )
2727 endif ()
@@ -45,14 +45,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"
4545 add_compile_options (-Wno-multichar )
4646endif ()
4747
48- if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" )
48+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
4949 add_compile_options (-Woverloaded-virtual ) # when a function declaration hides virtual functions from a base class
5050 add_compile_options (-Wno-maybe-uninitialized ) # there are some false positives
5151 add_compile_options (-Wsuggest-attribute=noreturn )
5252 add_compile_options (-Wno-shadow ) # whenever a local variable or type declaration shadows another one
5353elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
5454 if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 14)
55- if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
55+ if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
5656 # work around performance regression - see https://github.com/llvm/llvm-project/issues/53555
5757 add_compile_options (-mllvm -inline-deferral )
5858 endif ()
@@ -124,7 +124,7 @@ if (MSVC)
124124 # No Whole Program Optimization
125125
126126 # C/C++ - Optimization
127- if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
127+ if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
128128 add_compile_options (/O2 ) # Optimization - Maximum Optimization (Favor Speed)
129129 add_compile_options (/Ob2 ) # Inline Function Expansion - Any Suitable
130130 add_compile_options (/Oi ) # Enable Intrinsic Functions
@@ -135,7 +135,7 @@ if (MSVC)
135135 endif ()
136136
137137 # C/C++ - Code Generation
138- if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
138+ if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
139139 add_compile_options (/GF ) # Enable String Pooling
140140 add_compile_options (/MD ) # Runtime Library - Multi-threaded DLL
141141 add_compile_options (/GS- ) # Disable Security Check
@@ -172,7 +172,7 @@ if (MSVC)
172172 add_compile_options (/Zc:throwingNew /Zc:__cplusplus ) # Additional Options
173173
174174 # Linker - General
175- if (CMAKE_BUILD_TYPE MATCHES "Debug" )
175+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
176176 add_link_options (/INCREMENTAL ) # Enable Incremental Linking - Yes
177177 endif ()
178178 add_link_options (/NOLOGO ) # SUppress Startup Banner - Yes
@@ -191,13 +191,13 @@ if (MSVC)
191191 add_link_options (/OPT:ICF ) # Enable COMDAT Folding - Yes
192192
193193 # Linker - Advanced
194- if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
194+ if (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
195195 add_link_options (/RELEASE ) # Set Checksum - Yes
196196 endif ()
197197endif ()
198198
199199# TODO: check if this can be enabled again - also done in Makefile
200- if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND
200+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
201201 CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
202202
203203 add_compile_options (-U_GLIBCXX_DEBUG )
0 commit comments