diff --git a/client/Makefile b/client/Makefile index b7e462785..00e23363f 100644 --- a/client/Makefile +++ b/client/Makefile @@ -961,6 +961,8 @@ ifeq ($(QT_FOUND),1) CXXSRCS = proxgui.cpp proxguiqt.cpp proxguiqt.moc.cpp # Qt has no JPEG2000 image handler, so we decode EF_DG2 & friends ourselves SRCS += imgjp2.c + # openjpeg.a is a static lib, avoid __declspec(dllimport) on its Windows API decls + PM3CFLAGS += -DOPJ_STATIC STATICLIBS += $(OPENJPEGLIB) LDLIBS += $(OPENJPEGLIBLD) else diff --git a/client/deps/openjpeg.cmake b/client/deps/openjpeg.cmake index 403f6c32f..e1b5f489e 100644 --- a/client/deps/openjpeg.cmake +++ b/client/deps/openjpeg.cmake @@ -28,6 +28,8 @@ add_library(pm3rrg_rdv4_openjpeg STATIC target_include_directories(pm3rrg_rdv4_openjpeg INTERFACE openjpeg) target_include_directories(pm3rrg_rdv4_openjpeg PRIVATE openjpeg) +# openjpeg.a is a static lib, avoid __declspec(dllimport) on its Windows API decls +target_compile_definitions(pm3rrg_rdv4_openjpeg PUBLIC OPJ_STATIC) # Third party code, don't hold it to our warning settings target_compile_options(pm3rrg_rdv4_openjpeg PRIVATE -w -O3) set_property(TARGET pm3rrg_rdv4_openjpeg PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/client/deps/openjpeg/Makefile b/client/deps/openjpeg/Makefile index 8fd3ed6b1..dbc696bbe 100644 --- a/client/deps/openjpeg/Makefile +++ b/client/deps/openjpeg/Makefile @@ -2,7 +2,8 @@ MYSRCPATHS = MYINCLUDES = # Third party code, don't fail the build on upstream's warnings MYCFLAGS = -w -O3 -MYDEFS = +# Avoid __declspec(dllimport/dllexport) on Windows, we always link this in statically +MYDEFS = -DOPJ_STATIC MYSRCS = \ bio.c \ cio.c \