Skip to content

Commit

Permalink
Merge b42fd7c into e7b15e2
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbaddog committed Mar 24, 2018
2 parents e7b15e2 + b42fd7c commit 0f6bcc3
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
From William Deegan:
- Remove long deprecated SCons.Options code and tests. This removes BoolOption,EnumOption,
ListOption,PackageOption, and PathOption which have been replaced by *Variable() many years ago.
- Fix issue # 3106 MSVC if using MSVC_BATCH and target dir had a space would fail due to quirk in
MSVC's handling of escaped targetdirs when batch compiling.

From Andrew Featherstone
- Removed unused --warn options from the man page and source code.
Expand Down
5 changes: 4 additions & 1 deletion src/engine/SCons/Tool/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ def msvc_output_flag(target, source, env, for_signature):
# that the test(s) for this can be run on non-Windows systems
# without having a hard-coded backslash mess up command-line
# argument parsing.
return '/Fo${TARGET.dir}' + os.sep
# Adding double os.sep's as if the TARGET.dir has a space or otherwise
# needs to be quoted they are needed per MSVC's odd behavior
# See: https://github.com/SCons/scons/issues/3106
return '/Fo${TARGET.dir}' + os.sep*2

CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR",
batch_key=msvc_batch_key,
Expand Down
11 changes: 11 additions & 0 deletions test/MSVC/MSVC_BATCH-spaces-targetdir.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import TestSCons



test = TestSCons.TestSCons()

test.skip_if_not_msvc()


test.dir_fixture('MSVC_BATCH-spaces-targetdir')
test.run()
8 changes: 8 additions & 0 deletions test/MSVC/MSVC_BATCH-spaces-targetdir/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os.path

env=Environment(MSVC_BATCH=True)

td='tar ge tdir'
VariantDir(td,'src')
env.Program(os.path.join(td,'test_program'),
[os.path.join(td,a) for a in ['a.c','b.c','c.c']])
15 changes: 15 additions & 0 deletions test/MSVC/MSVC_BATCH-spaces-targetdir/src/a.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include <stdio.h>

extern void myfuncb();
extern void myfuncc();


void myfunca() {
printf("myfunca\n");
}

int main(int argc, char *argv[]) {
myfunca();
myfuncb();
myfuncc();
}
5 changes: 5 additions & 0 deletions test/MSVC/MSVC_BATCH-spaces-targetdir/src/b.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>

void myfuncb() {
printf("myfuncb\n");
}
5 changes: 5 additions & 0 deletions test/MSVC/MSVC_BATCH-spaces-targetdir/src/c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>

void myfuncc() {
printf("myfuncc\n");
}
12 changes: 7 additions & 5 deletions test/MSVC/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
platform.
"""

import os
import TestSCons

test = TestSCons.TestSCons()
Expand Down Expand Up @@ -72,6 +73,7 @@
""")

test.write('SConstruct', """
DefaultEnvironment(tools=[])
cccom = r'%(_python_)s fake_cl.py $_MSVC_OUTPUT_FLAG $CHANGED_SOURCES'
linkcom = r'%(_python_)s fake_link.py ${TARGET.windows} $SOURCES'
env = Environment(tools=['msvc', 'mslink'],
Expand All @@ -96,8 +98,8 @@

test.must_match('prog.exe', "prog.c\nf1.c\nf2.c\n", mode='r')
test.must_match('fake_cl.log', """\
/Fo. prog.c f1.c f2.c
""", mode='r')
/Fo.%s prog.c f1.c f2.c
"""%os.sep, mode='r')

test.up_to_date(options = 'MSVC_BATCH=1', arguments = '.')

Expand All @@ -109,9 +111,9 @@

test.must_match('prog.exe', "prog.c\nf1.c 2\nf2.c\n", mode='r')
test.must_match('fake_cl.log', """\
/Fo. prog.c f1.c f2.c
/Fo. f1.c
""", mode='r')
/Fo.%s prog.c f1.c f2.c
/Fo.%s f1.c
"""%(os.sep, os.sep), mode='r')

test.up_to_date(options = 'MSVC_BATCH=1', arguments = '.')

Expand Down

0 comments on commit 0f6bcc3

Please sign in to comment.