summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-03-03 12:10:16 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-03-03 12:13:48 (GMT)
commit0c97b73bc09ee34aa40667a044f05e7049d16a60 (patch)
treed38f6a3858afc2a1004a9e99ccab4d568afe284c /Tests/FindPython
parentd1cb554c99c73e1486fbf4e09125337a7c0e9ea3 (diff)
downloadCMake-0c97b73bc09ee34aa40667a044f05e7049d16a60.zip
CMake-0c97b73bc09ee34aa40667a044f05e7049d16a60.tar.gz
CMake-0c97b73bc09ee34aa40667a044f05e7049d16a60.tar.bz2
FindPython: python_add_library can now manage SOABI suffix.
Fixes: #20408
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()