diff --git a/lib/jxl.cmake b/lib/jxl.cmake index a42b6f0..77e850b 100644 --- a/lib/jxl.cmake +++ b/lib/jxl.cmake @@ -627,6 +627,7 @@ foreach(target IN ITEMS jxl jxl_dec) endif() endforeach() +set(JXL_STATIC_SUFFIX "") # Only install libjxl shared library. The libjxl_dec is not installed since it # contains symbols also in libjxl which would conflict if programs try to use # both. @@ -637,6 +638,7 @@ install(TARGETS jxl else() add_library(jxl ALIAS jxl-static) add_library(jxl_dec ALIAS jxl_dec-static) +set(JXL_STATIC_SUFFIX "-static") endif() # BUILD_SHARED_LIBS # Add a pkg-config file for libjxl. diff --git a/lib/jxl/libjxl.pc.in b/lib/jxl/libjxl.pc.in index 4a7af65..2d8d433 100644 --- a/lib/jxl/libjxl.pc.in +++ b/lib/jxl/libjxl.pc.in @@ -7,7 +7,7 @@ Name: libjxl Description: Loads and saves JPEG XL files Version: @JPEGXL_LIBRARY_VERSION@ Requires.private: @JPEGXL_LIBRARY_REQUIRES@ -Libs: -L${libdir} -ljxl +Libs: -L${libdir} -ljxl@JXL_STATIC_SUFFIX@ Libs.private: -lm Cflags: -I${includedir} Cflags.private: -DJXL_STATIC_DEFINE diff --git a/lib/jxl_threads.cmake b/lib/jxl_threads.cmake index b8ce66b..1634280 100644 --- a/lib/jxl_threads.cmake +++ b/lib/jxl_threads.cmake @@ -100,6 +100,7 @@ target_compile_definitions(jxl_threads generate_export_header(jxl_threads BASE_NAME JXL_THREADS EXPORT_FILE_NAME include/jxl/jxl_threads_export.h) +set(THREAD_STATIC_SUFFIX "") else() add_library(jxl_threads ALIAS jxl_threads-static) # When not building the shared library generate the jxl_threads_export.h header @@ -107,6 +108,7 @@ add_library(jxl_threads ALIAS jxl_threads-static) generate_export_header(jxl_threads-static BASE_NAME JXL_THREADS EXPORT_FILE_NAME include/jxl/jxl_threads_export.h) +set(THREAD_STATIC_SUFFIX "-static") endif() # BUILD_SHARED_LIBS diff --git a/lib/threads/libjxl_threads.pc.in b/lib/threads/libjxl_threads.pc.in index 50b937a..26cebbc 100644 --- a/lib/threads/libjxl_threads.pc.in +++ b/lib/threads/libjxl_threads.pc.in @@ -7,7 +7,7 @@ Name: libjxl_threads Description: JPEG XL multi-thread runner using std::threads. Version: @JPEGXL_LIBRARY_VERSION@ Requires.private: @JPEGXL_THREADS_LIBRARY_REQUIRES@ -Libs: -L${libdir} -ljxl_threads +Libs: -L${libdir} -ljxl_threads@THREAD_STATIC_SUFFIX@ Libs.private: -lm Cflags: -I${includedir} Cflags.private: -DJXL_THREADS_STATIC_DEFINE