diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f44a2bf98..23834fa83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: - name: Setup run: | sudo apt-get update - sudo apt-get install cmake debhelper devscripts build-essential lintian libsdl2-dev libuv1-dev libsdl2-mixer-dev postgresql-server-dev-all libpq-dev libenet-dev opencl-c-headers wayland-protocols pkg-config uuid-dev python3 + sudo apt-get install cmake debhelper devscripts build-essential lintian libsdl2-dev libuv1-dev libsdl2-mixer-dev postgresql-server-dev-all libpq-dev libenet-dev opencl-c-headers wayland-protocols pkg-config uuid-dev python3 flatbuffers-compiler - name: Ubuntu run: | @@ -107,7 +107,7 @@ jobs: - name: Setup run: | sudo apt-get update - sudo apt-get install libsdl2-dev postgresql-server-dev-all libpq-dev libenet-dev opencl-c-headers wayland-protocols pkg-config uuid-dev ninja-build python3 + sudo apt-get install libsdl2-dev postgresql-server-dev-all libpq-dev libenet-dev opencl-c-headers wayland-protocols pkg-config uuid-dev ninja-build python3 flatbuffers-compiler - name: Linux run: | diff --git a/cmake/Findflatbuffers.cmake b/cmake/Findflatbuffers.cmake index d3ca1d673..edb32bd90 100644 --- a/cmake/Findflatbuffers.cmake +++ b/cmake/Findflatbuffers.cmake @@ -1,2 +1,2 @@ include("${ROOT_DIR}/cmake/macros.cmake") -engine_find_header_only(flatbuffers flatbuffers.h "" "" "") +engine_find_header_only(flatbuffers flatbuffers.h flatbuffers "") diff --git a/cmake/Findglm.cmake b/cmake/Findglm.cmake index 726211dc7..08a03665f 100644 --- a/cmake/Findglm.cmake +++ b/cmake/Findglm.cmake @@ -1,3 +1,3 @@ #We need 0.9.8 include("${ROOT_DIR}/cmake/macros.cmake") -engine_find_header_only(glm detail/type_mat.hpp glm "" "") +engine_find_header_only(glm detail/type_mat.hpp glm "") diff --git a/contrib/libs/flatbuffers/CMakeLists.txt b/contrib/libs/flatbuffers/CMakeLists.txt index 693d878b5..7adf37cce 100644 --- a/contrib/libs/flatbuffers/CMakeLists.txt +++ b/contrib/libs/flatbuffers/CMakeLists.txt @@ -14,45 +14,52 @@ engine_add_library( if (NOT FLATBUFFERS_FOUND) target_include_directories(flatbuffers PUBLIC .) endif() -set(COMPILER_SRCS - compiler/src/compiler/cpp_generator.cc - compiler/src/compiler/cpp_generator.h - compiler/src/compiler/go_generator.cc - compiler/src/compiler/go_generator.h - compiler/src/compiler/java_generator.cc - compiler/src/compiler/java_generator.h - compiler/src/compiler/swift_generator.cc - compiler/src/compiler/swift_generator.h - compiler/src/compiler/python_generator.cc - compiler/src/compiler/python_generator.h - compiler/src/compiler/ts_generator.cc - compiler/src/compiler/ts_generator.h - compiler/bfbs_gen_lua.cpp - compiler/code_generators.cpp - compiler/flatc.cpp - compiler/flatc_main.cpp - compiler/idl_gen_cpp.cpp - compiler/idl_gen_dart.cpp - compiler/idl_gen_fbs.cpp - compiler/idl_gen_csharp.cpp - compiler/idl_gen_java.cpp - compiler/idl_gen_go.cpp - compiler/idl_gen_grpc.cpp - compiler/idl_gen_json_schema.cpp - compiler/idl_gen_kotlin.cpp - compiler/idl_gen_lobster.cpp - compiler/idl_gen_lua.cpp - compiler/idl_gen_php.cpp - compiler/idl_gen_python.cpp - compiler/idl_gen_rust.cpp - compiler/idl_gen_swift.cpp - compiler/idl_gen_text.cpp - compiler/idl_gen_ts.cpp - compiler/idl_parser.cpp - compiler/reflection.cpp - compiler/util.cpp -) -engine_add_build_executable(TARGET flatc SRCS ${COMPILER_SRCS} NOINSTALL) -set_target_properties(flatc PROPERTIES UNITY_BUILD FALSE) -target_link_libraries(flatc flatbuffers) -target_include_directories(flatc PRIVATE compiler/) + +find_program(FLATC_EXECUTABLE NAMES flatc) +if (FLATC_EXECUTABLE) + add_executable(flatc IMPORTED GLOBAL) + set_property(TARGET flatc PROPERTY IMPORTED_LOCATION ${FLATC_EXECUTABLE}) +else() + set(COMPILER_SRCS + compiler/src/compiler/cpp_generator.cc + compiler/src/compiler/cpp_generator.h + compiler/src/compiler/go_generator.cc + compiler/src/compiler/go_generator.h + compiler/src/compiler/java_generator.cc + compiler/src/compiler/java_generator.h + compiler/src/compiler/swift_generator.cc + compiler/src/compiler/swift_generator.h + compiler/src/compiler/python_generator.cc + compiler/src/compiler/python_generator.h + compiler/src/compiler/ts_generator.cc + compiler/src/compiler/ts_generator.h + compiler/bfbs_gen_lua.cpp + compiler/code_generators.cpp + compiler/flatc.cpp + compiler/flatc_main.cpp + compiler/idl_gen_cpp.cpp + compiler/idl_gen_dart.cpp + compiler/idl_gen_fbs.cpp + compiler/idl_gen_csharp.cpp + compiler/idl_gen_java.cpp + compiler/idl_gen_go.cpp + compiler/idl_gen_grpc.cpp + compiler/idl_gen_json_schema.cpp + compiler/idl_gen_kotlin.cpp + compiler/idl_gen_lobster.cpp + compiler/idl_gen_lua.cpp + compiler/idl_gen_php.cpp + compiler/idl_gen_python.cpp + compiler/idl_gen_rust.cpp + compiler/idl_gen_swift.cpp + compiler/idl_gen_text.cpp + compiler/idl_gen_ts.cpp + compiler/idl_parser.cpp + compiler/reflection.cpp + compiler/util.cpp + ) + engine_add_build_executable(TARGET flatc SRCS ${COMPILER_SRCS} NOINSTALL) + set_target_properties(flatc PROPERTIES UNITY_BUILD FALSE) + target_link_libraries(flatc flatbuffers) + target_include_directories(flatc PRIVATE compiler/) +endif() diff --git a/debian/control b/debian/control index 68e25f2ee..dea3b64b6 100644 --- a/debian/control +++ b/debian/control @@ -14,6 +14,7 @@ Build-Depends: wayland-protocols, pkg-config, uuid-dev, + libflatbuffers-dev, libsdl2-mixer-dev Standards-Version: 4.1.4 Homepage: https://github.com/mgerhardy/vengi