[lua] Add [cpp] feature to additionally build lua-c++ (#7101)

* [lua] Add [cpp] feature to build lua-c++

* [lua] Switch tab for spaces in CMakeLists, set version to 5.3.5-2 as requested

* Use spaces for indentation
This commit is contained in:
Kevin Lu 2019-07-02 16:49:17 -04:00 committed by Victor Romero
parent 4642a4fc6c
commit 8ca8de6926
3 changed files with 22 additions and 9 deletions

View File

@ -52,6 +52,9 @@ ENDIF ()
#DLL
ADD_LIBRARY ( lua ${SRC_LIBLUA} )
IF (COMPILE_AS_CPP)
SET_TARGET_PROPERTIES(lua PROPERTIES OUTPUT_NAME "lua-c++")
ENDIF()
IF (BUILD_SHARED_LIBS AND WIN32)
TARGET_COMPILE_DEFINITIONS (lua PUBLIC -DLUA_BUILD_AS_DLL )

View File

@ -1,4 +1,7 @@
Source: lua
Version: 5.3.5-1
Version: 5.3.5-2
Homepage: https://www.lua.org
Description: a powerful, fast, lightweight, embeddable scripting language
Feature: cpp
Description: Builds lua for C++ linkage.

View File

@ -1,12 +1,5 @@
# Common Ambient Variables:
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
# PORT is the current port name (zlib, etc)
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
#
include(vcpkg_common_functions)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.lua.org/ftp/lua-5.3.5.tar.gz"
FILENAME "lua-5.3.5.tar.gz"
@ -32,6 +25,20 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
if("cpp" IN_LIST FEATURES)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DCOMPILE_AS_CPP=ON
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
-DSKIP_INSTALL_TOOLS=ON
)
vcpkg_install_cmake()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
file(READ ${CURRENT_PACKAGES_DIR}/include/luaconf.h LUA_CONF_H)