aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDECompilerSettings.cmake
AgeCommit message (Collapse)Author
2017-07-18KDECompilerSettings.cmake - handle Cywgin when setting LINK_FLAGSAllen Winter
Differential Revision: https://phabricator.kde.org/D6762
2017-06-15(always include CheckCXXCompilerFlag before calling it)R.J.V. Bertin
Mea culpa, the project I tested this with apparently used the macro too.
2017-06-15guess less, test moreR.J.V. Bertin
Don't attempt to guess whether (Apple) Clang 3.5 supports -Wdate-time, use CheckCXXCompilerFlag and be certain.
2017-06-14detect Xcode <= 6.2 from Clang version onlyR.J.V. Bertin
This modifies 340b969f54d2f271e925ed7f84c831e1e4b2ccd0 by testing for Xcode <= 6.2 using the AppleClang version scheme only, to account for rare conditions where the compiler ID is not AppleClang.
2017-05-30restore hidden-visibility testing with Xcode 6.2v5.35.0-rc1v5.35.0R.J.V. Bertin
Xcode 6.2 (OS X 10.9.5) has a Clang version that is based on Clang 3.5 but does not yet support -Wdate-time . Commit 7af9f8e2b6eb235923a329e8ff24012883fb6b86 introduced a regression where this compiler failed to pass the visibility tests because it prints a warning about -Wdate-time. This in turn leads to linker errors.
2017-04-18KDECompilerSettings: Pass -Wvla & -Wdate-timeKevin Funk
Summary: -Wvla: Warn because it's non-standard feature, not supported by MSVC to date -Wdate-time: Warn because using __TIME__ or __DATE__ prevents reproducible builds These warnings are being used for *building* Qt itself as well (cf. qt_common.prf in qtbase) Test Plan: No new warnings from rebuilding KDE Frameworks Reviewers: mpyne Reviewed By: mpyne Subscribers: mpyne, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5430
2017-04-10Fix compilation under AppleClangKevin Funk
Summary: Broken since we started to treat Clang and AppleClang differently (with the switch to CMake 3.0) FIXED-IN: v5.34.0 BUG: 377933 Reviewers: apol, rjvbb Reviewed By: apol, rjvbb Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5379
2017-04-05Use -Wno-gnu-zero-variadic-macro-arguments moreKevin Funk
Summary: Add it to KDECompilerSettings.cmake instead of KDEFrameworkCompilerSettings.cmake. Users can then just enable -pedantic without worrying about the gnu-zero-variadic-macro-arguments warning. This fixes some warnings in e.g. kdenlive Reviewers: kossebau, apol, dfaure Reviewed By: apol Subscribers: apol, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5302
2017-03-19KDE compiler settings: treat Clang and AppleClang equallyv5.33.0-rc1v5.33.0René J.V. Bertin
https://phabricator.kde.org/D5089
2017-01-16Pass -fno-operator-names when supportedKevin Funk
Summary: Disables alternative tokens for &&, ||, etc.. They're are not supported by MSVC out of the box, thus using them will limit the portability of the code. There *are* options to make alternative tokens available under MSVC [1], but I think we shouldn't promote the usage of them. From the GCC documentation: -fno-operator-names: Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor as synonyms as keywords. [1] http://stackoverflow.com/questions/555505/when-were-the-and-and-or-alternative-tokens-introduced-in-c Reviewers: #frameworks, #buildsystem, ivan Reviewed By: ivan Subscribers: rakuco, elvisangelaccio Differential Revision: https://phabricator.kde.org/D3850
2016-12-29Enable colored warnings in ninja's outputElvis Angelaccio
Summary: Colored compiler warnings in ninja output only work with the `-fdiagnostics-color=always` flag. See https://github.com/ninja-build/ninja/issues/814 for a rationale. This commit adds such flag in ecm for gcc >= 4.9 and clang >= 3.5, and only if the CMAKE_GENERATOR is Ninja. Test Plan: ninja+gcc and ninja+clang now show nice colored compiler warnings. Reviewers: #frameworks Differential Revision: https://phabricator.kde.org/D3733
2016-12-11Never use -Wl,--no-undefined on Mac (APPLE).R.J.V. Bertin
While unusual it is not impossible to use GCC on Macs, esp. not when using older OS X versions. Intel also makes compilers for Mac, so it may in fact be better to rewrite the check ((GNU or Clang or Intel) IF NOT (APPLE or WIN32)).
2016-12-10Accept AppleClang as an alternative to ClangR.J.V. Bertin
Apple's clang v3.1 corresponds to clang 3.1 and started following the Xcode versioning scheme from 4.4 onwards (though loosely). An overview of the version correspondance can be found here: https://gist.github.com/yamaya/2924292
2016-10-08Revert "Teach KDECompilerSettings about clang-cl, a mode of Clang compiler ↵Ben Cooksley
that simulates MSVC." This reverts commit 4b8e8dcc8856d8f438860783e7641d02d1c05630.
2016-09-30Teach KDECompilerSettings about clang-cl, a mode of Clang compiler that ↵Gleb Popov
simulates MSVC. REVIEW: 128779
2016-08-31add full license textAllen Winter
REVIEW: 128780
2015-12-28Silence CMP0063 warnings with KDECompilerSettings.Alex Merry
We recommend including KDE "settings" modules with NO_POLICY_SCOPE, both so we can resolve this issue and to allow us to deal with similar things in the future. REVIEW: 126535
2015-12-18Fix CMP0054 warningsKevin Funk
Example: CMake Warning (dev) at Z:/kderoot/share/ECM/kde-modules/KDEFrameworkCompilerSettings.cmake:50(elseif): Policy CMP0054 is not set: Only interpret if() arguments as variables or keywords when unquoted. Run "cmake --help-policy CMP0054" for policy details. Use the cmake_policy command to set the policy and suppress this warning. REVIEW: 126405
2015-08-16Also set the default visibility for C code to hidden.Volker Krause
This prevents accidental "leaking" of symbols from internal code, such as flex/bison generated parsers. REVIEW: 124740
2015-02-06Document when modules were added to ECM.Alex Merry
2014-11-14Update the comments about the default lib MSVC hacksv1.5.0-rc1v1.5.0Alex Merry
Having done a lot of (unrelated) Windows development recently, I've come to understand the situation much better, so I'm recording that information here for the benefit of others.
2014-11-03enable -D_USE_MATH_DEFINES on WindowsPatrick von Reth
2014-09-11Fix fallout from recent ECM patchesAlex Merry
KDE modules cannot assume the normal ECM modules are in the CMake module path, and CMAKE_INSTALL_IMPORTS_INSTALL_DIR / QTQUICKIMPORTSDIR was not set correctly. Also, ECMQueryQmake.cmake used a deprecated CMake command (exec_program).
2014-09-11Make code coverage possible in any KDE projectAleix Pol
Introduces a BUILD_COVERAGE option from a ECMCoverageOption file so that projects can easily enable code coverage in their applications. Furthermore, KDECompilerSettings does include that by default, so all proper KDE projects have the option by default. REVIEW: 120118
2014-09-11Add compiler sanitizers supportMathieu Tarral
REVIEW: 119968
2014-08-13KDECompilerSettings: Be more portable across libc's.Raphael Kubo da Costa
Defining _XOPEN_SOURCE to 500 is too restrictive: it corresponds to _POSIX_C_SOURCE 199506L, and hides several symbols that standard libraries like libc++ expect to find, leading to errors like this on FreeBSD: In file included from /tmp/attica/src/accountbalance.cpp:21: In file included from /tmp/attica/src/accountbalance.h:25: In file included from /usr/local/include/qt5/QtCore/QString:1: In file included from /usr/local/include/qt5/QtCore/qstring.h:50: In file included from /usr/include/c++/v1/string:437: In file included from /usr/include/c++/v1/string:437: /usr/include/c++/v1/cstdio:143:9: error: no member named 'snprintf' in the global namespace using ::snprintf; ~~^ This isn't a problem on Linux (actually, on systems using glibc) because defining _GNU_SOURCE enables a lot more features that are not made available on other libc implementations where it does not have any effect. Instead, stop defining _XOPEN_SOURCE at all and leave it up to the platform to show or hide as many symbols as necessary if no standards-related defines are set, and only set _GNU_SOURCE on systems where it is actually meaningful (ie. systems using glibc). REVIEW: 119696
2014-08-11also define _UNICODE on windowsPatrick von Reth
2014-05-08bump Windows requirements to Windows Vista, as desided in ↵Patrick von Reth
http://techbase.kde.org/Projects/KDE_on_Windows/kf5/meetingnotes-2014-05-06
2014-05-04On Mac, define _DARWIN_C_SOURCE and QT_MAC_USE_COCOA unconditionallyAllen Winter
REVIEW: 117682
2014-05-02Set _FILE_OFFSET_BITS=64 again when necessaryAlex Merry
This essentially reverts db553c810cbc3a446f90d4c962110d6262853cde. It turns out that (for better or worse) quite a few places access files without going through KFile, so it is worth making sure they can deal with files larger than 2Gb on 32-bit systems. Reviewed by: Harald Sitter <sitter@kde.org> CCBUG: 165449
2014-04-11Add documentation generation using SphinxAlex Merry
This is deliberately modelled very closely on CMake's documentation system. It's a hefty patch, because it involved changing all the documentation to be in reStructuredText format. I also cleaned up the copyright/license statements at the same time. Note that the find modules contain the full license, due to the fact that ecm_use_find_module() copies them out of the ECM distribution.
2014-03-17Add historical info to comments in the compiler settings hacksAlex Merry
Hopefully these might be of some use in determining whether they are still needed.
2014-03-04Also pass -fno-exceptions when building with clangAlex Richardson
All of KF5 + kate + kde-workspace compile with clang and -fno-exceptions The only problem related to clang and -fno-exceptions I could find was http://llvm.org/bugs/show_bug.cgi?id=10910 and that is fixed since clang version 3.0 which was released in December 2011 REVIEW: 115395
2014-02-14build on Mac OS XHarald Fernengel
2014-02-14Improve docs for kde modulesAlex Merry
REVIEW: 115488
2014-02-04Use the MSVC variable directly, instead of the compiler IDAlex Merry
This is cleaner and easier to read. REVIEW: 115378
2014-02-04Resolve some FIXMEs related to MSVC and IntelAlex Merry
In particular, MSVC (and Intel on Windows) have no equivalent of the -std flag to set the language standard, and Intel does not appear to produce the warnings that were disabled for MSVC. REVIEW: 115378
2014-02-04Fix MSVC libc linkage for debug buildsAlex Richardson
Previously we would end up with both /DEFAULTLIB:msvcrt and /DEFAULTLIB:msvcrtd on the command line. As a result of the the programs would link to both the debug and the release C library and always crash soon after startup. REVIEW: 115456
2014-01-29Improve the compiler version checksAlex Merry
- Only warn if the compiler is not recent enough (it may still work...) - Bump up the GCC version to 4.5 (on Linux, at least) to match Qt - Add checks for Windows (both MSVC and MinGW) - Add check for Clang REVIEW: 115372
2014-01-29Check the C_COMPILER_ID when settings C_FLAGS, not CXX_COMPILER_IDAlex Merry
Not that anyone is likely to use different compilers for C and C++... REVIEW: 115379
2014-01-29KDE_SOURCE_FILES_ENABLE_EXCEPTIONS: Handle case where COMPILE_FLAGS is not setAurélien Gâteau
When COMPILE_FLAGS is not set, get_source_file_property(flags ${source_file} COMPILEFLAGS) set flags to "NOTFOUND". Leading to interesting build failures in kde-runtime when we then set flags to "NOTFOUND -fexceptions", see http://build.kde.org/job/kde-runtime_frameworks_qt5/58/ REVIEW: 115376
2014-01-29Move and comment -fno-common settingAlex Merry
REVIEW: 115363
2014-01-29Remove the allocator and visibility checkAlex Merry
I am reasonably sure the allocator check is out of date, given our minimum GCC version, and it was not used for anything interesting anyway. The visibility check will not be performed in practice, as this file will almost always be included before any check for Qt. REVIEW: 115360
2014-01-28Add a note about why we use C89 instead of C99Alex Merry
2014-01-28Do not explicitly link against libcAlex Merry
This is entirely unnecessary with any sane toolchain, and should be in the linker flags (rather than the compiler flags) for any system where it is required. REVIEW: 115362
2014-01-28Better documentation for system API definesAlex Merry
2014-01-27Organise KDECompilerSettings.cmake more logicallyAlex Merry
Very little should have changed in practice (apart from the Intel compiler stuff being properly separated between things for WIN32 and things for other platforms, and not defining _BSD_SOURCE).
2014-01-27Replace the KDE_ENABLE_EXCEPTIONS variable with a pair of functionsAlex Merry
kde_enable_exceptions() essentially does what set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS}") used to do. kde_target_enable_exceptions does it on a per-target basis.
2014-01-27Add system API feature macros to CMAKE_REQUIRED_DEFINESAlex Merry
Various defines we set affect the API offered by the system; subsequent CMake configure checks should happen in a matching environment. REVIEW: 115294
2014-01-20Use add_definitions directly, instead of via _KDE4_PLATFORM_DEFINITIONSAlex Merry
Setting the variable just leads to set() calls overwriting each other accidentally (as appeared to have happened in the WIN32 block). REVIEW: 114908