aboutsummaryrefslogtreecommitdiffstats
path: root/testing/jsonnet/build-cli-shared.patch
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.eu>2019-06-19 22:17:37 +0200
committerLeo <thinkabit.ukim@gmail.com>2019-06-20 10:13:09 -0300
commit15aa878b0dd21efa1aef2518baaf60ba57571daf (patch)
tree55a5f935cd86eb1439da50452ed9838ea1775e8c /testing/jsonnet/build-cli-shared.patch
parent19b9749b21c861c7f19505796b8f5df2ff191793 (diff)
downloadaports-15aa878b0dd21efa1aef2518baaf60ba57571daf.tar.bz2
aports-15aa878b0dd21efa1aef2518baaf60ba57571daf.tar.xz
testing/jsonnet: new aport
Diffstat (limited to 'testing/jsonnet/build-cli-shared.patch')
-rw-r--r--testing/jsonnet/build-cli-shared.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/jsonnet/build-cli-shared.patch b/testing/jsonnet/build-cli-shared.patch
new file mode 100644
index 0000000000..f10d79edbf
--- /dev/null
+++ b/testing/jsonnet/build-cli-shared.patch
@@ -0,0 +1,46 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,7 @@
+ # User-configurable options.
+ option(BUILD_JSONNET "Build jsonnet command-line tool." ON)
+ option(BUILD_JSONNETFMT "Build jsonnetfmt command-line tool." ON)
++option(BUILD_CLI_SHARED "Build command-line tools against shared lib" OFF)
+ option(BUILD_TESTS "Build and run jsonnet tests." ON)
+ option(USE_SYSTEM_GTEST "Use system-provided gtest library" OFF)
+ set(GLOBAL_OUTPUT_PATH_SUFFIX "" CACHE STRING
+
+--- a/cmd/CMakeLists.txt
++++ b/cmd/CMakeLists.txt
+@@ -2,16 +2,28 @@
+
+ if (BUILD_JSONNET OR BUILD_TESTS)
+ add_executable(jsonnet ${LIBJSONNET_SOURCE} jsonnet.cpp utils.cpp)
+- add_dependencies(jsonnet libjsonnet_static)
+- target_link_libraries(jsonnet libjsonnet_static)
+
++ if (BUILD_CLI_SHARED)
++ add_dependencies(jsonnet libjsonnet)
++ target_link_libraries(jsonnet libjsonnet)
++ else()
++ add_dependencies(jsonnet libjsonnet_static)
++ target_link_libraries(jsonnet libjsonnet_static)
++ endif()
++
+ install(TARGETS jsonnet DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif()
+
+ if (BUILD_JSONNETFMT OR BUILD_TESTS)
+ add_executable(jsonnetfmt ${LIBJSONNET_SOURCE} jsonnetfmt.cpp utils.cpp)
+- add_dependencies(jsonnetfmt libjsonnet_static)
+- target_link_libraries(jsonnetfmt libjsonnet_static)
++
++ if (BUILD_CLI_SHARED)
++ add_dependencies(jsonnetfmt libjsonnet)
++ target_link_libraries(jsonnetfmt libjsonnet)
++ else()
++ add_dependencies(jsonnetfmt libjsonnet_static)
++ target_link_libraries(jsonnetfmt libjsonnet_static)
++ endif()
+
+ install(TARGETS jsonnetfmt DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif()