From 77716ecb62354bc5468e2ae3d7e30364cdf86227 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 9 Oct 2026 08:43:13 +0200 Subject: [PATCH] cmake: fix define used to indicate a static or dynamic library in pkg-config --- CMakeLists.txt | 2 ++ libutf8proc.pc.cmakein | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f9f15421..ae978eb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ if (BUILD_SHARED_LIBS) else() # Building static library target_compile_definitions(utf8proc PUBLIC "UTF8PROC_STATIC") + list(APPEND UTF8PROC_COMPILE_DEFS "-DUTF8PROC_STATIC") if (MSVC) set_target_properties(utf8proc PROPERTIES OUTPUT_NAME "utf8proc_static") endif() @@ -54,6 +55,7 @@ if (UTF8PROC_INSTALL) LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ) + string(REPLACE ";" " " UTF8PROC_COMPILE_DEF "${UTF8PROC_COMPILE_DEFS}") configure_file(libutf8proc.pc.cmakein libutf8proc.pc @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libutf8proc.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") # Install CMake targets file. diff --git a/libutf8proc.pc.cmakein b/libutf8proc.pc.cmakein index a8638be4..37a98f4a 100644 --- a/libutf8proc.pc.cmakein +++ b/libutf8proc.pc.cmakein @@ -7,4 +7,4 @@ Name: libutf8proc Description: UTF8 processing Version: @PROJECT_VERSION@ Libs: -L${libdir} -lutf8proc -Cflags: -I${includedir} -DUTF8PROC_EXPORTS +Cflags: -I${includedir} @UTF8PROC_COMPILE_DEF@