Tests: Update LibName to cover spaces in shared library name

This commit is contained in:
Brad King
2021-03-04 15:50:16 -05:00
parent 388eb83c09
commit 7621861f30
4 changed files with 26 additions and 0 deletions

View File

@@ -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")

View File

@@ -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()

View File

@@ -0,0 +1,9 @@
#ifdef _WIN32
__declspec(dllimport)
#endif
int ver_space(void);
int main(void)
{
return ver_space();
}

View File

@@ -0,0 +1,7 @@
#ifdef _WIN32
__declspec(dllexport)
#endif
int ver_space(void)
{
return 0;
}