Unverified Commit 964cfcb7 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #242641 from nrhtr/fix-jsonnet-aarch64-darwin

jsonnet: fix linking issue with libjsonnet++
parents c69a5f66 e0698cf8
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -15,7 +15,16 @@ stdenv.mkDerivation rec {
  nativeBuildInputs = [ jekyll cmake ];
  buildInputs = [ gtest ];

  cmakeFlags = ["-DBUILD_STATIC_LIBS=ON" "-DUSE_SYSTEM_GTEST=ON" ];
  cmakeFlags = [
    "-DUSE_SYSTEM_GTEST=ON"
    "-DBUILD_STATIC_LIBS=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
    "-DBUILD_SHARED_BINARIES=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
  ];

  # https://github.com/google/jsonnet/issues/778
  patches = [
    ./fix-cpp-unresolved-symbols.patch
  ];

  enableParallelBuilding = true;

+12 −0
Original line number Diff line number Diff line
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 3a52458..872e6c6 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -10,6 +10,7 @@ set(LIBJSONNETPP_SOURCE

 add_library(libjsonnet++ SHARED ${LIBJSONNETPP_HEADERS} ${LIBJSONNETPP_SOURCE})
 add_dependencies(libjsonnet++ jsonnet)
+target_link_libraries(libjsonnet++ libjsonnet)
 # target_link_libraries(libjsonnet libjsonnet)

 # CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without