mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and Fortran languages. Do not try to enable support for other languages. Furthermore, each language builds with a different compiler, so check for support by CMake and the compiler for each language independently. Fixes: #16944
8 lines
228 B
CMake
8 lines
228 B
CMake
cmake_policy(SET CMP0069 NEW)
|
|
|
|
set(_CMAKE_CXX_IPO_SUPPORTED_BY_CMAKE YES)
|
|
set(_CMAKE_CXX_IPO_MAY_BE_SUPPORTED_BY_COMPILER NO)
|
|
|
|
add_executable(foo main.cpp)
|
|
set_target_properties(foo PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
|