Move where Windows libraries are linked

To where they're actually used. The tests don't need them, and MinGW complains if they aren't linked to the first layer of the C++ wrapper.
This commit is contained in:
Oliver Hamlet
2026-01-31 15:29:33 +00:00
parent 7910670675
commit c6c3056d35
2 changed files with 4 additions and 6 deletions
+4 -4
View File
@@ -69,6 +69,10 @@ target_link_libraries(libloot_cpp INTERFACE
debug "${TARGET_PATH}/debug/${LIBLOOT_CPP_FILENAME}")
target_include_directories(libloot_cpp INTERFACE "${TARGET_PATH}/cxxbridge")
if(WIN32)
target_link_libraries(libloot_cpp INTERFACE ntdll ws2_32 bcrypt)
endif()
##############################
# General Settings
@@ -186,10 +190,6 @@ set_target_properties(libloot PROPERTIES
if(WIN32)
target_compile_definitions(libloot PRIVATE UNICODE _UNICODE LOOT_EXPORT)
set(LOOT_LIBS ntdll ws2_32 bcrypt)
target_link_libraries(libloot PRIVATE ${LOOT_LIBS})
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-2
View File
@@ -99,8 +99,6 @@ if(WIN32)
if((NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") OR NOT LIBLOOT_BUILD_SHARED)
target_compile_definitions(libloot_tests PRIVATE LOOT_STATIC)
endif()
target_link_libraries(libloot_tests PRIVATE ${LOOT_LIBS})
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")