Fix Visual Studio shared library build

Todo: fluid-shared can't (yet) be built agains the shared fltk lib
  because of some linker errors. Needs investigation.

Note: fluid-shared is basically a test program to demonstrate linking
  against the shared FLTK libs but doesn't work yet using VS (MSVC).
  This is no problem for the functionality.
This commit is contained in:
Albrecht Schlosser
2023-09-12 23:18:46 +02:00
parent e44a988c4a
commit ede381c005
5 changed files with 17 additions and 10 deletions

View File

@@ -166,9 +166,12 @@ if (OPTION_BUILD_SHARED_LIBS)
list (APPEND FLUID_TARGETS fluid-shared)
add_executable (fluid-shared fluid.cxx fluid.h)
if (MSVC)
target_link_libraries (fluid-shared fluid-lib fltk_SHARED)
# Todo: this should link against fltk_SHARED rather than fltk_images but for an unknown
# reason this would issue link errors (about 25 undefined symbols). Needs investigation.
# AlbrechtS: Sep. 12, 2023
target_link_libraries (fluid-shared PRIVATE fluid-lib fltk_images) # should be: fltk_SHARED)
else ()
target_link_libraries (fluid-shared fluid-lib fltk_images_SHARED)
target_link_libraries (fluid-shared PRIVATE fluid-lib fltk_images_SHARED)
endif (MSVC)
endif ()