summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindPython')
-rw-r--r--Tests/FindPython/SOABI/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt
index aea2baf..4a6aea3 100644
--- a/Tests/FindPython/SOABI/CMakeLists.txt
+++ b/Tests/FindPython/SOABI/CMakeLists.txt
@@ -10,3 +10,13 @@ endif()
if(NOT DEFINED Python3_SOABI)
message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found")
endif()
+
+if (Python3_Development_FOUND AND Python3_SOABI)
+ Python3_add_library (spam3 MODULE WITH_SOABI ../spam.c)
+ target_compile_definitions (spam3 PRIVATE PYTHON3)
+
+ get_property (suffix TARGET spam3 PROPERTY SUFFIX)
+ if (NOT suffix MATCHES "^.${Python3_SOABI}")
+ message(FATAL_ERROR "Module suffix do not include Python3_SOABI")
+ endif()
+endif()