Files
CMake/Tests/RunCMake/SharedLibraryDefines/RunCMakeTest.cmake
AJIOB 83bbde5449 MSVC: Define _WINDLL consistently for shared libraries
Visual Studio defines this automatically for `.dll` targets.
For consistency, define it when compiling for the MSVC ABI
with other generators.  Add policy CMP0203 for compatibility.

Fixes: #27253
2025-09-29 18:26:44 -04:00

21 lines
595 B
CMake

include(RunCMake)
function(configure_and_build case)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
run_cmake(${case})
set(RunCMake_TEST_NO_CLEAN 1)
if (RunCMake_GENERATOR_IS_MULTI_CONFIG)
run_cmake_command(${case}-build-Debug ${CMAKE_COMMAND} --build . --config Debug)
run_cmake_command(${case}-build-Release ${CMAKE_COMMAND} --build . --config Release)
else()
run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .)
endif()
endfunction()
configure_and_build(C)
configure_and_build(CXX)
if(CMake_TEST_CUDA)
configure_and_build(CUDA)
endif()