diff options
author | Brad King <brad.king@kitware.com> | 2023-03-20 12:11:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-20 12:11:56 (GMT) |
commit | 8a71c88d4d4aa4805713a0266f83f3fcd48f91de (patch) | |
tree | 9cee050cad8c34dba9d59d5fbf866888f70d49b9 /Tests/FindPython | |
parent | c3110a500e6ff66775976680d36500b4919ec37e (diff) | |
parent | 4c902d675b764ad3d8f54a6e235547d289752c45 (diff) | |
download | CMake-8a71c88d4d4aa4805713a0266f83f3fcd48f91de.zip CMake-8a71c88d4d4aa4805713a0266f83f3fcd48f91de.tar.gz CMake-8a71c88d4d4aa4805713a0266f83f3fcd48f91de.tar.bz2 |
Merge branch 'backport-3.26-FindPython-SOSABI-handling'
Diffstat (limited to 'Tests/FindPython')
-rw-r--r-- | Tests/FindPython/Python3SABIModule/CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/FindPython/Python3SABIModule/CMakeLists.txt b/Tests/FindPython/Python3SABIModule/CMakeLists.txt index 1a909ec..e045b69 100644 --- a/Tests/FindPython/Python3SABIModule/CMakeLists.txt +++ b/Tests/FindPython/Python3SABIModule/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +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() |