Skip to content

Commit

Permalink
CMake: Distinguish fully shared and semi shared DLL files by name
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Mar 4, 2022
1 parent f2bc463 commit 9f1bb89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ jobs:
run: |-
set -x -o pipefail
ninja -v -C build all
objdump -p build/lurch.dll | fgrep 'DLL Name' | sort -u | nl
objdump -p build/lurch*.dll | fgrep 'DLL Name' | sort -u | nl
- name: Gather transitive DLL closure
run: |-
set -x -o pipefail
DLL_HOME=/mingw32/bin/ BUILD_DIR=build/ ./copy_dll_closure.sh build/lurch.dll build/
DLL_HOME=/mingw32/bin/ BUILD_DIR=build/ ./copy_dll_closure.sh build/lurch*.dll build/
ls -lh build/*.dll
- name: Test (KNOWN TO FAIL)
Expand Down
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ else()
endif()
add_library(lurch ${_LURCH_LIBRARY_TYPE} ${_LURCH_SOURCES})
set_target_properties(lurch PROPERTIES PREFIX "") # for lurch.so not liblurch.so
if(WIN32)
if(BUILD_SHARED_LIBS)
set(_LURCH_OUTPUT_NAME lurch_fully_shared)
else()
set(_LURCH_OUTPUT_NAME lurch_semi_shared)
endif()
set_target_properties(lurch PROPERTIES OUTPUT_NAME ${_LURCH_OUTPUT_NAME})
else()
set(_LURCH_OUTPUT_NAME lurch)
endif()

if(LURCH_INSTALL)
install(TARGETS lurch
Expand All @@ -131,7 +141,7 @@ endif()

add_custom_target(install-home
COMMAND mkdir -p ~/.purple/plugins
COMMAND cp -v ${CMAKE_CURRENT_BINARY_DIR}/lurch${CMAKE_SHARED_LIBRARY_SUFFIX} ~/.purple/plugins/
COMMAND cp -v ${CMAKE_CURRENT_BINARY_DIR}/${_LURCH_OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ~/.purple/plugins/
DEPENDS lurch
)

Expand Down Expand Up @@ -181,7 +191,7 @@ if(LURCH_WITH_TESTS)
target_link_libraries(${_target} PRIVATE ${GMODULE_STATIC_LIBRARIES})
endif()

add_test(NAME ${_target} COMMAND ${_target} ${CMAKE_CURRENT_BINARY_DIR}/lurch${CMAKE_SHARED_LIBRARY_SUFFIX})
add_test(NAME ${_target} COMMAND ${_target} ${CMAKE_CURRENT_BINARY_DIR}/${_LURCH_OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
add_test(NAME ${_target} COMMAND ${_target})
endif()
Expand Down

0 comments on commit 9f1bb89

Please sign in to comment.