Skip to content

Commit e41bdcd

Browse files
jkdhnnashif
authored andcommitted
cmake: Fix CMAKE_BUILD_TYPE and OPTIMIZATION_FLAG match check
The check introduced in #18777 uses incorrect CMake syntax. IN_LIST requires the list variable name, not its content. Signed-off-by: Jack Dähn <[email protected]>
1 parent c272305 commit e41bdcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ set(build_types None Debug Release RelWithDebInfo MinSizeRel)
15191519
if((CMAKE_BUILD_TYPE IN_LIST build_types) AND (NOT NO_BUILD_TYPE_WARNING))
15201520
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_uppercase)
15211521

1522-
if(NOT (${OPTIMIZATION_FLAG} IN_LIST ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_uppercase}}))
1522+
if(NOT (${OPTIMIZATION_FLAG} IN_LIST CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_uppercase}))
15231523
message(WARNING "
15241524
The CMake build type was set to '${CMAKE_BUILD_TYPE}', but the optimization flag was set to '${OPTIMIZATION_FLAG}'.
15251525
This may be intentional and the warning can be turned off by setting the CMake variable 'NO_BUILD_TYPE_WARNING'"

0 commit comments

Comments
 (0)