From 008428aadab826e9e15af91003a1e55f772156f2 Mon Sep 17 00:00:00 2001 From: axxel Date: Mon, 11 Mar 2024 12:45:39 +0100 Subject: [PATCH] cmake: add bundled zint objects directly to libZXing This makes sure there is only 1 static library to deal with instead of 2. Solves an issue with the bundled rust feature. --- core/CMakeLists.txt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 8226c95e7c..1b4b3049e2 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -516,15 +516,9 @@ target_link_libraries (ZXing PRIVATE Threads::Threads) if (BUILD_WRITERS_NEW) if (ZXING_USE_BUNDLED_ZINT) aux_source_directory(src/libzint LIBZINT_FILES) # manually re-run cmake after adding a new file/symlink - add_library(bundled_zint STATIC EXCLUDE_FROM_ALL ${LIBZINT_FILES}) - target_include_directories (bundled_zint - PUBLIC "$" - ) - target_compile_options (bundled_zint - PUBLIC ${ZXING_PUBLIC_FLAGS} - PRIVATE ${ZXING_PRIVATE_FLAGS} - ) - target_link_libraries (ZXing PRIVATE bundled_zint) + set_source_files_properties(${LIBZINT_FILES} PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + target_sources(ZXing PRIVATE ${LIBZINT_FILES}) + target_include_directories (ZXing PRIVATE "$") else() include(../zxing.cmake) zxing_add_package(zint zint https://github.com/zint/zint.git 55a7369cd8c4a6b58bcd62f02a3a2d486952c897)