mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
IPO/LTO support for ICX (IntelLLVM) compiler (#4402)
* IPO/LTO support for ICX (IntelLLVM) compiler https://github.com/pybind/pybind11/issues/4080 * style: pre-commit fixes * Add WARNING/HELP WANTED comment. Co-authored-by: Martin Blanchard <martin.blanchard@siemens.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
This commit is contained in:
parent
ece1206b8a
commit
09db6445d8
@ -311,6 +311,16 @@ function(_pybind11_generate_lto target prefer_thin_lto)
|
||||
HAS_FLTO "-flto${cxx_append}" "-flto${linker_append}" PYBIND11_LTO_CXX_FLAGS
|
||||
PYBIND11_LTO_LINKER_FLAGS)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
|
||||
# IntelLLVM equivalent to LTO is called IPO; also IntelLLVM is WIN32/UNIX
|
||||
# WARNING/HELP WANTED: This block of code is currently not covered by pybind11 GitHub Actions!
|
||||
if(WIN32)
|
||||
_pybind11_return_if_cxx_and_linker_flags_work(
|
||||
HAS_INTEL_IPO "-Qipo" "-Qipo" PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
|
||||
else()
|
||||
_pybind11_return_if_cxx_and_linker_flags_work(
|
||||
HAS_INTEL_IPO "-ipo" "-ipo" PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
# Intel equivalent to LTO is called IPO
|
||||
_pybind11_return_if_cxx_and_linker_flags_work(HAS_INTEL_IPO "-ipo" "-ipo"
|
||||
|
Loading…
Reference in New Issue
Block a user