VS: Check all default suppressed MSBuild flags

This commit is contained in:
AJIOB
2025-09-10 10:32:04 +03:00
parent 7202539fd4
commit 9851ddfc11
@@ -5,15 +5,23 @@ macro(VsDefaultCompilerFlags_check tgt)
return()
endif()
set(HAVE_BasicRuntimeChecks 0)
set(HAVE_BufferSecurityCheck 0)
set(HAVE_CallingConvention 0)
set(HAVE_FloatingPointModel 0)
set(HAVE_ForceConformanceInForLoopScope 0)
set(HAVE_MinimalRebuild 0)
set(HAVE_Optimization 0)
set(HAVE_RemoveUnreferencedCodeData 0)
set(HAVE_RuntimeLibrary 0)
set(HAVE_SupportJustMyCode 0)
set(HAVE_TreatWChar_tAsBuiltInType 0)
file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
if(line MATCHES "^ *<BasicRuntimeChecks>Default</BasicRuntimeChecks>")
set(HAVE_BasicRuntimeChecks 1)
endif()
if(line MATCHES "^ *<BufferSecurityCheck></BufferSecurityCheck>")
set(HAVE_BufferSecurityCheck 1)
endif()
@@ -26,14 +34,31 @@ macro(VsDefaultCompilerFlags_check tgt)
if(line MATCHES "^ *<ForceConformanceInForLoopScope></ForceConformanceInForLoopScope>")
set(HAVE_ForceConformanceInForLoopScope 1)
endif()
if(line MATCHES "^ *<MinimalRebuild></MinimalRebuild>")
set(HAVE_MinimalRebuild 1)
endif()
if(line MATCHES "^ *<Optimization>[^\\n<]*</Optimization>")
set(HAVE_Optimization 1)
endif()
if(line MATCHES "^ *<RemoveUnreferencedCodeData></RemoveUnreferencedCodeData>")
set(HAVE_RemoveUnreferencedCodeData 1)
endif()
if(line MATCHES "^ *<RuntimeLibrary>[^\\n<]*</RuntimeLibrary>")
set(HAVE_RuntimeLibrary 1)
endif()
if(line MATCHES "^ *<SupportJustMyCode></SupportJustMyCode>")
set(HAVE_SupportJustMyCode 1)
endif()
if(line MATCHES "^ *<TreatWChar_tAsBuiltInType></TreatWChar_tAsBuiltInType>")
set(HAVE_TreatWChar_tAsBuiltInType 1)
endif()
endforeach()
if(NOT HAVE_BasicRuntimeChecks)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <BasicRuntimeChecks> property.")
return()
endif()
if(NOT HAVE_BufferSecurityCheck)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <BufferSecurityCheck> property.")
return()
@@ -54,11 +79,31 @@ macro(VsDefaultCompilerFlags_check tgt)
return()
endif()
if(NOT HAVE_MinimalRebuild)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <MinimalRebuild> property.")
return()
endif()
if(NOT HAVE_Optimization)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <Optimization> property.")
return()
endif()
if(NOT HAVE_RemoveUnreferencedCodeData)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <RemoveUnreferencedCodeData> property.")
return()
endif()
if(NOT HAVE_RuntimeLibrary)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <RuntimeLibrary> property.")
return()
endif()
if(NOT HAVE_SupportJustMyCode)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <SupportJustMyCode> property.")
return()
endif()
if(NOT HAVE_TreatWChar_tAsBuiltInType)
set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <TreatWChar_tAsBuiltInType> property.")
return()