From 974f43338b09e6ae4342015e2cc088d751943cb0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 22 Jun 2017 09:30:43 -0400 Subject: VS: Fix support for rc /nologo flag in per-source COMPILE_FLAGS Since commit v3.9.0-rc1~160^2 (VS: Use tool-specific flag table for COMPILE_FLAGS parsing, 2017-05-03) we now correctly use the `rc` flag table to process the COMPILE_FLAGS flags of `.rc` source files instead of incorrectly using the `cl` flag table as before. However, our `rc` flag table is not complete. The `/nologo` flag was working before only by accident because the `cl` flag table entry for it happened to match. Add the proper entry to the `rc` flag table. Fixes: #16991 --- Source/cmVS10RCFlagTable.h | 1 + Source/cmVS11RCFlagTable.h | 1 + Source/cmVS12RCFlagTable.h | 1 + Source/cmVS14RCFlagTable.h | 1 + Tests/VSResource/CMakeLists.txt | 4 ++++ 5 files changed, 8 insertions(+) diff --git a/Source/cmVS10RCFlagTable.h b/Source/cmVS10RCFlagTable.h index 32f35e5..6e2b834 100644 --- a/Source/cmVS10RCFlagTable.h +++ b/Source/cmVS10RCFlagTable.h @@ -1,6 +1,7 @@ static cmVS7FlagTable cmVS10RCFlagTable[] = { // Bool Properties { "NullTerminateStrings", "n", "", "true", 0 }, + { "SuppressStartupBanner", "nologo", "", "true", 0 }, { 0, 0, 0, 0, 0 } }; diff --git a/Source/cmVS11RCFlagTable.h b/Source/cmVS11RCFlagTable.h index 666e434..4997fe1 100644 --- a/Source/cmVS11RCFlagTable.h +++ b/Source/cmVS11RCFlagTable.h @@ -1,6 +1,7 @@ static cmVS7FlagTable cmVS11RCFlagTable[] = { // Bool Properties { "NullTerminateStrings", "n", "", "true", 0 }, + { "SuppressStartupBanner", "nologo", "", "true", 0 }, { 0, 0, 0, 0, 0 } }; diff --git a/Source/cmVS12RCFlagTable.h b/Source/cmVS12RCFlagTable.h index d047f824..a650f85 100644 --- a/Source/cmVS12RCFlagTable.h +++ b/Source/cmVS12RCFlagTable.h @@ -1,6 +1,7 @@ static cmVS7FlagTable cmVS12RCFlagTable[] = { // Bool Properties { "NullTerminateStrings", "n", "", "true", 0 }, + { "SuppressStartupBanner", "nologo", "", "true", 0 }, { 0, 0, 0, 0, 0 } }; diff --git a/Source/cmVS14RCFlagTable.h b/Source/cmVS14RCFlagTable.h index 11e00d5..5dc8d5a 100644 --- a/Source/cmVS14RCFlagTable.h +++ b/Source/cmVS14RCFlagTable.h @@ -1,6 +1,7 @@ static cmVS7FlagTable cmVS14RCFlagTable[] = { // Bool Properties { "NullTerminateStrings", "n", "", "true", 0 }, + { "SuppressStartupBanner", "nologo", "", "true", 0 }, { 0, 0, 0, 0, 0 } }; diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt index 3b9cfc3..3f56303 100644 --- a/Tests/VSResource/CMakeLists.txt +++ b/Tests/VSResource/CMakeLists.txt @@ -51,5 +51,9 @@ add_library(ResourceLib STATIC lib.cpp lib.rc) add_executable(VSResource main.cpp test.rc) target_link_libraries(VSResource ResourceLib) +if(MSVC AND NOT MSVC_VERSION VERSION_LESS 1600) + set_property(SOURCE test.rc PROPERTY COMPILE_FLAGS /nologo) +endif() + set_property(TARGET VSResource PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val") -- cgit v0.12