mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-01 18:19:02 +08:00
Merge pull request #1770 from atkawa7/jsonnet
[jsonnet] init fixes #869
This commit is contained in:
commit
1bbce1ee84
53
ports/jsonnet/CMakeLists.txt
Normal file
53
ports/jsonnet/CMakeLists.txt
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5.1)
|
||||||
|
project(jsonnet)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set( jsonnet_sources
|
||||||
|
core/desugarer.cpp
|
||||||
|
core/formatter.cpp
|
||||||
|
core/lexer.cpp
|
||||||
|
core/libjsonnet.cpp
|
||||||
|
core/parser.cpp
|
||||||
|
core/pass.cpp
|
||||||
|
core/static_analysis.cpp
|
||||||
|
core/string_utils.cpp
|
||||||
|
core/vm.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(third_party/md5 include cpp core stdlib)
|
||||||
|
|
||||||
|
add_library(md5 STATIC third_party/md5/md5.cpp)
|
||||||
|
|
||||||
|
add_library(libjsonnet ${jsonnet_sources})
|
||||||
|
target_link_libraries(libjsonnet md5)
|
||||||
|
|
||||||
|
add_library(libjsonnet++ cpp/libjsonnet++.cpp)
|
||||||
|
target_link_libraries(libjsonnet++ libjsonnet)
|
||||||
|
|
||||||
|
add_executable(jsonnet cmd/jsonnet.cpp)
|
||||||
|
target_link_libraries(jsonnet libjsonnet)
|
||||||
|
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS libjsonnet libjsonnet++
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
LIBRARY DESTINATION lib
|
||||||
|
ARCHIVE DESTINATION lib
|
||||||
|
)
|
||||||
|
if(NOT DISABLE_INSTALL_TOOLS)
|
||||||
|
install (
|
||||||
|
TARGETS jsonnet
|
||||||
|
RUNTIME DESTINATION tools/jsonnet
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DISABLE_INSTALL_HEADERS)
|
||||||
|
install(FILES include/libjsonnet++.h include/libjsonnet.h DESTINATION include)
|
||||||
|
endif()
|
3
ports/jsonnet/CONTROL
Normal file
3
ports/jsonnet/CONTROL
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Source: jsonnet
|
||||||
|
Version: 2017-09-02-11cf9fa9f2fe8acbb14b096316006082564ca580
|
||||||
|
Description: Jsonnet - The data templating language
|
29
ports/jsonnet/portfile.cmake
Normal file
29
ports/jsonnet/portfile.cmake
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
include(vcpkg_common_functions)
|
||||||
|
|
||||||
|
vcpkg_from_github(
|
||||||
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
|
REPO google/jsonnet
|
||||||
|
REF 11cf9fa9f2fe8acbb14b096316006082564ca580
|
||||||
|
SHA512 77d9c9e86c4c6501a00f089c72dea522dd818ac0c810b603d18bea111f8f8cf9a25039600a9ba158c5f02142e24d49074e7fe0ddf113665eedf4c3ef66bf421a
|
||||||
|
HEAD_REF master
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_execute_required_process(
|
||||||
|
COMMAND Powershell -Command "((Get-Content -Encoding Byte ${SOURCE_PATH}/stdlib/std.jsonnet) -join ',') + ',0' > ${SOURCE_PATH}/core/std.jsonnet.h"
|
||||||
|
WORKING_DIRECTORY ${SOURCE_PATH}
|
||||||
|
LOGNAME "std.jsonnet"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||||
|
|
||||||
|
vcpkg_configure_cmake(
|
||||||
|
SOURCE_PATH ${SOURCE_PATH}
|
||||||
|
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON
|
||||||
|
)
|
||||||
|
|
||||||
|
vcpkg_install_cmake()
|
||||||
|
vcpkg_copy_pdbs()
|
||||||
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/jsonnet)
|
||||||
|
|
||||||
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jsonnet RENAME copyright)
|
Loading…
Reference in New Issue
Block a user