Commit Graph

20 Commits

Author SHA1 Message Date
Orgad Shaneh
61601899db UnitTest: Fix escaping of LLVM output on Windows
Complements 1929c38a9f.

Change-Id: I95e32baf477e42003f1e97c73fd557b480de33a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-08-07 05:01:04 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +00:00
Ivan Donchevskii
9eb66a806f Clang: Properly set up warnings for clang-based libraries
Add warning flags to QMAKE_CXXFLAGS_WARN_ON to have them
after default warnings.

Change-Id: Ic94fe36175d3198191251d5b475f8f8ed000bef7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-11-29 09:27:33 +00:00
Orgad Shaneh
0ed6409618 Clang: Remove duplicate CXX flags
Most of the flags appear twice on llvm-config-7 --cxxflags (at least on
Debian).

Change-Id: I9c5630d61472fa37bce998ec541a0ab561b83722
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-11-15 08:57:34 +00:00
Ivan Donchevskii
f6e5202b80 CompilerOptionsBuilder unit-tests
Bonus: minor compiler options builder issues fixed.

Change-Id: Ie25f8fad6729339de05f2bf9b614ceac873e2634
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-10-04 10:24:13 +00:00
Oswald Buddenhagen
bb027e10a8 fix llvm libdir handling wrt RPATH, more or less properly
we must not add the llvm libdir if it's a system path. this was already
done in some places, but not in others.

while we're at it, re-shuffle some pre-existing conditionals to make
things consistent.

Task-number: QTCREATORBUG-20178
Change-Id: Ib7e5a81705494e4cf2f83a4782ecd0832b91e511
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-09 12:54:53 +00:00
Ulf Hermann
5e0639542f Add some sanity to the clang detection code for qmake build
llvm-config can usually be found in PATH on systems which have standard
paths at all. There is no need to specify LLVM_INSTALL_DIR then.
Furthermore, llvm-config has an option --bindir which will tell us the
directory where clang can be found (if installed). No need to apply
strange heuristics based on LLVM_INSTALL_DIR. Finally, we can check
within each .pro file for the conditions to be met using qmake's
require() function. This way we don't need to fiddle with
LLVM_INSTALL_DIR in unrelated places.

Change-Id: I1a6ab092b06de40dfbfa4a9e7053451360fd24c8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 08:47:05 +00:00
Orgad Shaneh
3924d3deac UnitTest: Fix build with clang 3.9.1
llvm-config-3.9 --cxxflags has -g1 which is substituted by 1.

Change-Id: I626f3f15c659f7de030c08883b5b739b1d636ada
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-25 11:32:41 +00:00
Tim Jenssen
63e7e83e22 Clang: Filter exception flags and move some more
Change-Id: I3ef6a6bb2297d6965c5c1d457cfe2b354ee3dcdb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-02-01 14:02:06 +00:00
Marco Bubke
f97911d0fe UnitTests: Use clang flags to build unit tests
We want to avoid build error so we use their flags and remove flags we
don't want.

Change-Id: I471e5195f98658d73d2b04b6e4bf597573ca87ae
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-31 15:25:14 +00:00
Marco Bubke
c072cdfb88 Clang: Add ClangPchManager
Compiling every header file again and again is quite time comsuming. There
are technics to improve this like preambles(a kind of automated
precompiled header) but they don't share their data between translation
units. This approach provides an automatically generated precompiled
header for every project and subproject to improve the loading time.

Change-Id: I34f5bd4db21951175920e2a9bbf6b97b1d705969
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-30 13:55:58 +00:00
Nikolai Kosjar
85d8fbfdac UnitTests: Add rpath to $$LLVM_LIBDIR
Change-Id: I9be996e0639bacc1d09527e3fb2621311bb067f9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-01-06 09:39:22 +00:00
Tim Jenssen
7dc64a1c1d Clang: fix dependency for "nmake check"
Change-Id: I82bca786a39a091804f9f39b1c037483dd595f5f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-04 07:55:52 +00:00
Tim Jenssen
9c7ff5199f Clang: Add clang query
Clang query is mechanism to use AST matcher to search for code. Think
about regular expression but in the context of AST. So you get a semantic
search tool for C++.

Change-Id: I72e882c5b53a0c52f352a3664847c4c3e4f6fc2e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-15 15:30:33 +00:00
Marco Bubke
381bee1434 Clang: fix llvm lib linking on windows
If we use paths with spaces we cannot split them anymore so we have to
handle unix and windows differently.

Change-Id: Ibfc8c51cfe2ecd68e913ad84e0e1269eb7eeda02
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:27:25 +00:00
Marco Bubke
2e062552eb Clang: Report an error if the unit test are linked with LLVM without RTTI
We don't want to disable RTTI in unittest so we require to compile them
with RTTI. You can disable yourself RTTI if you don't want them for some
reasons.

Change-Id: I76d05a36442305f379ce3d88b3f6ed4372127002
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-09-05 10:01:14 +00:00
Nikolai Kosjar
435d631266 Clang: Fixes for unittest.pro
Change-Id: I356ccdec0eaa403e5ec7364fb54de39f24695b4b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2016-08-31 13:43:05 +00:00
Marco Bubke
68aeff4b9f UnitTest: Break the dependency to LLVM
If you have no LLVM installed it was impossible to compile the unit test.
But some unit test don't depend on LLVM. With this change it is now
possible to compile them.

Change-Id: Iac0c1b3cdf6c317e6ba4755acd5f8458db5a7451
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-08-22 09:12:56 +00:00
Marco Bubke
4cdb5bab15 Clang: Add clang refactoring
Change-Id: I2e3f36f810276da3f8dc7dcc587b06f8edb586d3
GPush-Base: d02f51b48fc752fddcdef6dcb32b3f7f6c0195a3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-04 14:37:19 +00:00
Nikolai Kosjar
8a06df6235 Clang: Clean up unittest.pro
Change-Id: Icd3f1ab0b9b9557b0bd4cdfc60130e0c8bd15609
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-07-23 11:48:32 +00:00