aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lu <6320810+kevinlul@users.noreply.github.com>2019-07-02 16:49:17 -0400
committerVictor Romero <romerosanchezv@gmail.com>2019-07-02 13:49:17 -0700
commit8ca8de6926bc67ccc71f4b3f4733ce2f1d3b0547 (patch)
treeb79bd449466ac362c332af1d5c4e84dc22bb8118
parent4642a4fc6c4437b7d68294ab4e34d3fe38051244 (diff)
downloadvcpkg-8ca8de6926bc67ccc71f4b3f4733ce2f1d3b0547.tar.gz
vcpkg-8ca8de6926bc67ccc71f4b3f4733ce2f1d3b0547.zip
[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
-rw-r--r--ports/lua/CMakeLists.txt3
-rw-r--r--ports/lua/CONTROL5
-rw-r--r--ports/lua/portfile.cmake23
3 files changed, 22 insertions, 9 deletions
diff --git a/ports/lua/CMakeLists.txt b/ports/lua/CMakeLists.txt
index 01a1d5a12..dd0a1de35 100644
--- a/ports/lua/CMakeLists.txt
+++ b/ports/lua/CMakeLists.txt
@@ -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 )
diff --git a/ports/lua/CONTROL b/ports/lua/CONTROL
index 738aabdfd..eeb26e412 100644
--- a/ports/lua/CONTROL
+++ b/ports/lua/CONTROL
@@ -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. \ No newline at end of file
diff --git a/ports/lua/portfile.cmake b/ports/lua/portfile.cmake
index e3c972ac4..b107c6cf9 100644
--- a/ports/lua/portfile.cmake
+++ b/ports/lua/portfile.cmake
@@ -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)