diff options
Diffstat (limited to 'Tests/FindPython/Python3SABIModule/CMakeLists.txt')
-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 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() |