Skip to content

Commit 7b2ca27

Browse files
committed
fix: possible help in #2355
1 parent 56a90d6 commit 7b2ca27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/pybind11Tools.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ function(pybind11_add_module target_name)
184184
if(CMAKE_VERSION VERSION_LESS 3.9 OR PYBIND11_CLASSIC_LTO)
185185
_pybind11_add_lto_flags(${target_name} ${ARG_THIN_LTO})
186186
elseif(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
187+
cmake_policy(GET CMP0069 IPO_POL)
188+
if(CMP0069 STREQUAL "NEW")
189+
cmake_policy(SET CMP0069 NEW)
190+
endif()
191+
187192
include(CheckIPOSupported)
188193
check_ipo_supported(RESULT supported OUTPUT error)
189194
if(supported)

0 commit comments

Comments
 (0)