Skip to content

Commit

Permalink
fix: reverted changes to reallow unit tests in a static build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Jul 9, 2024
1 parent 3820ef5 commit 3bbc5b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ option(DPP_USE_EXTERNAL_JSON "Use an external installation of nlohmann::json" OF
option(DPP_USE_PCH "Use precompiled headers to speed up compilation" OFF)
option(AVX_TYPE "Force AVX type for speeding up audio mixing" OFF)

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

if (DPP_BUILD_TEST AND NOT BUILD_SHARED_LIBS)
set(DPP_BUILD_TEST OFF)
message("-- ${Yellow}Note - Unit Tests have been forcibly disabled since you are building statically.${ColourReset}")
endif()

include(CheckCXXSymbolExists)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_definitions(DPP_BUILD)
Expand Down
6 changes: 5 additions & 1 deletion library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,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 3bbc5b2

Please sign in to comment.