summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-03-18 15:36:06 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-20 12:10:53 (GMT)
commit4c902d675b764ad3d8f54a6e235547d289752c45 (patch)
tree6ac7f0926bcaa38e6d31690df6442f14bad03344 /Tests
parent5e5a21aadd1468e81ff7795c352898f2e115ae0e (diff)
downloadCMake-4c902d675b764ad3d8f54a6e235547d289752c45.zip
CMake-4c902d675b764ad3d8f54a6e235547d289752c45.tar.gz
CMake-4c902d675b764ad3d8f54a6e235547d289752c45.tar.bz2
FindPython: ensure Stable ABI is correctly handled
Fixes: #24610
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindPython/Python3SABIModule/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/FindPython/Python3SABIModule/CMakeLists.txt b/Tests/FindPython/Python3SABIModule/CMakeLists.txt
index 2a067d0..e045b69 100644
--- a/Tests/FindPython/Python3SABIModule/CMakeLists.txt
+++ b/Tests/FindPython/Python3SABIModule/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 3.7)
project(TestPython3SABIModule LANGUAGES C)
@@ -35,12 +35,16 @@ if(NOT TARGET Python3::SABIModule)
message(SEND_ERROR "Python3::SABIModule not found")
endif()
+if (Python3_VERSION VERSION_GREATER_EQUAL "3.2" AND NOT Python3_SOSABI)
+ message(FATAL_ERROR "Python3_SOSABI unexpectedly not defined")
+endif()
+
Python3_add_library (spam3 MODULE USE_SABI 3 WITH_SOABI ../spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
if (Python3_SOSABI)
get_property (suffix TARGET spam3 PROPERTY SUFFIX)
- if (NOT suffix MATCHES "^.${Python3_SOSABI}")
+ if (NOT suffix MATCHES "^\\.${Python3_SOSABI}")
message(FATAL_ERROR "Module suffix do not include Python3_SOSABI")
endif()
endif()