From 79f7f1d89a38c8e207be1278f0dd732991c72fce Mon Sep 17 00:00:00 2001 From: Dmitry Sovetov Date: Wed, 1 Feb 2017 15:01:04 +0200 Subject: [PATCH 1/2] ~ --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b35d92b2..2d4faa2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ option ( LUA_USE_RELATIVE_LOADLIB "Use modified loadlib.c with support for relat option ( LUA_COMPAT_5_1 "Enable backwards compatibility options with lua-5.1." ON ) option ( LUA_COMPAT_5_2 "Enable backwards compatibility options with lua-5.2." ON ) +option ( LUA_BUILD_EXECUTABLES "Enable Lua compiled and command prompt" ${BUILD_EXECUTABLES} ) #2DO: LUAI_* and LUAL_* settings, for now defaults are used. set ( LUA_DIRSEP "/" ) @@ -118,11 +119,13 @@ if ( LUA_BUILD_AS_DLL ) set_target_properties ( liblua PROPERTIES COMPILE_DEFINITIONS LUA_BUILD_AS_DLL ) endif () -add_executable ( lua ${SRC_LUA} src/lua.rc ) -target_link_libraries ( lua liblua ) +if (LUA_BUILD_EXECUTABLES) + add_executable ( lua ${SRC_LUA} src/lua.rc ) + target_link_libraries ( lua liblua ) -add_executable ( luac ${SRC_CORE} ${SRC_LIB} ${SRC_LUAC} src/luac.rc ) -target_link_libraries ( luac ${LIBS} ) + add_executable ( luac ${SRC_CORE} ${SRC_LIB} ${SRC_LUAC} src/luac.rc ) + target_link_libraries ( luac ${LIBS} ) +endif ( ) # On windows a variant of the lua interpreter without console output needs to be built if ( LUA_BUILD_WLUA ) @@ -131,7 +134,9 @@ if ( LUA_BUILD_WLUA ) install_executable ( wlua ) endif ( ) -install_executable ( lua luac ) +if (LUA_BUILD_EXECUTABLES) + install_executable ( lua luac ) +endif ( ) install_library ( liblua ) install_data ( README.md ) #install_lua_module ( strict etc/strict.lua ) From e68971689b24ac62ec542c72a05227b702540e00 Mon Sep 17 00:00:00 2001 From: Dmitry Sovetov Date: Wed, 1 Feb 2017 15:02:16 +0200 Subject: [PATCH 2/2] Added: LUA_BUILD_EXECUTABLES option to make it possible to skip Lua compiler and command prompt from build process (e.g. iOS or Android builds) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d4faa2d..3dfa07d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,7 @@ if ( LUA_BUILD_AS_DLL ) set_target_properties ( liblua PROPERTIES COMPILE_DEFINITIONS LUA_BUILD_AS_DLL ) endif () -if (LUA_BUILD_EXECUTABLES) +if ( LUA_BUILD_EXECUTABLES ) add_executable ( lua ${SRC_LUA} src/lua.rc ) target_link_libraries ( lua liblua )