Skip to content

Commit

Permalink
fix: unit tests are now built statically when BUILD_SHARED_LIBS is off (
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 authored Jul 11, 2024
1 parent 5bf88c2 commit dc68a90
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ if(NOT BUILD_SHARED_LIBS)
endif()
endif()

include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/colour.cmake")

if (BUILD_VOICE_SUPPORT)
if (MINGW OR NOT WIN32)
find_package(PkgConfig QUIET)
Expand Down Expand Up @@ -361,7 +359,11 @@ if (DPP_BUILD_TEST)
if (MSVC)
target_compile_options(${testname} PRIVATE /utf-8)
endif()
target_link_libraries(${testname} PUBLIC ${modname})
set (static_if_needed "")
if(NOT BUILD_SHARED_LIBS)
set (static_if_needed "-static")
endif()
target_link_libraries(${testname} PUBLIC ${modname} ${static_if_needed})
endif()
endforeach()
add_test(
Expand Down

0 comments on commit dc68a90

Please sign in to comment.