diff options
author | Gaƫtan Lehmann <gaetan.lehmann@gmail.com> | 2015-01-28 08:27:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-28 15:06:20 (GMT) |
commit | 7cdf28e815b45e8584a7f06d457365f3f4963d02 (patch) | |
tree | bd9670d8aa9c401f007d212f1caa8bb548f88532 | |
parent | cd657a281917fac2a954b3659a8c8b9ee57991ce (diff) | |
download | CastXML-7cdf28e815b45e8584a7f06d457365f3f4963d02.zip CastXML-7cdf28e815b45e8584a7f06d457365f3f4963d02.tar.gz CastXML-7cdf28e815b45e8584a7f06d457365f3f4963d02.tar.bz2 |
castxml: Allow -E to suppress --castxml-gccxml when used together
This helps make castxml usable with ccache. In its first pass, ccache
drops the -o and the output file from the command line and add the -E
option to get the preprocessed output. It does not now about
--castxml-gccxml, so castxml must not produce an error when the options
are used together. Instead make -E suppress --castxml-gccxml, much like
compilers do for -E and -c together.
Co-Author: Brad King <brad.king@kitware.com>
-rw-r--r-- | src/castxml.cxx | 9 | ||||
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/expect/cmd.gccxml-and-E.result.txt | 1 | ||||
-rw-r--r-- | test/expect/cmd.gccxml-and-E.stderr.txt | 4 | ||||
-rw-r--r-- | test/expect/cmd.gccxml-and-E.stdout.txt | 1 | ||||
-rw-r--r-- | test/expect/cmd.gccxml-empty-c++98-E.stderr.txt | 1 | ||||
-rw-r--r-- | test/expect/cmd.gccxml-empty-c++98-E.stdout.txt | 2 |
7 files changed, 6 insertions, 13 deletions
diff --git a/src/castxml.cxx b/src/castxml.cxx index 0dfd7d0..6b00206 100644 --- a/src/castxml.cxx +++ b/src/castxml.cxx @@ -229,15 +229,6 @@ int main(int argc_in, const char** argv_in) } } - if(opts.PPOnly && opts.GccXml) { - std::cerr << - "error: '--castxml-gccxml' and '-E' may not both be given\n" - "\n" << - usage - ; - return 1; - } - if(cc_id) { opts.HaveCC = true; if(cc_args.empty()) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fd666b6..0942cf4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -113,6 +113,7 @@ castxml_test_cmd(gccxml-and-c++14 --castxml-gccxml -std=c++14 ${empty_cxx}) castxml_test_cmd(gccxml-and-objc1 --castxml-gccxml ${empty_m}) castxml_test_cmd(gccxml-and-objc2 --castxml-gccxml ${empty_mm}) castxml_test_cmd(gccxml-empty-c++98 --castxml-gccxml -std=c++98 ${empty_cxx}) +castxml_test_cmd(gccxml-empty-c++98-E --castxml-gccxml -std=c++98 ${empty_cxx} -E) castxml_test_cmd(o-missing -o) castxml_test_cmd(start-missing --castxml-start) castxml_test_cmd(rsp-empty @${input}/empty.rsp) diff --git a/test/expect/cmd.gccxml-and-E.result.txt b/test/expect/cmd.gccxml-and-E.result.txt deleted file mode 100644 index d00491f..0000000 --- a/test/expect/cmd.gccxml-and-E.result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/test/expect/cmd.gccxml-and-E.stderr.txt b/test/expect/cmd.gccxml-and-E.stderr.txt index f1248e4..10f3293 100644 --- a/test/expect/cmd.gccxml-and-E.stderr.txt +++ b/test/expect/cmd.gccxml-and-E.stderr.txt @@ -1,3 +1 @@ -^error: '--castxml-gccxml' and '-E' may not both be given - -Usage: castxml .*$ +^$ diff --git a/test/expect/cmd.gccxml-and-E.stdout.txt b/test/expect/cmd.gccxml-and-E.stdout.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/test/expect/cmd.gccxml-and-E.stdout.txt @@ -0,0 +1 @@ +^$ diff --git a/test/expect/cmd.gccxml-empty-c++98-E.stderr.txt b/test/expect/cmd.gccxml-empty-c++98-E.stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/test/expect/cmd.gccxml-empty-c++98-E.stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/test/expect/cmd.gccxml-empty-c++98-E.stdout.txt b/test/expect/cmd.gccxml-empty-c++98-E.stdout.txt new file mode 100644 index 0000000..931220e --- /dev/null +++ b/test/expect/cmd.gccxml-empty-c++98-E.stdout.txt @@ -0,0 +1,2 @@ +^#[^ +]*/test/input/empty.cxx" |