diff options
author | Brad King <brad.king@kitware.com> | 2006-02-20 19:21:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-02-20 19:21:10 (GMT) |
commit | 7bdec941542ab7cf93a7d6417ff2e5528d6b1b87 (patch) | |
tree | 3d7314a6065e9e88ded890aaa28afd74f9d86021 /Source/cmLocalVisualStudio6Generator.cxx | |
parent | 39e636a4a40de5dd57ea083c65f41fb38755a015 (diff) | |
download | CMake-7bdec941542ab7cf93a7d6417ff2e5528d6b1b87.zip CMake-7bdec941542ab7cf93a7d6417ff2e5528d6b1b87.tar.gz CMake-7bdec941542ab7cf93a7d6417ff2e5528d6b1b87.tar.bz2 |
BUG: Add target-level COMPILE_FLAGS to the target not the individual source files. This simplifies the generated files and puts flags in a more logical order (VS6 works, VS7 needs more translation to work).
Diffstat (limited to 'Source/cmLocalVisualStudio6Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index cff119c..804a87c 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -432,15 +432,11 @@ void cmLocalVisualStudio6Generator::WriteGroup(const cmSourceGroup *sg, cmTarget (*sf)->GetCustomCommand(); std::string compileFlags; std::vector<std::string> depends; - const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS"); - if(cflags) - { - compileFlags = cflags; - } - if(target.GetProperty("COMPILE_FLAGS")) + + // Add per-source file flags. + if(const char* cflags = (*sf)->GetProperty("COMPILE_FLAGS")) { - compileFlags += " "; - compileFlags += target.GetProperty("COMPILE_FLAGS"); + compileFlags += cflags; } const char* lang = @@ -1246,7 +1242,14 @@ void cmLocalVisualStudio6Generator { flags += " /D \"_MBCS\""; } - + + // Add per-target flags. + if(const char* targetFlags = target.GetProperty("COMPILE_FLAGS")) + { + flags += " "; + flags += targetFlags; + } + // The template files have CXX FLAGS in them, that need to be replaced. // There are not separate CXX and C template files, so we use the same // variable names. The previous code sets up flags* variables to contain |