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.
This commit is contained in:
2024-11-14 21:57:40 +00:00
parent 71908495f2
commit 95e7bc3b4f

View File

@@ -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}")