summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/CMakeLists.txt
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-11-18 15:24:17 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-11-29 15:48:08 (GMT)
commit77d734aede807a038ab10520620cfbb24e84e76e (patch)
treebc20ce786a249862842c82484393d61edef2b0ca /Tests/FindPython/CMakeLists.txt
parentf72c405d4ee4ad4775a10a944774b91f49726dad (diff)
downloadCMake-77d734aede807a038ab10520620cfbb24e84e76e.zip
CMake-77d734aede807a038ab10520620cfbb24e84e76e.tar.gz
CMake-77d734aede807a038ab10520620cfbb24e84e76e.tar.bz2
FindPython: add support for Stable ABI
Fixes: #24141
Diffstat (limited to 'Tests/FindPython/CMakeLists.txt')
-rw-r--r--Tests/FindPython/CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index d4cf36b..b6942c9 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -377,6 +377,7 @@ if(CMake_TEST_FindPython)
--build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
"-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
"-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_SABIModule=${CMake_TEST_FindPython_SABIModule}"
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
@@ -478,6 +479,35 @@ if(CMake_TEST_FindPython)
endif()
endif()
+if(CMake_TEST_FindPython_SABIModule)
+ add_test(NAME FindPython.Python2.Development.SABIModule COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python2SABIModule"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2SABIModule"
+ ${build_generator_args}
+ --build-project TestPython2SABIModule
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES
+ PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule")
+
+ # Use exclusively Release configuration because Debug is, on Windows with MSVC,
+ # unusable with SABI: Python force link with debug version of full versioned library rather than
+ # the stable ABI one.
+ add_test(NAME FindPython.Python3.Development.SABIModule COMMAND
+ ${CMAKE_CTEST_COMMAND} -C Release
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python3SABIModule"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3SABIModule"
+ ${build_generator_args}
+ --build-project TestPython3SABIModule
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C Release
+ )
+endif()
+
if(CMake_TEST_FindPython_NumPy)
add_test(NAME FindPython.NumPy COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>