From ce0348518d8048350287cc91c6b2c8f1f3264703 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 31 Oct 2025 12:31:22 +0500 Subject: [PATCH] cmake - note future cmake bug fixes --- src/ifcwrap/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index 0d031f9091..149810216e 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -88,7 +88,8 @@ SET_PROPERTY( ) # On Windows there is '_d' prefix for debug builds - e.g. `_d.cp311-win_amd64.pyd`. -if(WIN32) +# In 4.2+ it's done automatically when discovering `Development.Module`. +if(WIN32 AND CMAKE_VERSION VERSION_LESS "4.2") set(Python_DEBUG_POSTFIX "_d") endif() if (CMAKE_VERSION VERSION_GREATER_EQUAL "4.2") @@ -113,8 +114,8 @@ if (WASM_BUILD) # Possibly in the future we can clean up linked libs and try `=1`. # SIDE_MODULE=2 - add to .so only explicitly exported functions (`-s EXPORTED_FUNCTIONS). # Have to provide it here to override possible `=1` coming from pyodide. - if(CMAKE_GENERATOR MATCHES "Makefile") - # Accomodate bug in cmake makefile generator: + if(CMAKE_GENERATOR MATCHES "Makefile" AND CMAKE_VERSION VERSION_LESS "4.2") + # Accomodate bug in cmake makefile generator (fixed in 4.2+). # https://gitlab.kitware.com/cmake/cmake/-/issues/27326 string( REPLACE "SIDE_MODULE=1" "SIDE_MODULE=2"