diff --git a/bootstrap/src/build_buildcc.cpp b/bootstrap/src/build_buildcc.cpp index fd538a3b..33b1066b 100644 --- a/bootstrap/src/build_buildcc.cpp +++ b/bootstrap/src/build_buildcc.cpp @@ -53,6 +53,13 @@ void buildcc_cb(BaseTarget &target, const BaseGenerator &schema_gen, target.AddIncludeDir("lib/env/include"); target.GlobHeaders("lib/env/include/env"); + // SCHEMA + target.GlobSources("schema/src"); + target.AddIncludeDir("schema/include"); + target.GlobHeaders("schema/include/schema"); + target.GlobHeaders("schema/include/schema/interface"); + target.GlobHeaders("schema/include/schema/private"); + // TOOLCHAIN target.GlobSources("lib/toolchain/src/api"); target.AddIncludeDir("lib/toolchain/include"); @@ -72,8 +79,6 @@ void buildcc_cb(BaseTarget &target, const BaseGenerator &schema_gen, target.GlobHeaders("lib/target/include/target/common"); target.GlobHeaders("lib/target/include/target/friend"); target.GlobHeaders("lib/target/include/target/interface"); - target.GlobHeaders("lib/target/include/target/private"); - target.GlobHeaders("lib/target/include/target/serialization"); // ARGS target.GlobSources("lib/args/src"); diff --git a/buildcc/CMakeLists.txt b/buildcc/CMakeLists.txt index 860404be..f4d5d628 100644 --- a/buildcc/CMakeLists.txt +++ b/buildcc/CMakeLists.txt @@ -2,9 +2,6 @@ set(BUILDCC_INSTALL_LIB_PREFIX "lib/cmake") set(BUILDCC_INSTALL_HEADER_PREFIX "include/buildcc") -# Flatbuffers schema -add_subdirectory(schema) - if(${BUILDCC_BUILD_AS_SINGLE_LIB}) add_library(buildcc STATIC buildcc.h @@ -31,6 +28,9 @@ if(${BUILDCC_BUILD_AS_SINGLE_LIB}) endif() endif() +# Flatbuffers schema +add_subdirectory(schema) + # Environment add_subdirectory(lib/env) diff --git a/buildcc/lib/target/cmake/common_target_src.cmake b/buildcc/lib/target/cmake/common_target_src.cmake index 88ec2a02..875e5edf 100644 --- a/buildcc/lib/target/cmake/common_target_src.cmake +++ b/buildcc/lib/target/cmake/common_target_src.cmake @@ -1,22 +1,18 @@ set(COMMON_TARGET_SRCS # Interfaces include/target/interface/builder_interface.h - include/target/interface/serialization_interface.h # Common src/common/target_config.cpp src/common/target_state.cpp - include/target/common/target_file_ext.h include/target/common/target_config.h include/target/common/target_state.h + include/target/common/target_file_ext.h include/target/common/target_env.h - include/target/common/target_type.h src/common/util.cpp include/target/common/util.h - include/target/common/path.h - # API src/api/source_api.cpp src/api/include_api.cpp @@ -39,10 +35,6 @@ set(COMMON_TARGET_SRCS include/target/api/target_info_getter.h include/target/api/target_getter.h - # Base Generator - src/generator/generator_serialization.cpp - include/target/serialization/generator_serialization.h - # Generator src/generator/generator.cpp include/target/generator.h @@ -55,10 +47,6 @@ set(COMMON_TARGET_SRCS include/target/friend/compile_object.h include/target/friend/link_target.h - # Base Target - src/target/target_serialization.cpp - include/target/serialization/target_serialization.h - # Target src/target/target.cpp src/target/build.cpp diff --git a/buildcc/lib/target/cmake/mock_target.cmake b/buildcc/lib/target/cmake/mock_target.cmake index 367fc0ac..da18b626 100644 --- a/buildcc/lib/target/cmake/mock_target.cmake +++ b/buildcc/lib/target/cmake/mock_target.cmake @@ -14,15 +14,14 @@ add_library(mock_target STATIC target_include_directories(mock_target PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/mock - ${SCHEMA_BUILD_DIR} ) target_compile_options(mock_target PUBLIC ${TEST_COMPILE_FLAGS} ${BUILD_COMPILE_FLAGS}) target_link_options(mock_target PUBLIC ${TEST_LINK_FLAGS} ${BUILD_LINK_FLAGS}) target_link_libraries(mock_target PUBLIC - flatbuffers_header_only Taskflow + mock_schema mock_toolchain CppUTest @@ -36,5 +35,3 @@ if (${MINGW}) message(WARNING "-Wl,--allow-multiple-definition for MINGW") target_link_options(mock_target PUBLIC -Wl,--allow-multiple-definition) endif() - -add_dependencies(mock_target fbs_to_header) diff --git a/buildcc/lib/target/cmake/target.cmake b/buildcc/lib/target/cmake/target.cmake index c67dd500..fdb0cd8d 100644 --- a/buildcc/lib/target/cmake/target.cmake +++ b/buildcc/lib/target/cmake/target.cmake @@ -16,10 +16,6 @@ if(${BUILDCC_BUILD_AS_SINGLE_LIB}) $ $ ) - target_include_directories(buildcc PRIVATE - ${SCHEMA_BUILD_DIR} - ) - add_dependencies(buildcc fbs_to_header) endif() if(${BUILDCC_BUILD_AS_INTERFACE}) @@ -32,15 +28,10 @@ if(${BUILDCC_BUILD_AS_INTERFACE}) $ ) target_link_libraries(target PUBLIC + schema toolchain - flatbuffers_header_only Taskflow ) - - target_include_directories(target PRIVATE - ${SCHEMA_BUILD_DIR} - ) target_compile_options(target PRIVATE ${BUILD_COMPILE_FLAGS}) target_link_options(target PRIVATE ${BUILD_LINK_FLAGS}) - add_dependencies(target fbs_to_header) endif() diff --git a/buildcc/lib/target/include/target/api/target_getter.h b/buildcc/lib/target/include/target/api/target_getter.h index b9230c81..fc1da53f 100644 --- a/buildcc/lib/target/include/target/api/target_getter.h +++ b/buildcc/lib/target/include/target/api/target_getter.h @@ -20,7 +20,7 @@ #include #include -#include "target/common/target_type.h" +#include "schema/target_type.h" #include "toolchain/toolchain.h" diff --git a/buildcc/lib/target/include/target/api/target_info_getter.h b/buildcc/lib/target/include/target/api/target_info_getter.h index 7c6f191c..bf912122 100644 --- a/buildcc/lib/target/include/target/api/target_info_getter.h +++ b/buildcc/lib/target/include/target/api/target_info_getter.h @@ -17,7 +17,7 @@ #ifndef TARGET_API_TARGET_INFO_GETTER_H_ #define TARGET_API_TARGET_INFO_GETTER_H_ -#include "target/common/path.h" +#include "schema/path.h" #include "target/common/target_config.h" #include "target/common/target_state.h" diff --git a/buildcc/lib/target/include/target/common/util.h b/buildcc/lib/target/include/target/common/util.h index c95f7daa..683216ad 100644 --- a/buildcc/lib/target/include/target/common/util.h +++ b/buildcc/lib/target/include/target/common/util.h @@ -20,7 +20,7 @@ #include #include -#include "target/common/path.h" +#include "schema/path.h" namespace buildcc::internal { diff --git a/buildcc/lib/target/include/target/friend/compile_object.h b/buildcc/lib/target/include/target/friend/compile_object.h index f99c154e..1cbfbc9f 100644 --- a/buildcc/lib/target/include/target/friend/compile_object.h +++ b/buildcc/lib/target/include/target/friend/compile_object.h @@ -19,7 +19,7 @@ #include -#include "target/common/path.h" +#include "schema/path.h" #include "taskflow/core/task.hpp" #include "taskflow/taskflow.hpp" diff --git a/buildcc/lib/target/include/target/generator.h b/buildcc/lib/target/include/target/generator.h index 2e8b22f2..fe013450 100644 --- a/buildcc/lib/target/include/target/generator.h +++ b/buildcc/lib/target/include/target/generator.h @@ -32,9 +32,9 @@ #include "target/interface/builder_interface.h" -#include "target/serialization/generator_serialization.h" +#include "schema/generator_serialization.h" +#include "schema/path.h" -#include "target/common/path.h" #include "target/common/target_env.h" namespace buildcc { diff --git a/buildcc/lib/target/include/target/interface/builder_interface.h b/buildcc/lib/target/include/target/interface/builder_interface.h index cf2b7be8..ae044274 100644 --- a/buildcc/lib/target/include/target/interface/builder_interface.h +++ b/buildcc/lib/target/include/target/interface/builder_interface.h @@ -23,7 +23,6 @@ #include "env/assert_fatal.h" -#include "target/common/path.h" #include "target/common/util.h" namespace buildcc::internal { diff --git a/buildcc/lib/target/include/target/target.h b/buildcc/lib/target/include/target/target.h index f70ed25b..4a75c230 100644 --- a/buildcc/lib/target/include/target/target.h +++ b/buildcc/lib/target/include/target/target.h @@ -35,7 +35,7 @@ #include "target/target_info.h" // Common -#include "target/common/target_type.h" +#include "schema/target_type.h" // Friend #include "target/friend/compile_object.h" @@ -43,8 +43,8 @@ #include "target/friend/link_target.h" // Internal -#include "target/common/path.h" -#include "target/serialization/target_serialization.h" +#include "schema/path.h" +#include "schema/target_serialization.h" // Env #include "env/env.h" diff --git a/buildcc/lib/target/include/target/target_info.h b/buildcc/lib/target/include/target/target_info.h index 4250e85c..aa3c22ca 100644 --- a/buildcc/lib/target/include/target/target_info.h +++ b/buildcc/lib/target/include/target/target_info.h @@ -32,7 +32,7 @@ #include "target/api/sync_api.h" #include "target/api/target_info_getter.h" -#include "target/serialization/target_serialization.h" +#include "schema/target_serialization.h" namespace buildcc { diff --git a/buildcc/lib/target/src/common/target_config.cpp b/buildcc/lib/target/src/common/target_config.cpp index 2b67f290..3f7b5135 100644 --- a/buildcc/lib/target/src/common/target_config.cpp +++ b/buildcc/lib/target/src/common/target_config.cpp @@ -18,7 +18,7 @@ #include "env/assert_fatal.h" -#include "target/common/path.h" +#include "schema/path.h" #include "fmt/format.h" diff --git a/buildcc/lib/target/src/target/friend/compile_pch.cpp b/buildcc/lib/target/src/target/friend/compile_pch.cpp index 115138ab..971f36f1 100644 --- a/buildcc/lib/target/src/target/friend/compile_pch.cpp +++ b/buildcc/lib/target/src/target/friend/compile_pch.cpp @@ -16,7 +16,7 @@ #include "target/friend/compile_pch.h" -#include "target/common/path.h" +#include "schema/path.h" #include "target/target.h" #include "env/util.h" diff --git a/buildcc/lib/target/test/path/CMakeLists.txt b/buildcc/lib/target/test/path/CMakeLists.txt index 1b5103ce..c6c9de0f 100644 --- a/buildcc/lib/target/test/path/CMakeLists.txt +++ b/buildcc/lib/target/test/path/CMakeLists.txt @@ -10,7 +10,9 @@ target_include_directories(${TEST_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/generated ) target_link_libraries(${TEST_NAME} PRIVATE - mock_env + mock_env + mock_schema + CppUTest CppUTestExt gcov diff --git a/buildcc/lib/target/test/path/test_path.cpp b/buildcc/lib/target/test/path/test_path.cpp index dff2ec52..19337a30 100644 --- a/buildcc/lib/target/test/path/test_path.cpp +++ b/buildcc/lib/target/test/path/test_path.cpp @@ -1,5 +1,5 @@ // Internal -#include "target/common/path.h" +#include "schema/path.h" #include "env/assert_fatal.h" diff --git a/buildcc/lib/target/test/target/test_builder_interface.cpp b/buildcc/lib/target/test/target/test_builder_interface.cpp index 84c14749..9cc2d2ac 100644 --- a/buildcc/lib/target/test/target/test_builder_interface.cpp +++ b/buildcc/lib/target/test/target/test_builder_interface.cpp @@ -1,6 +1,6 @@ #include "target/interface/builder_interface.h" -#include "target/common/path.h" +#include "schema/path.h" // NOTE, Make sure all these includes are AFTER the system and header includes #include "CppUTest/CommandLineTestRunner.h" diff --git a/buildcc/lib/target/test/target/test_serialization_interface.cpp b/buildcc/lib/target/test/target/test_serialization_interface.cpp index b5083059..e95db8d1 100644 --- a/buildcc/lib/target/test/target/test_serialization_interface.cpp +++ b/buildcc/lib/target/test/target/test_serialization_interface.cpp @@ -1,4 +1,4 @@ -#include "target/interface/serialization_interface.h" +#include "schema/interface/serialization_interface.h" // NOTE, Make sure all these includes are AFTER the system and header includes #include "CppUTest/CommandLineTestRunner.h" diff --git a/buildcc/lib/target/test/target/test_target_external_lib.cpp b/buildcc/lib/target/test/target/test_target_external_lib.cpp index 72e7dcdf..b081982d 100644 --- a/buildcc/lib/target/test/target/test_target_external_lib.cpp +++ b/buildcc/lib/target/test/target/test_target_external_lib.cpp @@ -7,7 +7,7 @@ #include "target/target.h" -#include "target/serialization/target_serialization.h" +#include "schema/target_serialization.h" #include #include diff --git a/buildcc/lib/target/test/target/test_target_flags.cpp b/buildcc/lib/target/test/target/test_target_flags.cpp index 21acef59..087dab6f 100644 --- a/buildcc/lib/target/test/target/test_target_flags.cpp +++ b/buildcc/lib/target/test/target/test_target_flags.cpp @@ -8,7 +8,7 @@ #include "env/env.h" // -#include "target/serialization/target_serialization.h" +#include "schema/target_serialization.h" // Third Party diff --git a/buildcc/lib/target/test/target/test_target_lib_dep.cpp b/buildcc/lib/target/test/target/test_target_lib_dep.cpp index f9ff8faf..5fc80122 100644 --- a/buildcc/lib/target/test/target/test_target_lib_dep.cpp +++ b/buildcc/lib/target/test/target/test_target_lib_dep.cpp @@ -9,7 +9,7 @@ #include "target/target.h" // -#include "target/serialization/target_serialization.h" +#include "schema/target_serialization.h" #include #include diff --git a/buildcc/plugins/src/buildcc_find.cpp b/buildcc/plugins/src/buildcc_find.cpp index 94e6aac9..97a6e1c1 100644 --- a/buildcc/plugins/src/buildcc_find.cpp +++ b/buildcc/plugins/src/buildcc_find.cpp @@ -23,7 +23,7 @@ #include "env/host_os_util.h" #include "env/logging.h" -#include "target/common/path.h" +#include "schema/path.h" namespace { constexpr const char *const kEnvVarNotFound = diff --git a/buildcc/schema/CMakeLists.txt b/buildcc/schema/CMakeLists.txt index cbbe4b23..6883e1a5 100644 --- a/buildcc/schema/CMakeLists.txt +++ b/buildcc/schema/CMakeLists.txt @@ -1,26 +1,2 @@ -# Generate files -set(SCHEMA_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated CACHE PATH "Generate path of flatbuffer schema") - -set(FBS_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/path.fbs - ${CMAKE_CURRENT_SOURCE_DIR}/generator.fbs - ${CMAKE_CURRENT_SOURCE_DIR}/target.fbs -) -set(FBS_GEN_FILES - ${SCHEMA_BUILD_DIR}/path_generated.h - ${SCHEMA_BUILD_DIR}/generator_generated.h - ${SCHEMA_BUILD_DIR}/target_generated.h -) -set(FBS_GEN_OPTIONS - -I ${CMAKE_CURRENT_SOURCE_DIR} - --gen-object-api -) - -add_custom_command(OUTPUT ${FBS_GEN_FILES} - COMMAND flatc -o ${SCHEMA_BUILD_DIR} ${FBS_GEN_OPTIONS} --cpp ${FBS_FILES} - DEPENDS flatc ${FBS_FILES} -) - -add_custom_target(fbs_to_header - DEPENDS ${FBS_GEN_FILES} -) +include(cmake/schema_generate.cmake) +include(cmake/schema.cmake) diff --git a/buildcc/schema/cmake/schema.cmake b/buildcc/schema/cmake/schema.cmake new file mode 100644 index 00000000..99d9949c --- /dev/null +++ b/buildcc/schema/cmake/schema.cmake @@ -0,0 +1,89 @@ +# schema test +if (${TESTING}) + add_library(mock_schema STATIC + src/generator_serialization.cpp + src/target_serialization.cpp + + include/schema/private/schema_util.h + include/schema/interface/serialization_interface.h + + include/schema/path.h + include/schema/generator_serialization.h + include/schema/target_serialization.h + ) + target_include_directories(mock_schema PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/mock/include + ${SCHEMA_BUILD_DIR} + ) + target_link_libraries(mock_schema PUBLIC + mock_env + flatbuffers_header_only + + CppUTest + CppUTestExt + gcov + ) + add_dependencies(mock_schema fbs_to_header) + + target_compile_options(mock_schema PUBLIC ${TEST_COMPILE_FLAGS} ${BUILD_COMPILE_FLAGS}) + target_link_options(mock_schema PUBLIC ${TEST_LINK_FLAGS} ${BUILD_LINK_FLAGS}) + + # Tests + add_dependencies(mock_schema fbs_to_header) +endif() + +set(SCHEMA_SRCS + src/generator_serialization.cpp + src/target_serialization.cpp + + include/schema/private/schema_util.h + include/schema/interface/serialization_interface.h + + include/schema/path.h + include/schema/generator_serialization.h + include/schema/target_serialization.h +) + +if(${BUILDCC_BUILD_AS_SINGLE_LIB}) + target_sources(buildcc PRIVATE + ${SCHEMA_SRCS} + ) + target_include_directories(buildcc PUBLIC + $ + $ + ) + target_include_directories(buildcc PRIVATE + ${SCHEMA_BUILD_DIR} + ) + add_dependencies(buildcc fbs_to_header) +endif() + +if(${BUILDCC_BUILD_AS_INTERFACE}) + m_clangtidy("schema") + add_library(schema + ${SCHEMA_SRCS} + ) + target_include_directories(schema PUBLIC + $ + $ + ) + target_include_directories(schema PRIVATE + ${SCHEMA_BUILD_DIR} + ) + target_compile_options(schema PRIVATE ${BUILD_COMPILE_FLAGS}) + target_link_options(schema PRIVATE ${BUILD_LINK_FLAGS}) + target_link_libraries(schema PRIVATE + flatbuffers_header_only + env + ) + add_dependencies(schema fbs_to_header) +endif() + +if (${BUILDCC_INSTALL}) + if (${BUILDCC_BUILD_AS_INTERFACE}) + install(TARGETS schema DESTINATION lib EXPORT schemaConfig) + install(EXPORT schemaConfig DESTINATION "${BUILDCC_INSTALL_LIB_PREFIX}/schema") + endif() + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION "${BUILDCC_INSTALL_HEADER_PREFIX}") +endif() diff --git a/buildcc/schema/cmake/schema_generate.cmake b/buildcc/schema/cmake/schema_generate.cmake new file mode 100644 index 00000000..cbbe4b23 --- /dev/null +++ b/buildcc/schema/cmake/schema_generate.cmake @@ -0,0 +1,26 @@ +# Generate files +set(SCHEMA_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated CACHE PATH "Generate path of flatbuffer schema") + +set(FBS_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/path.fbs + ${CMAKE_CURRENT_SOURCE_DIR}/generator.fbs + ${CMAKE_CURRENT_SOURCE_DIR}/target.fbs +) +set(FBS_GEN_FILES + ${SCHEMA_BUILD_DIR}/path_generated.h + ${SCHEMA_BUILD_DIR}/generator_generated.h + ${SCHEMA_BUILD_DIR}/target_generated.h +) +set(FBS_GEN_OPTIONS + -I ${CMAKE_CURRENT_SOURCE_DIR} + --gen-object-api +) + +add_custom_command(OUTPUT ${FBS_GEN_FILES} + COMMAND flatc -o ${SCHEMA_BUILD_DIR} ${FBS_GEN_OPTIONS} --cpp ${FBS_FILES} + DEPENDS flatc ${FBS_FILES} +) + +add_custom_target(fbs_to_header + DEPENDS ${FBS_GEN_FILES} +) diff --git a/buildcc/lib/target/include/target/serialization/generator_serialization.h b/buildcc/schema/include/schema/generator_serialization.h similarity index 88% rename from buildcc/lib/target/include/target/serialization/generator_serialization.h rename to buildcc/schema/include/schema/generator_serialization.h index dfe9553f..9ee77298 100644 --- a/buildcc/lib/target/include/target/serialization/generator_serialization.h +++ b/buildcc/schema/include/schema/generator_serialization.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef TARGET_SERIALIZATION_GENERATOR_SERIALIZATION_H_ -#define TARGET_SERIALIZATION_GENERATOR_SERIALIZATION_H_ - -#include "target/interface/serialization_interface.h" +#ifndef SCHEMA_GENERATOR_SERIALIZATION_H_ +#define SCHEMA_GENERATOR_SERIALIZATION_H_ #include #include #include -#include "target/common/path.h" +#include "schema/path.h" + +#include "schema/interface/serialization_interface.h" namespace buildcc::internal { diff --git a/buildcc/lib/target/include/target/interface/serialization_interface.h b/buildcc/schema/include/schema/interface/serialization_interface.h similarity index 93% rename from buildcc/lib/target/include/target/interface/serialization_interface.h rename to buildcc/schema/include/schema/interface/serialization_interface.h index 2e2ca654..df30f978 100644 --- a/buildcc/lib/target/include/target/interface/serialization_interface.h +++ b/buildcc/schema/include/schema/interface/serialization_interface.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef TARGET_INTERFACE_SERIALIZATION_INTERFACE_H_ -#define TARGET_INTERFACE_SERIALIZATION_INTERFACE_H_ +#ifndef SCHEMA_INTERFACE_SERIALIZATION_INTERFACE_H_ +#define SCHEMA_INTERFACE_SERIALIZATION_INTERFACE_H_ #include #include "env/assert_fatal.h" #include "env/util.h" -#include "target/common/path.h" +#include "schema/path.h" namespace fs = std::filesystem; diff --git a/buildcc/lib/target/include/target/common/path.h b/buildcc/schema/include/schema/path.h similarity index 98% rename from buildcc/lib/target/include/target/common/path.h rename to buildcc/schema/include/schema/path.h index ad4314f1..2ee2f3ae 100644 --- a/buildcc/lib/target/include/target/common/path.h +++ b/buildcc/schema/include/schema/path.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef TARGET_COMMON_PATH_H_ -#define TARGET_COMMON_PATH_H_ +#ifndef SCHEMA_PATH_H_ +#define SCHEMA_PATH_H_ #include #include diff --git a/buildcc/lib/target/include/target/private/schema_util.h b/buildcc/schema/include/schema/private/schema_util.h similarity index 97% rename from buildcc/lib/target/include/target/private/schema_util.h rename to buildcc/schema/include/schema/private/schema_util.h index b0ad689b..2684c2f5 100644 --- a/buildcc/lib/target/include/target/private/schema_util.h +++ b/buildcc/schema/include/schema/private/schema_util.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef TARGET_PRIVATE_SCHEMA_UTIL_H_ -#define TARGET_PRIVATE_SCHEMA_UTIL_H_ +#ifndef SCHEMA_PRIVATE_SCHEMA_UTIL_H_ +#define SCHEMA_PRIVATE_SCHEMA_UTIL_H_ #include "path_generated.h" #include -#include "target/common/path.h" +#include "schema/path.h" namespace fbs = schema::internal; diff --git a/buildcc/lib/target/include/target/serialization/target_serialization.h b/buildcc/schema/include/schema/target_serialization.h similarity index 91% rename from buildcc/lib/target/include/target/serialization/target_serialization.h rename to buildcc/schema/include/schema/target_serialization.h index c8e6b882..84914ffb 100644 --- a/buildcc/lib/target/include/target/serialization/target_serialization.h +++ b/buildcc/schema/include/schema/target_serialization.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef TARGET_SERIALIZATION_TARGET_SERIALIZATION_H_ -#define TARGET_SERIALIZATION_TARGET_SERIALIZATION_H_ - -#include "target/interface/serialization_interface.h" +#ifndef SCHEMA_TARGET_SERIALIZATION_H_ +#define SCHEMA_TARGET_SERIALIZATION_H_ #include -#include "target/common/path.h" -#include "target/common/target_type.h" +#include "schema/path.h" +#include "schema/target_type.h" + +#include "schema/interface/serialization_interface.h" namespace buildcc::internal { diff --git a/buildcc/lib/target/include/target/common/target_type.h b/buildcc/schema/include/schema/target_type.h similarity index 91% rename from buildcc/lib/target/include/target/common/target_type.h rename to buildcc/schema/include/schema/target_type.h index ff8d05a1..eb4632ab 100644 --- a/buildcc/lib/target/include/target/common/target_type.h +++ b/buildcc/schema/include/schema/target_type.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef TARGET_COMMON_TARGET_TYPE_H_ -#define TARGET_COMMON_TARGET_TYPE_H_ +#ifndef SCHEMA_TARGET_TYPE_H_ +#define SCHEMA_TARGET_TYPE_H_ namespace buildcc { diff --git a/buildcc/lib/target/src/generator/generator_serialization.cpp b/buildcc/schema/src/generator_serialization.cpp similarity index 95% rename from buildcc/lib/target/src/generator/generator_serialization.cpp rename to buildcc/schema/src/generator_serialization.cpp index 855aae04..cb4370f0 100644 --- a/buildcc/lib/target/src/generator/generator_serialization.cpp +++ b/buildcc/schema/src/generator_serialization.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "target/serialization/generator_serialization.h" +#include "schema/generator_serialization.h" // Third party #include "flatbuffers/flatbuffers.h" // Private -#include "target/private/schema_util.h" +#include "schema/private/schema_util.h" // Schema generated #include "generator_generated.h" diff --git a/buildcc/lib/target/src/target/target_serialization.cpp b/buildcc/schema/src/target_serialization.cpp similarity index 98% rename from buildcc/lib/target/src/target/target_serialization.cpp rename to buildcc/schema/src/target_serialization.cpp index b965ae56..68fdaa24 100644 --- a/buildcc/lib/target/src/target/target_serialization.cpp +++ b/buildcc/schema/src/target_serialization.cpp @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "target/serialization/target_serialization.h" +#include "schema/target_serialization.h" // Third party #include "flatbuffers/flatbuffers.h" // Private -#include "target/private/schema_util.h" +#include "schema/private/schema_util.h" // Schema generated #include "target_generated.h" diff --git a/doc/software_architecture/buildcc_interface_lib.PNG b/doc/software_architecture/buildcc_interface_lib.PNG index e2cc97aa..729c9b08 100644 Binary files a/doc/software_architecture/buildcc_interface_lib.PNG and b/doc/software_architecture/buildcc_interface_lib.PNG differ diff --git a/doc/software_architecture/buildcc_single_lib.PNG b/doc/software_architecture/buildcc_single_lib.PNG index 50e6f27b..62c4c929 100644 Binary files a/doc/software_architecture/buildcc_single_lib.PNG and b/doc/software_architecture/buildcc_single_lib.PNG differ diff --git a/docs/source/arch/project_layout.rst b/docs/source/arch/project_layout.rst index b009c523..8fe5298e 100644 --- a/docs/source/arch/project_layout.rst +++ b/docs/source/arch/project_layout.rst @@ -14,11 +14,15 @@ Project Layout ** README.md ** TODO.md * buildcc - ** env - ** toolchain - ** target - ** args - ** register + ** lib + *** env + *** toolchain + *** target + *** args + *** register + ** schema + ** toolchains + ** targets * bootstrap * buildexe * cmake diff --git a/docs/source/arch/software_heirarchy.rst b/docs/source/arch/software_heirarchy.rst index 76538f31..5dfa8e9f 100644 --- a/docs/source/arch/software_heirarchy.rst +++ b/docs/source/arch/software_heirarchy.rst @@ -47,6 +47,7 @@ BuildCC interface lib rectangle "tiny-process-library" as tpl #palegreen rectangle Environment as env #aliceblue + rectangle Schema as schema #aliceblue rectangle Toolchain as toolchain #aliceblue rectangle Target as target #aliceblue rectangle "Toolchain specialized" as toolchain_specialized #aliceblue @@ -61,17 +62,19 @@ BuildCC interface lib spdlog .up.> env tpl .up.> env - flatbuffers .up.> target - taskflow -up-> target - cli11 -up-> args taskflow -up-> register + flatbuffers .up.> schema + env -up-> toolchain + env -up-> schema + taskflow -up-> target + schema -up-> target toolchain -up-> target - toolchain -up-> toolchain_specialized + toolchain -up-> toolchain_specialized target -up-> target_specialized target -up-> args