mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
Tests: Update LibName to cover spaces in shared library name
This commit is contained in:
@@ -828,6 +828,8 @@ if(BUILD_TESTING)
|
||||
${build_generator_args}
|
||||
--build-project LibName
|
||||
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
|
||||
--build-options
|
||||
-DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
|
||||
--test-command foobar
|
||||
)
|
||||
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
|
||||
|
||||
@@ -24,3 +24,11 @@ set_target_properties(verFoo PROPERTIES VERSION 3.1.4 SOVERSION 3)
|
||||
|
||||
add_executable(verFoobar foobar.c)
|
||||
target_link_libraries(verFoobar verFoo)
|
||||
|
||||
if(MAKE_SUPPORTS_SPACES AND NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
|
||||
# check with lib version and space
|
||||
add_library(ver_space SHARED ver_space.c)
|
||||
set_target_properties(ver_space PROPERTIES VERSION 3.1.4 SOVERSION 3 OUTPUT_NAME "ver space")
|
||||
add_executable(use_ver_space use_ver_space.c)
|
||||
target_link_libraries(use_ver_space ver_space)
|
||||
endif()
|
||||
|
||||
9
Tests/LibName/use_ver_space.c
Normal file
9
Tests/LibName/use_ver_space.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
int ver_space(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return ver_space();
|
||||
}
|
||||
7
Tests/LibName/ver_space.c
Normal file
7
Tests/LibName/ver_space.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int ver_space(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user