vcpkg/ports/chakracore/portfile.cmake

68 lines
2.6 KiB
CMake
Raw Normal View History

2018-02-26 03:37:23 +08:00
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
message(STATUS "Warning: Static building not supported yet. Building dynamic.")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif()
if (VCPKG_CRT_LINKAGE STREQUAL static)
message(FATAL_ERROR "Static linking of the CRT is not yet supported.")
endif()
include(vcpkg_common_functions)
2017-05-20 08:13:06 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/ChakraCore
2018-02-26 03:37:23 +08:00
REF v1.8.1
SHA512 203eaad21130fca9ac043952327f758947d41288ce9eb771bc469e768079a39cc517f86746d85ae270b04c5b7640d18d02f497a18cda05190dfaa68fdc16cbb9
2017-05-20 08:13:06 +08:00
HEAD_REF master
)
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})
vcpkg_build_msbuild(
2018-02-24 17:43:37 +08:00
PROJECT_PATH ${BUILDTREE_PATH}/Build/Chakra.Core.sln
2017-05-20 08:13:06 +08:00
OPTIONS "/p:DotNetSdkRoot=${NETFXSDK_PATH}/" "/p:CustomBeforeMicrosoftCommonTargets=${CMAKE_CURRENT_LIST_DIR}/no-warning-as-error.props"
)
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
DESTINATION ${CURRENT_PACKAGES_DIR}/include
)
file(INSTALL
2018-02-24 17:43:37 +08:00
${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
2018-02-24 17:43:37 +08:00
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_debug/Chakracore.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(INSTALL
2018-02-24 17:43:37 +08:00
${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
2018-02-24 17:43:37 +08:00
${BUILDTREE_PATH}/Build/VcBuild/bin/${TRIPLET_SYSTEM_ARCH}_release/Chakracore.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
file(INSTALL
2018-02-24 17:43:37 +08:00
${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-02-24 17:43:37 +08:00
vcpkg_copy_pdbs()
file(INSTALL
${SOURCE_PATH}/LICENSE.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/ChakraCore RENAME copyright)