summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-02-09 21:11:28 (GMT)
committerSteven Knight <knight@baldmt.com>2009-02-09 21:11:28 (GMT)
commit1e725d35dba7295ec9ee660f60f643abe0308fb3 (patch)
treece7c38616011baa27542f66fb34a36f617d2e542
parentd6374929b6addeceeabc611fdde346549cb3049b (diff)
downloadSCons-1e725d35dba7295ec9ee660f60f643abe0308fb3.zip
SCons-1e725d35dba7295ec9ee660f60f643abe0308fb3.tar.gz
SCons-1e725d35dba7295ec9ee660f60f643abe0308fb3.tar.bz2
Add the $CCFLAGS variable to the $PCHCOM command line, and rearrange
the arguments so the /Fo is towards the beginning of the line (like it is for $CCCOM, $CXXCOM, etc.).
-rw-r--r--src/CHANGES.txt2
-rw-r--r--src/RELEASE.txt13
-rw-r--r--src/engine/SCons/Tool/msvc.py2
-rw-r--r--test/MSVC/msvc.py11
4 files changed, 26 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 5198219..19e7cc4 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -25,6 +25,8 @@ RELEASE X.X.X - XXX
- Fix finding #include files when the string contains escaped
backslashes like "C:\\some\\include.h".
+ - Pass $CCFLAGS to Visual C/C++ precompiled header compilation.
+
From Robert P. J. Day:
- User's Guide updates.
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index 3bcf998..31aaec4 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -56,6 +56,19 @@ RELEASE 1.2.0.d20090113 - Tue, 13 Jan 2009 02:50:30 -0800
will no longer work at all, and will instead generate specific
fatal errors when anyone tries to use them.
+ Please note the following important changes since release 1.2.0:
+
+ -- VISUAL C/C++ PRECOMPILED HEADERS WILL BE REBUILT
+
+ Precompiled header files built with Visual C/C++ will be
+ rebuilt after upgrading from 1.2.0.
+
+ This rebuild is normal will occur because the command line
+ defined by the $PCHCOM construction variable has had the
+ $CCFLAGS variable added, and has been rearranged to put the
+ "/Fo" output flag towards the beginning of the line, consistent
+ with the related command lines for $CCCOM, $CXXCOM, etc.
+
Please note the following important changes since release 1.1.0:
-- THE $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES
diff --git a/src/engine/SCons/Tool/msvc.py b/src/engine/SCons/Tool/msvc.py
index 19ebd9f..443e8b0 100644
--- a/src/engine/SCons/Tool/msvc.py
+++ b/src/engine/SCons/Tool/msvc.py
@@ -812,7 +812,7 @@ def generate(env):
env['CXXFILESUFFIX'] = '.cc'
env['PCHPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Yd") or ""}'])
- env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
+ env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS'
env['BUILDERS']['PCH'] = pch_builder
if not env.has_key('ENV'):
diff --git a/test/MSVC/msvc.py b/test/MSVC/msvc.py
index 4ad562c..21e88d0 100644
--- a/test/MSVC/msvc.py
+++ b/test/MSVC/msvc.py
@@ -24,6 +24,11 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+"""
+Verify basic invocation of Microsoft Visual C/C++, including use
+of a precompiled header with the $CCFLAGS variable.
+"""
+
import os
import sys
import time
@@ -43,7 +48,8 @@ test.write('SConstruct',"""
import os
env = Environment()
env.Append(CPPPATH=os.environ.get('INCLUDE', ''),
- LIBPATH=os.environ.get('LIB', ''))
+ LIBPATH=os.environ.get('LIB', ''),
+ CCFLAGS='/DPCHDEF')
env['PDB'] = File('test.pdb')
env['PCHSTOP'] = 'StdAfx.h'
env['PCH'] = env.PCH('StdAfx.cpp')[0]
@@ -92,6 +98,9 @@ test.write('StdAfx.h', '''
test.write('StdAfx.cpp', '''
#include "StdAfx.h"
+#ifndef PCHDEF
+this line generates an error if PCHDEF is not defined!
+#endif
''')
# Visual Studio 8 has deprecated the /Yd option and prints warnings