mirror of
https://github.com/love2d/megasource.git
synced 2026-08-28 17:13:41 +02:00
Include Lua51 in main CMakeLists.txt.
This commit is contained in:
+3
-1
@@ -9,6 +9,7 @@ project(ldep)
|
||||
|
||||
set(DEP_ZLIB_VER "1.2.8")
|
||||
set(DEP_PHYSFS_VER "2.0.3")
|
||||
set(DEP_LUA51_VER "5.1.5")
|
||||
|
||||
set(ZLIB_FOUND TRUE)
|
||||
set(ZLIB_LIBRARY zlibstatic)
|
||||
@@ -16,6 +17,7 @@ set(ZLIB_INCLUDE_DIR .)
|
||||
|
||||
add_subdirectory("libs/zlib-${DEP_ZLIB_VER}" ${CMAKE_BINARY_DIR}/zlib)
|
||||
add_subdirectory("libs/physfs-${DEP_PHYSFS_VER}" ${CMAKE_BINARY_DIR}/physfs)
|
||||
add_subdirectory("libs/lua-${DEP_LUA51_VER}" ${CMAKE_BINARY_DIR}/lua51)
|
||||
|
||||
add_executable(ldeptest src/test.cpp)
|
||||
target_link_libraries(ldeptest zlibstatic physfs-static)
|
||||
target_link_libraries(ldeptest zlibstatic physfs-static lua51-static)
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <zlib.h>
|
||||
#include <physfs.h>
|
||||
|
||||
extern "C" {
|
||||
# include "lua.h"
|
||||
}
|
||||
|
||||
typedef std::stringstream strs;
|
||||
typedef std::function<std::string (strs &, strs &)> vfunc;
|
||||
|
||||
@@ -40,9 +44,21 @@ int main(int argc, const char **argv)
|
||||
return "PhysicsFS";
|
||||
};
|
||||
|
||||
vfunc lua = [](strs &c, strs &l)
|
||||
{
|
||||
std::string compiled = LUA_RELEASE;
|
||||
|
||||
compiled = compiled.substr(4);
|
||||
|
||||
c << compiled;
|
||||
l << "N/A";
|
||||
return "Lua";
|
||||
};
|
||||
|
||||
std::vector<vfunc> funcs;
|
||||
funcs.push_back(zlib);
|
||||
funcs.push_back(physfs);
|
||||
funcs.push_back(lua);
|
||||
|
||||
for (size_t i = 0; i < funcs.size(); ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user