summaryrefslogtreecommitdiff
path: root/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch')
-rw-r--r--app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch b/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch
new file mode 100644
index 000000000000..369b806467be
--- /dev/null
+++ b/app-text/editorconfig-core-c/files/editorconfig-core-c-0.12.3-no-static-libs.patch
@@ -0,0 +1,69 @@
+From 4fa85f00f824b1dd5d1244c77667ea497d94f02b Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sat, 11 Jul 2020 21:11:58 +0200
+Subject: [PATCH] Do not build static lib if BUILD_STATICALLY_LINKED_EXE=OFF
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ src/lib/CMakeLists.txt | 36 +++++++++++++++++++++++-------------
+ 1 file changed, 23 insertions(+), 13 deletions(-)
+
+diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
+index 353ab1c..12db621 100644
+--- a/src/lib/CMakeLists.txt
++++ b/src/lib/CMakeLists.txt
+@@ -44,16 +44,18 @@ if(WIN32)
+ endif()
+ target_link_libraries(editorconfig_shared ${PCRE2_LIBRARIES})
+
+-add_library(editorconfig_static STATIC ${editorconfig_LIBSRCS})
+-set_target_properties(editorconfig_static PROPERTIES
+- OUTPUT_NAME editorconfig_static
+- VERSION ${PROJECT_VERSION})
++if(BUILD_STATICALLY_LINKED_EXE)
++ add_library(editorconfig_static STATIC ${editorconfig_LIBSRCS})
++ set_target_properties(editorconfig_static PROPERTIES
++ OUTPUT_NAME editorconfig_static
++ VERSION ${PROJECT_VERSION})
+
+-# We need to link Shwapi since we use PathIsRelative
+-if(WIN32)
+- target_link_libraries(editorconfig_static Shlwapi)
++ # We need to link Shwapi since we use PathIsRelative
++ if(WIN32)
++ target_link_libraries(editorconfig_static Shlwapi)
++ endif()
++ target_link_libraries(editorconfig_static ${PCRE2_LIBRARIES})
+ endif()
+-target_link_libraries(editorconfig_static ${PCRE2_LIBRARIES})
+
+ # EditorConfig package name for find_package() and the CMake package registry.
+ # On UNIX the system registry is usually just "lib/cmake/<package>".
+@@ -65,11 +67,19 @@ set(editorconfig_CONFIG_EXPORT_NAME "${config_package_name}Targets")
+ set(editorconfig_CONFIG_INSTALL_LIBDIR
+ "${CMAKE_INSTALL_LIBDIR}/cmake/${config_package_name}")
+
+-install(TARGETS editorconfig_shared editorconfig_static
+- EXPORT ${editorconfig_CONFIG_EXPORT_NAME}
+- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++if(BUILD_STATICALLY_LINKED_EXE)
++ install(TARGETS editorconfig_static
++ EXPORT ${editorconfig_CONFIG_EXPORT_NAME}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++else()
++ install(TARGETS editorconfig_shared
++ EXPORT ${editorconfig_CONFIG_EXPORT_NAME}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
++endif()
+
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/editorconfig.pc.in
+--
+2.27.0
+