aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-04-29 14:45:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-04-29 14:45:40 -0700
commitd5cf59ac87b14eee47e229fe0543c8faa27a2ff4 (patch)
treeb9c849ffd8061189f52f98f16c5ab366ca6205a7
parent9e8d324014afa35df05bdc70ba8f2990909b6d74 (diff)
support -o with precompiled headers; fixes #2320
-rwxr-xr-xemcc4
-rw-r--r--tests/test_other.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/emcc b/emcc
index 47dbc60d..d2de63fc 100755
--- a/emcc
+++ b/emcc
@@ -1366,7 +1366,9 @@ try:
for header in input_files:
assert header.endswith(HEADER_ENDINGS), 'if you have one header input, we assume you want to precompile headers, and cannot have source files or other inputs as well: ' + str(input_files) + ' : ' + header
args = newargs + shared.EMSDK_CXX_OPTS + input_files
- logging.debug("running (for precompiled headers: " + call + ' ' + ' '.join(args))
+ if specified_target:
+ args += ['-o', specified_target]
+ logging.debug("running (for precompiled headers): " + call + ' ' + ' '.join(args))
execute([call] + args) # let compiler frontend print directly, so colors are saved (PIPE kills that)
sys.exit(1)
diff --git a/tests/test_other.py b/tests/test_other.py
index 0721bb35..4560ac6e 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -2380,6 +2380,11 @@ int main() {
err = Popen([PYTHON, EMCC, 'src.cpp', '-include', 'header.h', '-Xclang', '-print-stats'], stderr=PIPE).communicate()
assert '*** PCH/Modules Loaded:\nModule: header.h.gch' not in err[1], err[1]
+ # with specified target via -o
+ try_delete('header.h.gch')
+ Popen([PYTHON, EMCC, '-xc++-header', 'header.h', '-o', 'my.gch']).communicate()
+ assert os.path.exists('my.gch')
+
def test_warn_unaligned(self):
if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('need fastcomp')
open('src.cpp', 'w').write(r'''