Initial reflection and resizing functionality.

Tested: on Linux.

Change-Id: I8f7bccf9b1ad87fea788f85e23fa69435758feca
This commit is contained in:
Wouter van Oortmerssen
2015-05-21 16:33:29 -07:00
parent 1808337adc
commit 81312c2128
23 changed files with 1152 additions and 46 deletions

View File

@@ -20,6 +20,8 @@ set(FlatBuffers_Compiler_SRCS
include/flatbuffers/hash.h
include/flatbuffers/idl.h
include/flatbuffers/util.h
include/flatbuffers/reflection.h
include/flatbuffers/reflection_generated.h
src/idl_parser.cpp
src/idl_gen_cpp.cpp
src/idl_gen_general.cpp
@@ -112,6 +114,15 @@ function(compile_flatbuffers_schema_to_cpp SRC_FBS)
DEPENDS flatc)
endfunction()
function(compile_flatbuffers_schema_to_binary SRC_FBS)
get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH)
string(REGEX REPLACE "\\.fbs$" ".bfbs" GEN_BINARY_SCHEMA ${SRC_FBS})
add_custom_command(
OUTPUT ${GEN_BINARY_SCHEMA}
COMMAND flatc -b --schema -o "${SRC_FBS_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FBS}"
DEPENDS flatc)
endfunction()
if(FLATBUFFERS_BUILD_TESTS)
compile_flatbuffers_schema_to_cpp(tests/monster_test.fbs)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/tests)