File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -311,10 +311,22 @@ function(_pybind11_generate_lto target prefer_thin_lto)
311
311
HAS_FLTO "-flto${cxx_append} " "-flto${linker_append} " PYBIND11_LTO_CXX_FLAGS
312
312
PYBIND11_LTO_LINKER_FLAGS)
313
313
endif ()
314
+ elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM" )
315
+ # IntelLLVM equivalent to LTO is called IPO; also IntelLLVM is WIN32/UNIX
316
+ if (WIN32 )
317
+ _pybind11_return_if_cxx_and_linker_flags_work(
318
+ HAS_INTEL_IPO "-Qipo" "-Qipo"
319
+ PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
320
+ else ()
321
+ _pybind11_return_if_cxx_and_linker_flags_work(
322
+ HAS_INTEL_IPO "-ipo" "-ipo"
323
+ PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
324
+ endif ()
314
325
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel" )
315
326
# Intel equivalent to LTO is called IPO
316
- _pybind11_return_if_cxx_and_linker_flags_work(HAS_INTEL_IPO "-ipo" "-ipo"
317
- PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
327
+ _pybind11_return_if_cxx_and_linker_flags_work(
328
+ HAS_INTEL_IPO "-ipo" "-ipo"
329
+ PYBIND11_LTO_CXX_FLAGS PYBIND11_LTO_LINKER_FLAGS)
318
330
elseif (MSVC )
319
331
# cmake only interprets libraries as linker flags when they start with a - (otherwise it
320
332
# converts /LTCG to \LTCG as if it was a Windows path). Luckily MSVC supports passing flags
You can’t perform that action at this time.
0 commit comments