diff options
author | Brad King <brad.king@kitware.com> | 2020-03-04 13:19:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-04 13:20:17 (GMT) |
commit | ab00435e79205d6a447988f41cd53ede9ee42273 (patch) | |
tree | 6e19e16d1dca80897897c8c6621f1ebf33524016 /Tests | |
parent | b0317d9b98f35402ad18fbdb47b1f6c0ed14cc97 (diff) | |
parent | 0c97b73bc09ee34aa40667a044f05e7049d16a60 (diff) | |
download | CMake-ab00435e79205d6a447988f41cd53ede9ee42273.zip CMake-ab00435e79205d6a447988f41cd53ede9ee42273.tar.gz CMake-ab00435e79205d6a447988f41cd53ede9ee42273.tar.bz2 |
Merge topic 'FindPython-manage-SOABI-suffix' into release-3.17
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.txt | 10 |
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() |