Cleanup: remove_cc_flag use in CMake
- Pass multiple arguments at once. - Move comments above each argument. - Quote the arguments (for consistency).
This commit is contained in:
@@ -781,8 +781,12 @@ macro(remove_strict_flags)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
|
||||
remove_cc_flag(
|
||||
# Restore warn C4100 (unreferenced formal parameter) back to w4.
|
||||
"/w34100"
|
||||
# Restore warn C4189 (unused variable) back to w4.
|
||||
"/w34189"
|
||||
)
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
@@ -801,7 +805,10 @@ macro(remove_extra_strict_flags)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
remove_cc_flag(/w34100) # Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||
remove_cc_flag(
|
||||
# Restore warn C4100 (unreferenced formal parameter) back to w4.
|
||||
"/w34100"
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
@@ -154,8 +154,11 @@ if(NOT WITH_PYTHON_MODULE)
|
||||
endif()
|
||||
configure_file(${CMAKE_SOURCE_DIR}/release/windows/manifest/blender.exe.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/blender.exe.manifest @ONLY)
|
||||
|
||||
|
||||
remove_cc_flag("/MDd" "/MD" "/Zi")
|
||||
remove_cc_flag(
|
||||
"/MDd"
|
||||
"/MD"
|
||||
"/Zi"
|
||||
)
|
||||
|
||||
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
|
||||
string(APPEND CMAKE_CXX_FLAGS " ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
|
||||
|
||||
@@ -18,7 +18,7 @@ if(WIN32)
|
||||
# Some files in extern are being included which brings up a bunch of
|
||||
# "unreferenced formal parameter" warnings.
|
||||
# So restore warn C4100 (unreferenced formal parameter) back to w4
|
||||
remove_cc_flag(/w34100)
|
||||
remove_cc_flag("/w34100")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ if(WIN32)
|
||||
# Some USD library headers trigger the "unreferenced formal parameter"
|
||||
# warning alert.
|
||||
# Silence them by restore warn C4100 back to w4
|
||||
remove_cc_flag(/w34100)
|
||||
remove_cc_flag("/w34100")
|
||||
endif()
|
||||
|
||||
set(INC
|
||||
|
||||
@@ -147,8 +147,10 @@ endif()
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
string(APPEND GENSRC_FLAGS " -Wno-missing-variable-declarations")
|
||||
elseif(MSVC)
|
||||
# Restore warn C4100 (unreferenced formal parameter) back to w4
|
||||
remove_cc_flag(/w34100)
|
||||
remove_cc_flag(
|
||||
# Restore warn C4100 (unreferenced formal parameter) back to w4.
|
||||
"/w34100"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(GENSRC_C ${GENSRC})
|
||||
|
||||
Reference in New Issue
Block a user