Fixed compile issues
This commit is contained in:
@@ -24,6 +24,7 @@ if (lua_ADDED)
|
||||
|
||||
FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c)
|
||||
add_library(lua STATIC ${lua_sources})
|
||||
set_source_files_properties(${lua_sources} PROPERTIES LANGUAGE CXX)
|
||||
|
||||
target_include_directories(lua
|
||||
PUBLIC
|
||||
@@ -42,6 +43,7 @@ if (sol2_ADDED)
|
||||
add_library(sol2 INTERFACE IMPORTED)
|
||||
target_include_directories(sol2 INTERFACE ${sol2_SOURCE_DIR}/single/include)
|
||||
target_link_libraries(sol2 INTERFACE lua)
|
||||
target_compile_definitions(sol2 INTERFACE SOL_USING_CXX_LUA=1)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
||||
@@ -53,7 +55,7 @@ add_library(${PROJECT_NAME} ${headers} ${sources})
|
||||
target_compile_options(${PROJECT_NAME} PUBLIC "$<$<BOOL:${MSVC}>:/permissive->")
|
||||
|
||||
# Link dependencies (if required)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ecs ecs-serial lua sol2)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ecs ecs-serial sol2)
|
||||
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include "sol/sol.hpp"
|
||||
#include "ecs.h"
|
||||
|
||||
|
||||
@@ -205,7 +205,8 @@ namespace ecs::lua {
|
||||
wrapper->table = lua.create_table();
|
||||
|
||||
for (auto [key, type] : map) {
|
||||
wrapper->table[key] = table[key];
|
||||
auto temp = table[key];
|
||||
wrapper->table[key] = temp;
|
||||
}
|
||||
|
||||
return std::make_pair(id, wrapper);
|
||||
|
||||
Reference in New Issue
Block a user