aboutsummaryrefslogtreecommitdiff
path: root/ports/lua
diff options
context:
space:
mode:
Diffstat (limited to 'ports/lua')
-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)