vcpkg/ports/jsonnet/001-enable-msvc.patch

81 lines
2.5 KiB
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
2019-11-02 07:51:08 +08:00
index 0418d4a..ac8f0f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
2019-11-02 07:51:08 +08:00
@@ -2,6 +2,8 @@
cmake_minimum_required(VERSION 2.8.7)
project(jsonnet C CXX)
+add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+
2019-11-02 07:51:08 +08:00
include(ExternalProject)
include(GNUInstallDirs)
@@ -89,6 +91,7 @@ else()
endif()
# Compiler flags.
+if (0)
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" OR
${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(OPT "-O3")
2019-11-02 07:51:08 +08:00
@@ -98,6 +101,7 @@ else()
# TODO: Windows support.
message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} not supported")
endif()
+endif()
# Look for libraries in global output path.
link_directories(${GLOBAL_OUTPUT_PATH})
diff --git a/cmd/CMakeLists.txt b/cmd/CMakeLists.txt
2019-11-02 07:51:08 +08:00
index c032f02..d80d2a0 100644
--- a/cmd/CMakeLists.txt
+++ b/cmd/CMakeLists.txt
@@ -13,5 +13,5 @@ if (BUILD_JSONNETFMT OR BUILD_TESTS)
2019-11-02 07:51:08 +08:00
add_dependencies(jsonnetfmt libjsonnet_for_binaries)
target_link_libraries(jsonnetfmt libjsonnet_for_binaries)
- install(TARGETS jsonnetfmt DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ install(TARGETS jsonnetfmt DESTINATION tools/jsonnet)
endif()
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
2019-11-02 07:51:08 +08:00
index 60fdcb1..82fb7c2 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -28,7 +28,7 @@ set(LIBJSONNET_SOURCE
string_utils.cpp
vm.cpp)
-add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
+add_library(libjsonnet ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet md5 stdlib)
2019-11-02 07:51:08 +08:00
target_link_libraries(libjsonnet md5 nlohmann_json::nlohmann_json)
2019-11-02 07:51:08 +08:00
@@ -46,7 +46,7 @@ set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet
PUBLIC_HEADER "${LIB_HEADER}")
install(TARGETS libjsonnet
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
2019-11-02 07:51:08 +08:00
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
2019-11-02 07:51:08 +08:00
if (BUILD_STATIC_LIBS)
diff --git a/stdlib/CMakeLists.txt b/stdlib/CMakeLists.txt
2019-11-02 07:51:08 +08:00
index a481d9f..0dc3ab6 100644
--- a/stdlib/CMakeLists.txt
+++ b/stdlib/CMakeLists.txt
@@ -2,6 +2,7 @@
add_executable(to_c_array to_c_array.cpp)
+if (0)
# Custom command that will only build stdlib when it changes.
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h
2019-11-02 07:51:08 +08:00
@@ -13,3 +14,4 @@ add_custom_command(
# Standard library build target that libjsonnet can depend on.
add_custom_target(stdlib ALL
2019-11-02 07:51:08 +08:00
DEPENDS ${PROJECT_SOURCE_DIR}/core/std.jsonnet.h)
+endif()
\ No newline at end of file