summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-03-21 12:55:51 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-03-21 12:56:06 (GMT)
commitbf6131fc9a164ddf7d2ed02b6870cdbce4efd4e8 (patch)
tree6ac7f0926bcaa38e6d31690df6442f14bad03344 /Tests/FindPython
parent5e5a21aadd1468e81ff7795c352898f2e115ae0e (diff)
parent4c902d675b764ad3d8f54a6e235547d289752c45 (diff)
downloadCMake-bf6131fc9a164ddf7d2ed02b6870cdbce4efd4e8.zip
CMake-bf6131fc9a164ddf7d2ed02b6870cdbce4efd4e8.tar.gz
CMake-bf6131fc9a164ddf7d2ed02b6870cdbce4efd4e8.tar.bz2
Merge topic 'FindPython-SOSABI-handling' into release-3.26
4c902d675b FindPython: ensure Stable ABI is correctly handled Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8345
Diffstat (limited to 'Tests/FindPython')
-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()