Vasily
f138e46ceb
Add O3 flag to linker call for GCC
2020-04-12 00:52:31 +02:00
Vasily
799bc7d429
Add O3 to gcc linker
...
It is unknown if gcc uses the O3 optimization levels passed to the
compilation of individual cpp files, or if it needs O3 passed to the
linker as well.
The hash of the final binaries are different, thus O3 is passed to the
linker.
2020-04-12 00:52:31 +02:00
Vasily
8a315abb55
Disable LTO on Travis CI and change clang binary to clang++
...
Travis clang does not have the LLVMgold plugin installed.
Disabling LTO is easier than installing the plugin since the CI doesn't
create any artifacts anyway.
2020-04-12 00:52:31 +02:00
Vasily
fa166b20d4
Add logging of Linux compiler version
...
Mainly for CI and third party logs.
2020-04-12 00:52:31 +02:00
Vasily
28b09e78f5
Update Linux compiler selection with linker
...
Qmake attempts to invoke the linker with the default `g++` binary even
when we changed the binary. This will compile error when using LTO.
For clang:
```
/usr/bin/ld.gold: error: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so: could
not load plugin library: /usr/lib/llvm-3.8/bin/../lib/LLVMgold.so:
cannot open shared object file: No such file or directory
```
For GCC:
```
lto1: fatal error: bytecode stream generated with LTO version 6.0
instead of the expected 4.1
```
2020-04-12 00:52:31 +02:00
Vasily
f0e05bde25
Add link time optimization to clang/gcc builds
...
Using `-flto` on clang without using the gold linker produces the error:
```main.o: file not recognized: File format not recognized```
https://github.com/android/ndk/issues/242
`gold` seems to be faster than `ld`, and decently tested even in 2010:
https://stackoverflow.com/questions/3476093/replacing-ld-with-gold-any-experience
Qmake will still append `-Wl,-O1` even though higher optimization levels
are used. Removing this in order to keep the compile command as short as
possible, and to reduce weird issues down the line. Ref topic:
https://stackoverflow.com/questions/53384988/why-qmake-passes-wl-o1-to-gcc-when-linking-and-will-it-harm-lto
2020-04-12 00:52:31 +02:00
Vasily
491671937a
Remove warning C4242 from MSVC
...
Qt 5.14.0 introduces a new `qfloat16.h` file that spams this error, with
no way of ignoring it on MSVC.
2020-01-15 14:01:47 +01:00
Vasily
614278d7ec
Add compiler check for g++-9 to qmake
2019-07-04 16:44:31 +02:00
Vasily
ec5a575d93
Add g++-8 specific version support.
2019-06-24 19:21:14 +02:00
Vasily
e8af73db28
Make CircleCI have feature parity with TravisCI and update docs
...
Unnecessary line from Bionic 18.04 was removed.
A proper version guard was included for clang. Xenial currently ships
3.8.
2019-06-24 19:21:14 +02:00
Vasily
b65657b371
Add clang passing build
...
CircleCI Xenial does not come with an up to date version of Clang. It is
therefore required to get the newest version (8). The .pri file has
quickly been edited to be similar to the g++ version check.
2019-06-24 19:21:14 +02:00
Vasily
b60113fb8e
Replace GCC version regex with simpler solution
2019-04-22 09:56:50 +02:00
Vasily
9cfaf68a92
Update GCC compiler to not use hardcoded g++-7
...
Newer versions of Ubuntu ship with >g++-7, so there will be less of a
need as time goes on to perform this hack.
2019-04-22 09:56:50 +02:00
Vasily
bd5b913f20
Add qt to clang system header prefixes
...
Clang-tidy will error on them otherwise.
2019-04-17 20:51:34 +02:00
Vasily
2da88237f2
Remove -Wmissing-variable-declaration from GCC
...
GCC does not support it.
2019-02-21 18:48:53 +01:00
Vasily
81ae0efd1c
Add -Wmissing-variable-declarations to all clang/gcc compilers
2019-02-21 18:48:53 +01:00
Vasily
9ab0b1d62d
Remove -Wextra-semi for GCC
...
It is not currently supported yet by GCC.
2019-02-21 18:48:53 +01:00
Vasily
9d46358309
Add -Wzero-as-null-pointer-constant and fix occurences
2019-02-21 18:48:53 +01:00
Vasily
896559cc20
Add -Wextra-semi and fix occurences
2019-02-21 18:48:53 +01:00
Vasily
c8709888d0
Add -Wno-sign-conversion to GCC and clang
...
The auto generated Qt MOC .cpp files contain warnings that can't be
fixed.
2019-02-21 18:48:53 +01:00
Vasily
29d41b4ed0
Add -Wconversion to GCC and Clang
...
clang-msvc spams warnings from the moc .cpp files that include Qt
headers.
2019-02-21 18:48:53 +01:00
Vasily
cfefec59e3
Fix -Wsign-conversion warnings
2019-02-21 18:48:53 +01:00
Vasily
ec014a1e74
Add -Wdouble-promotion switch to clang/gcc compilers
...
It introduces a lot of ugly casts. Long term the floats should probably
be changed to doubles everywhere since we're only compiling for 64 bit
x86.
2019-02-21 18:48:53 +01:00
Vasily
fe3bbc2959
Remove -Weffc++ from GCC
...
The "should be initialized in the member initialization list" is
incorrectly implemented on GCC.
https://stackoverflow.com/questions/14002454/can-i-ignore-the-gcc-warning-foom-bar-should-be-initialized-in-the-member-i
2019-02-21 18:48:53 +01:00
Vasily
0caff37251
Add -Weffc++ switch to clang/gcc
2019-02-21 18:48:53 +01:00
Vasily
473e928106
Refactor common switches into file
2019-02-21 18:48:53 +01:00
Vasily
106727a5b9
Remove -Wmost from GCC
...
-Wmost is a clang only switch.
2019-02-21 18:48:53 +01:00
Vasily
fddae4278b
Add more recommended switches
...
Commented out switches still give errors.
2019-02-21 18:48:53 +01:00
Vasily
ac614c36e6
Replace -pedantic with -Wpedantic
2019-02-21 18:48:53 +01:00
Vasily
d87338d195
Add -pedantic to Linux compilers
...
clang-msvc does not support -pedantic.
2019-02-21 18:48:53 +01:00
Vasily
82ac83d649
Add -Wextra to supported compilers
2019-02-21 18:48:53 +01:00
Vasily
cc4f0d4bc8
Remove unneeded -Xclang
2019-02-21 18:48:53 +01:00
Vasily
34204d2441
Add -Wnon-virtual-dtor and resolve issues
...
The IPolicyConfig file is a third party file and since it describes a
third party API we can't make changes to it. Adding it via the system
includes disables warnings on most compilers.
2019-02-21 18:48:53 +01:00
Vitaly
acb666a142
Remove old style casts and enable warnings for them
2019-02-21 18:48:53 +01:00
Vasily
81af2b9c72
Add -Wshadow and solve warnings
2019-02-21 18:48:53 +01:00
Vasily
fdc096bb61
Add recommended compiler switches
...
From
https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md#MSVC
The '/w14619' switch creates errors in qglobal.h and qvector.h.
2019-02-21 18:48:53 +01:00
Vasily
68a72ded1f
Add whole program optimization to MSVC
2019-02-21 18:48:53 +01:00
Vitaly
4b48d051c8
Refactor Qt project file into compiler specific subfiles
...
Encapsulating compiler specific options in a separate file
makes it easier to reason about what is going to happen on
a specific qmake call.
clang-msvc and msvc are separate because they don't support
exactly the same compiler switches.
2019-02-21 18:48:53 +01:00