mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
1bee6e7df8
Clang on linux currently fails to run cmake: $ CC=clang CXX=clang++ cmake .. ... -- Configuring done CMake Error at tools/pybind11Tools.cmake:135 (target_compile_options): Error evaluating generator expression: $<:-flto> Expression did not evaluate to a known generator expression Call Stack (most recent call first): tests/CMakeLists.txt:68 (pybind11_add_module) But investigating this led to various other -flto detection problems; this commit thus overhauls LTO flag detection: - -flto needs to be passed to the linker as well - Also compile with -fno-fat-lto-objects under GCC - Pass the equivalent flags to MSVC - Enable LTO flags for via generator expressions (for non-debug builds only), so that multi-config builds (like on Windows) still work properly. This seems reasonable, however, even on single-config builds (and simplifies the cmake code a bit). - clang's lto linker plugins don't accept '-Os', so replace it with '-O3' when doing a MINSIZEREL build - Enable trying ThinLTO by default for test suite (only affects clang) - Match Clang$ rather than ^Clang$ because, for cmake with 3.0+ policies in effect, the compiler ID will be AppleClang on macOS. |
||
---|---|---|
.. | ||
clang@254c7a91e3 | ||
check-style.sh | ||
FindEigen3.cmake | ||
FindPythonLibsNew.cmake | ||
libsize.py | ||
mkdoc.py | ||
pybind11Config.cmake.in | ||
pybind11Tools.cmake |