diff options
author | Ivan Kravets <me@ikravets.com> | 2019-11-06 10:49:48 (GMT) |
---|---|---|
committer | Ivan Kravets <me@ikravets.com> | 2019-11-06 10:49:48 (GMT) |
commit | 30f8d95881195eb977825f4210d48fc571f9d37c (patch) | |
tree | d51f8da6cf1c48133f52e8c825487db9987d56e7 | |
parent | 44be58d63189400b1105300c1508243777b45c2e (diff) | |
download | SCons-30f8d95881195eb977825f4210d48fc571f9d37c.zip SCons-30f8d95881195eb977825f4210d48fc571f9d37c.tar.gz SCons-30f8d95881195eb977825f4210d48fc571f9d37c.tar.bz2 |
Added support for "-imacros" to ParseFlags
-rw-r--r-- | doc/generated/functions.gen | 11 | ||||
-rwxr-xr-x | src/CHANGES.txt | 6 | ||||
-rw-r--r-- | src/engine/SCons/Environment.py | 56 | ||||
-rw-r--r-- | src/engine/SCons/Environment.xml | 1 | ||||
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 2 |
5 files changed, 40 insertions, 36 deletions
diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index e55799c..f3f2a0c 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -2505,16 +2505,16 @@ This specifies help text to be printed if the <option>-h</option> argument is given to <filename xmlns="http://www.scons.org/dbxsd/v1.0">scons</filename>. -If +If <function xmlns="http://www.scons.org/dbxsd/v1.0">Help</function> -is called multiple times, the text is appended together in the order that +is called multiple times, the text is appended together in the order that <function xmlns="http://www.scons.org/dbxsd/v1.0">Help</function> -is called. With append set to False, any +is called. With append set to False, any <function xmlns="http://www.scons.org/dbxsd/v1.0">Help</function> -text generated with +text generated with <function xmlns="http://www.scons.org/dbxsd/v1.0">AddOption</function> is clobbered. If append is True, the AddOption help is prepended to the help -string, thus preserving the +string, thus preserving the <option>-h</option> message. </para> @@ -2955,6 +2955,7 @@ and added to the following construction variables: -fmerge-all-constants CCFLAGS, LINKFLAGS -fopenmp CCFLAGS, LINKFLAGS -include CCFLAGS +-imacros CCFLAGS -isysroot CCFLAGS, LINKFLAGS -isystem CCFLAGS -iquote CCFLAGS diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ddc777c..092c2c8 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -32,12 +32,12 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Jakub Kulik - Fix subprocess result bytes not being decoded in SunOS/Solaris related tools. - + From Edoardo Bezzeccheri - Added debug option "action_timestamps" which outputs to stdout the absolute start and end time for each target. - + From Ivan Kravets - - Parse "-imacros" option in ParseFlags + - Added support for "-imacros" to ParseFlags RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 66912de..1296f54 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -702,34 +702,34 @@ class SubstitutionEnvironment(object): append_next_arg_to = None # for multi-word args for arg in params: if append_next_arg_to: - if append_next_arg_to == 'CPPDEFINES': - append_define(arg) - elif append_next_arg_to == '-include': - t = ('-include', self.fs.File(arg)) - dict['CCFLAGS'].append(t) - elif append_next_arg_to == '-imacros': - t = ('-imacros', self.fs.File(arg)) - dict['CCFLAGS'].append(t) - elif append_next_arg_to == '-isysroot': - t = ('-isysroot', arg) - dict['CCFLAGS'].append(t) - dict['LINKFLAGS'].append(t) - elif append_next_arg_to == '-isystem': - t = ('-isystem', arg) - dict['CCFLAGS'].append(t) - elif append_next_arg_to == '-iquote': - t = ('-iquote', arg) - dict['CCFLAGS'].append(t) - elif append_next_arg_to == '-idirafter': - t = ('-idirafter', arg) - dict['CCFLAGS'].append(t) - elif append_next_arg_to == '-arch': - t = ('-arch', arg) - dict['CCFLAGS'].append(t) - dict['LINKFLAGS'].append(t) - else: - dict[append_next_arg_to].append(arg) - append_next_arg_to = None + if append_next_arg_to == 'CPPDEFINES': + append_define(arg) + elif append_next_arg_to == '-include': + t = ('-include', self.fs.File(arg)) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-imacros': + t = ('-imacros', self.fs.File(arg)) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-isysroot': + t = ('-isysroot', arg) + dict['CCFLAGS'].append(t) + dict['LINKFLAGS'].append(t) + elif append_next_arg_to == '-isystem': + t = ('-isystem', arg) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-iquote': + t = ('-iquote', arg) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-idirafter': + t = ('-idirafter', arg) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-arch': + t = ('-arch', arg) + dict['CCFLAGS'].append(t) + dict['LINKFLAGS'].append(t) + else: + dict[append_next_arg_to].append(arg) + append_next_arg_to = None elif not arg[0] in ['-', '+']: dict['LIBS'].append(self.fs.File(arg)) elif arg == '-dylib_file': diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index 829bf12..516505c 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -2324,6 +2324,7 @@ and added to the following construction variables: -fmerge-all-constants CCFLAGS, LINKFLAGS -fopenmp CCFLAGS, LINKFLAGS -include CCFLAGS +-imacros CCFLAGS -isysroot CCFLAGS, LINKFLAGS -isystem CCFLAGS -iquote CCFLAGS diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index f016f22..0957361 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -804,6 +804,7 @@ sys.exit(0) "-iquote /usr/include/foo1 " + \ "-isystem /usr/include/foo2 " + \ "-idirafter /usr/include/foo3 " + \ + "-imacros /usr/include/foo4 " + \ "+DD64 " + \ "-DFOO -DBAR=value -D BAZ " @@ -818,6 +819,7 @@ sys.exit(0) ('-iquote', '/usr/include/foo1'), ('-isystem', '/usr/include/foo2'), ('-idirafter', '/usr/include/foo3'), + ('-imacros', env.fs.File('/usr/include/foo4')), '+DD64'], repr(d['CCFLAGS']) assert d['CXXFLAGS'] == ['-std=c++0x'], repr(d['CXXFLAGS']) assert d['CPPDEFINES'] == ['FOO', ['BAR', 'value'], 'BAZ'], d['CPPDEFINES'] |