summaryrefslogtreecommitdiff
path: root/idlc/source/idlccompile.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-11 20:55:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-08-12 20:21:33 +0200
commitb0c4ca9e088cbff5a5dbc5e95486397041a51d4a (patch)
treee43eb1b6b1070150c3a43f05fdd39120e301e885 /idlc/source/idlccompile.cxx
parentdd76c656017b11d30b48a2df6c20e4b42f35a23c (diff)
make --with-idlc-cpp=cpp work for gcc cpp as a ucpp replacement
e.g. the example of https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1524638 has the same output .urd using cpp with these flags as ucpp created Change-Id: Iadfd2deba7d365c66c3260fd6736c031987e107c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120347 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'idlc/source/idlccompile.cxx')
-rw-r--r--idlc/source/idlccompile.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/idlc/source/idlccompile.cxx b/idlc/source/idlccompile.cxx
index bf3325d6821a..1902d63e0cad 100644
--- a/idlc/source/idlccompile.cxx
+++ b/idlc/source/idlccompile.cxx
@@ -237,7 +237,15 @@ sal_Int32 compileFile(const OString * pathname)
::std::vector< OUString> lCppArgs;
lCppArgs.emplace_back("-DIDL");
lCppArgs.emplace_back("-C");
+#ifdef SYSTEM_UCPP_IS_GCC
+ // -nostdinc Do not search the standard system directories for header files
+ lCppArgs.emplace_back("-nostdinc");
+ // with gcc cpp, even when not explicitly including anything, /usr/include/stdc-predef.h
+ // gets inserted without -nostdinc
+#else
+ // -zI Do not use the standard (compile-time) include path.
lCppArgs.emplace_back("-zI");
+#endif
Options* pOptions = idlc()->getOptions();