Fixed compile issues
This commit is contained in:
parent
8040ba5b95
commit
89f97ea878
|
@ -24,6 +24,7 @@ if (lua_ADDED)
|
||||||
|
|
||||||
FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c)
|
FILE(GLOB lua_sources ${lua_SOURCE_DIR}/*.c)
|
||||||
add_library(lua STATIC ${lua_sources})
|
add_library(lua STATIC ${lua_sources})
|
||||||
|
set_source_files_properties(${lua_sources} PROPERTIES LANGUAGE CXX)
|
||||||
|
|
||||||
target_include_directories(lua
|
target_include_directories(lua
|
||||||
PUBLIC
|
PUBLIC
|
||||||
|
@ -42,6 +43,7 @@ if (sol2_ADDED)
|
||||||
add_library(sol2 INTERFACE IMPORTED)
|
add_library(sol2 INTERFACE IMPORTED)
|
||||||
target_include_directories(sol2 INTERFACE ${sol2_SOURCE_DIR}/single/include)
|
target_include_directories(sol2 INTERFACE ${sol2_SOURCE_DIR}/single/include)
|
||||||
target_link_libraries(sol2 INTERFACE lua)
|
target_link_libraries(sol2 INTERFACE lua)
|
||||||
|
target_compile_definitions(sol2 INTERFACE SOL_USING_CXX_LUA=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
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->")
|
target_compile_options(${PROJECT_NAME} PUBLIC "$<$<BOOL:${MSVC}>:/permissive->")
|
||||||
|
|
||||||
# Link dependencies (if required)
|
# 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
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
CXX_STANDARD 20
|
CXX_STANDARD 20
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include "sol/sol.hpp"
|
#include "sol/sol.hpp"
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,8 @@ namespace ecs::lua {
|
||||||
wrapper->table = lua.create_table();
|
wrapper->table = lua.create_table();
|
||||||
|
|
||||||
for (auto [key, type] : map) {
|
for (auto [key, type] : map) {
|
||||||
wrapper->table[key] = table[key];
|
auto temp = table[key];
|
||||||
|
wrapper->table[key] = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_pair(id, wrapper);
|
return std::make_pair(id, wrapper);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
#pragma once
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#pragma once
|
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
|
||||||
#include "io/write.h"
|
#include "io/write.h"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#include "ecs-serial.h"
|
#include "ecs-serial.h"
|
||||||
|
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
#include <bits/stdint-uintn.h>
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
|
@ -27,10 +27,35 @@ if (stduuid_ADDED)
|
||||||
find_library(CFLIB CoreFoundation)
|
find_library(CFLIB CoreFoundation)
|
||||||
target_link_libraries(stduuid INTERFACE ${CFLIB})
|
target_link_libraries(stduuid INTERFACE ${CFLIB})
|
||||||
else()
|
else()
|
||||||
find_library(LIBUUID_LIBRARIES uuid)
|
FIND_PATH(LIBUUID_INCLUDE_DIRS uuid/uuid.h)
|
||||||
|
FIND_LIBRARY(LIBUUID_LIBRARIES uuid)
|
||||||
|
|
||||||
|
IF (LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS)
|
||||||
|
SET(LIBUUID_FOUND 1)
|
||||||
|
IF (NOT LibUuid_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found libuuid: ${LIBUUID_LIBRARIES}")
|
||||||
|
ENDIF ( NOT LibUuid_FIND_QUIETLY )
|
||||||
|
ELSE (LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS)
|
||||||
|
IF (LibUuid_FIND_REQUIRED)
|
||||||
|
MESSAGE(SEND_ERROR "Could NOT find libuuid")
|
||||||
|
ELSE (LibUuid_FIND_REQUIRED)
|
||||||
|
IF (NOT LIBUUID_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Could NOT find libuuid")
|
||||||
|
ENDIF (NOT LIBUUID_FIND_QUIETLY)
|
||||||
|
ENDIF (LibUuid_FIND_REQUIRED)
|
||||||
|
ENDIF (LIBUUID_LIBRARIES AND LIBUUID_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(LIBUUID_LIBRARIES LIBUUID_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
message("${LIBUUID_LIBRARIES}")
|
||||||
|
message("${LIBUUID_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
if (LIBUUID_FOUND)
|
||||||
|
target_include_directories(stduuid INTERFACE ${LIBUUID_INCLUDE_DIRS})
|
||||||
target_link_libraries(stduuid INTERFACE ${LIBUUID_LIBRARIES})
|
target_link_libraries(stduuid INTERFACE ${LIBUUID_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
file(GLOB_RECURSE headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#define UUID_SYSTEM_GENERATOR
|
||||||
#include "uuid.h"
|
#include "uuid.h"
|
||||||
|
|
||||||
namespace ecs {
|
namespace ecs {
|
||||||
|
|
|
@ -72,7 +72,7 @@ def main(argv):
|
||||||
output = argv[2]
|
output = argv[2]
|
||||||
|
|
||||||
index = clang.cindex.Index.create()
|
index = clang.cindex.Index.create()
|
||||||
tu = index.parse(filename, ['-x', 'c++', '-std=c++2a', f'-Iecs/include', f'-Ibuild/_deps/stduuid-src/include', '-I/lib/gcc/x86_64-pc-linux-gnu/10.1.0/include'])
|
tu = index.parse(filename, ['-x', 'c++', '-std=c++20', f'-Iecs/include', f'-Ibuild/_deps/stduuid-src/include', '-I/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include'])
|
||||||
|
|
||||||
components = build_components(tu.cursor, filename)
|
components = build_components(tu.cursor, filename)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <string>
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
|
||||||
struct Position : ecs::Component {
|
struct Position : ecs::Component {
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
#include "ecs-lua.h"
|
#include "ecs-lua.h"
|
||||||
#include "ecs-serial.h"
|
#include "ecs-serial.h"
|
||||||
|
|
||||||
#include <bits/stdint-intn.h>
|
|
||||||
#include <bits/stdint-uintn.h>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -145,6 +143,9 @@ int main(int argc, const char** argv) {
|
||||||
|
|
||||||
// Load entities from disk as a test
|
// Load entities from disk as a test
|
||||||
std::ifstream file("entities", std::ios::in);
|
std::ifstream file("entities", std::ios::in);
|
||||||
|
if (!file.is_open()) {
|
||||||
|
std::cerr << "Failed to open: 'entities'!\n";
|
||||||
|
}
|
||||||
|
|
||||||
ecs::serial::deserialize_ids(file);
|
ecs::serial::deserialize_ids(file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user