2016-10-07 19:50:20 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-06-30 05:40:07 +08:00
|
|
|
URLS "https://www.lua.org/ftp/lua-${VERSION}.tar.gz"
|
|
|
|
FILENAME "lua-${VERSION}.tar.gz"
|
|
|
|
SHA512 d90c6903355ee1309cb0d92a8a024522ff049091a117ea21efb585b5de35776191cd67d17a65b18c2f9d374795b7c944f047576f0e3fe818d094b26f0e4845c5
|
2019-05-19 05:33:05 +08:00
|
|
|
)
|
2023-04-14 00:13:15 +08:00
|
|
|
vcpkg_extract_source_archive(
|
|
|
|
SOURCE_PATH
|
2022-05-14 06:02:20 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2021-04-20 08:13:08 +08:00
|
|
|
PATCHES
|
|
|
|
vs2015-impl-c99.patch
|
|
|
|
fix-ios-system.patch
|
2016-10-07 19:50:20 +08:00
|
|
|
)
|
|
|
|
|
2022-02-08 11:02:38 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
2022-05-14 06:02:20 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/CMakeLists-cpp.txt" DESTINATION "${SOURCE_PATH}/cpp" RENAME "CMakeLists.txt")
|
2021-08-12 08:27:43 +08:00
|
|
|
|
2021-04-20 08:13:08 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2022-05-14 06:02:20 +08:00
|
|
|
cpp COMPILE_AS_CPP # Also used in cmake wrapper
|
2021-04-20 08:13:08 +08:00
|
|
|
tools INSTALL_TOOLS
|
|
|
|
)
|
|
|
|
|
2022-02-08 11:02:38 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2017-03-02 21:59:32 +08:00
|
|
|
OPTIONS
|
2021-08-12 08:27:43 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2016-10-08 05:49:49 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSKIP_INSTALL_HEADERS=ON
|
2016-10-07 19:50:20 +08:00
|
|
|
)
|
2022-02-08 11:02:38 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-10-07 19:50:20 +08:00
|
|
|
|
2021-08-12 08:27:43 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2022-02-08 11:02:38 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-lua CONFIG_PATH share/unofficial-lua)
|
2021-08-12 08:27:43 +08:00
|
|
|
|
|
|
|
if("cpp" IN_LIST FEATURES)
|
2022-03-01 02:47:37 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-lua-cpp CONFIG_PATH "share/unofficial-lua-cpp")
|
2019-07-03 04:49:17 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-12 08:27:43 +08:00
|
|
|
if ("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES lua luac SEARCH_DIR "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
endif()
|
2020-06-11 17:32:09 +08:00
|
|
|
|
2017-03-02 21:59:32 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
2020-10-28 11:29:12 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2022-02-08 11:02:38 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/luaconf.h" "defined(LUA_BUILD_AS_DLL)" "1")
|
2019-05-19 05:33:05 +08:00
|
|
|
endif()
|
2017-03-02 21:59:32 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-12 08:27:43 +08:00
|
|
|
# Suitable for old version
|
2022-02-08 11:02:38 +08:00
|
|
|
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2017-10-18 06:08:30 +08:00
|
|
|
|
2022-02-08 11:02:38 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/COPYRIGHT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|