summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-04 13:19:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-04 13:20:18 (GMT)
commit95b151af9039940daa3e6767da2ec1db8bb07ee5 (patch)
tree44a11b7205bd0095d2485e179c720f4dcd19fbdf /Tests
parent288a3204ed78399e0d88af6b28e169cc2a3f6af4 (diff)
parent0c97b73bc09ee34aa40667a044f05e7049d16a60 (diff)
downloadCMake-95b151af9039940daa3e6767da2ec1db8bb07ee5.zip
CMake-95b151af9039940daa3e6767da2ec1db8bb07ee5.tar.gz
CMake-95b151af9039940daa3e6767da2ec1db8bb07ee5.tar.bz2
Merge topic 'FindPython-manage-SOABI-suffix'
0c97b73bc0 FindPython: python_add_library can now manage SOABI suffix. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4420
Diffstat (limited to 'Tests')
-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()