2018-03-08 03:10:12 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
message(FATAL_ERROR "UWP is not currently supported.")
|
|
|
|
endif()
|
|
|
|
|
2016-10-27 03:20:46 +08:00
|
|
|
include(vcpkg_common_functions)
|
2016-10-11 14:10:09 +08:00
|
|
|
|
2018-08-25 05:05:07 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
|
2017-05-20 08:13:06 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Microsoft/ChakraCore
|
2018-08-01 08:03:35 +08:00
|
|
|
REF v1.10.1
|
|
|
|
SHA512 e3a9a9e6506b603922e5a5ed1fb900d43dfd6c8e5e091e12bf902dbe58cd12753e6b7f59a895081cea880eb78bcc55571ee561fe03c96d6312608626a5b653f2
|
2017-05-20 08:13:06 +08:00
|
|
|
HEAD_REF master
|
2017-02-14 15:30:30 +08:00
|
|
|
)
|
|
|
|
|
2017-05-20 07:57:06 +08:00
|
|
|
find_path(COR_H_PATH cor.h)
|
|
|
|
if(COR_H_PATH MATCHES "NOTFOUND")
|
|
|
|
message(FATAL_ERROR "Could not find <cor.h>. Ensure the NETFXSDK is installed.")
|
|
|
|
endif()
|
|
|
|
get_filename_component(NETFXSDK_PATH "${COR_H_PATH}/../.." ABSOLUTE)
|
|
|
|
|
2018-02-24 17:43:37 +08:00
|
|
|
set(BUILDTREE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
|
|
|
|
file(REMOVE_RECURSE ${BUILDTREE_PATH})
|
|
|
|
file(COPY ${SOURCE_PATH}/ DESTINATION ${BUILDTREE_PATH})
|
|
|
|
|
2018-08-25 05:05:07 +08:00
|
|
|
set(CHAKRA_RUNTIME_LIB "static_library") # ChakraCore default is static CRT linkage
|
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
set(CHAKRA_RUNTIME_LIB "dynamic_library")
|
|
|
|
endif()
|
|
|
|
|
2016-10-11 14:10:09 +08:00
|
|
|
vcpkg_build_msbuild(
|
2018-02-24 17:43:37 +08:00
|
|
|
PROJECT_PATH ${BUILDTREE_PATH}/Build/Chakra.Core.sln
|
2018-08-25 05:05:07 +08:00
|
|
|
OPTIONS
|
|
|
|
"/p:DotNetSdkRoot=${NETFXSDK_PATH}/"
|
|
|
|
"/p:CustomBeforeMicrosoftCommonTargets=${CMAKE_CURRENT_LIST_DIR}/no-warning-as-error.props"
|
|
|
|
"/p:RuntimeLib=${CHAKRA_RUNTIME_LIB}"
|
2016-10-11 14:10:09 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(INSTALL
|
2018-02-24 17:43:37 +08:00
|
|
|
${BUILDTREE_PATH}/lib/jsrt/ChakraCore.h
|
|
|
|
${BUILDTREE_PATH}/lib/jsrt/ChakraCommon.h
|
|
|
|
${BUILDTREE_PATH}/lib/jsrt/ChakraCommonWindows.h
|
|
|
|
${BUILDTREE_PATH}/lib/jsrt/ChakraDebug.h
|
2016-10-11 14:10:09 +08:00
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
)
|
2018-03-20 04:02:19 +08:00
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
|
|
|
|
file(INSTALL
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.dll
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/ChakraCore.pdb
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/Chakracore.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
|
|
|
file(INSTALL
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.dll
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ChakraCore.pdb
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/Chakracore.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
)
|
|
|
|
file(INSTALL
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/ch.exe
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/GCStress.exe
|
|
|
|
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/rl.exe
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/chakracore)
|
2018-08-25 05:05:07 +08:00
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/chakracore)
|
2018-03-20 04:02:19 +08:00
|
|
|
endif()
|
2018-02-24 17:43:37 +08:00
|
|
|
|
2017-02-14 15:30:30 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2016-10-11 14:10:09 +08:00
|
|
|
file(INSTALL
|
2017-05-20 07:57:06 +08:00
|
|
|
${SOURCE_PATH}/LICENSE.txt
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/share/ChakraCore RENAME copyright)
|