Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

Commit 068edf3

Browse files
committed
Added LUA_PATH entry. On Windows added wlua. Closes #50. Closes #51
1 parent fa0a457 commit 068edf3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ else ()
3636
set ( LUA_DIR ${CMAKE_INSTALL_PREFIX} CACHE STRING "Destination from which modules will be resolved. See INSTALL_LMOD and INSTALL_CMOD.")
3737
endif ()
3838

39-
set ( LUA_PATH_DEFAULT "./?.lua;${LUA_DIR}${LUA_LDIR}/?.lua;${LUA_DIR}${LUA_LDIR}/?/init.lua" )
39+
set ( LUA_PATH_DEFAULT "./?.lua;${LUA_DIR}${LUA_LDIR}/?.lua;${LUA_DIR}${LUA_LDIR}/?/init.lua;./?/init.lua" )
4040
set ( LUA_CPATH_DEFAULT "./?${LUA_MODULE_SUFFIX};${LUA_DIR}${LUA_CDIR}/?${LUA_MODULE_SUFFIX};${LUA_DIR}${LUA_CDIR}/loadall${LUA_MODULE_SUFFIX}" )
4141

4242
if ( WIN32 AND NOT CYGWIN )
4343
# Windows systems
4444
option ( LUA_WIN "Windows specific build." ON )
45+
option ( LUA_BUILD_WLUA "Build wLua interpretter without console output." ON)
4546
option ( LUA_BUILD_AS_DLL "Build Lua library as Dll." ON )
4647
# Paths (Double escapes needed)
4748
set ( LUA_DIRSEP "\\\\" )
@@ -135,6 +136,13 @@ target_link_libraries ( liblua_static ${LIBS} )
135136
add_executable ( lua ${SRC_LUA} ${LUA_RC} )
136137
target_link_libraries ( lua liblua )
137138

139+
# On windows a variant of the lua interpreter without console output needs to be built
140+
if(LUA_BUILD_WLUA)
141+
add_executable ( wlua WIN32 ${SRC_LUA} ${LUA_RC} )
142+
target_link_libraries ( wlua liblua )
143+
install_executable ( wlua )
144+
endif()
145+
138146
add_executable ( luac ${SRC_LUAC} ${LUAC_RC} )
139147
target_link_libraries ( luac liblua_static )
140148

0 commit comments

Comments
 (0)