From 95e7bc3b4f11ecd8e20050a06079f509f5c406ec Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 14 Nov 2024 21:57:40 +0000 Subject: [PATCH] cmake: define BLUELIB_STATIC when linking to static libraries msvc requires this because functions exported from .lib files have a different name when the implementation is in a .dll file. --- cmake/FindBluelib.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/FindBluelib.cmake b/cmake/FindBluelib.cmake index 95fe532..cd33e0d 100644 --- a/cmake/FindBluelib.cmake +++ b/cmake/FindBluelib.cmake @@ -106,6 +106,10 @@ if (Bluelib_FOUND) INTERFACE_INCLUDE_DIRECTORIES "${Bluelib_${component}_INCLUDE_DIR}") target_compile_definitions(Bluelib::${component} INTERFACE _CRT_SECURE_NO_WARNINGS=1) + if (Bluelib_STATIC) + target_compile_definitions(Bluelib::${component} INTERFACE BLUELIB_STATIC=1) + endif () + set_target_properties(Bluelib::${component} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${Bluelib_${component}_LIBRARY}")