Map multiple /FI flags for VS < 10 (#11649)

The /FI flag may be repeated so the flag table entry needs to be marked
with SemicolonAppendable.  This was already the case for VS 10.
This commit is contained in:
Brad King 2011-01-03 10:02:16 -05:00
parent edff9207ed
commit b29eadd8f3
6 changed files with 21 additions and 1 deletions

View File

@ -427,7 +427,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
// The YX and Yu options are in a per-global-generator table because
// their values differ based on the VS IDE version.
{"ForcedIncludeFiles", "FI", "Forced include files", "",
cmVS7FlagTable::UserValueRequired},
cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SemicolonAppendable},
// boolean flags
{"BufferSecurityCheck", "GS", "Buffer security check", "TRUE", 0},

View File

@ -1044,6 +1044,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
IF(CMAKE_TEST_MSVC)
ADD_TEST_MACRO(ForceInclude foo)
ADD_TEST_MACRO(PrecompiledHeader foo)
ADD_TEST_MACRO(ModuleDefinition example_exe)
ENDIF(CMAKE_TEST_MSVC)

View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 2.8.3.20110103)
project(ForceInclude C)
# Make sure the proper compiler is in use.
if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel")
endif()
add_executable(foo foo.c)
set_property(SOURCE foo.c PROPERTY COMPILE_FLAGS "/FIfoo1.h /FIfoo2.h")

7
Tests/ForceInclude/foo.c Normal file
View File

@ -0,0 +1,7 @@
#ifndef FOO_1
# error "foo1.h not included by /FI"
#endif
#ifndef FOO_2
# error "foo2.h not included by /FI"
#endif
int main(void) { return 0; }

View File

@ -0,0 +1 @@
#define FOO_1

View File

@ -0,0 +1 @@
#define FOO_2