diff options
author | Vladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com> | 2019-10-22 00:11:32 +0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-10-21 10:11:32 -0700 |
commit | 26f238c24888bf02a872f304fe9f03433fd0dd00 (patch) | |
tree | a5f428a7adc2fac6392ac5bd849c2a5bf2570d0f /CMakeLists.txt | |
parent | e93c8c46e65056381c1862d1be67a5e0dad57948 (diff) | |
download | flatbuffers-26f238c24888bf02a872f304fe9f03433fd0dd00.tar.gz flatbuffers-26f238c24888bf02a872f304fe9f03433fd0dd00.tar.bz2 flatbuffers-26f238c24888bf02a872f304fe9f03433fd0dd00.zip |
Add `--clean-first` to the cmake-build command (travis) (#5574)
- `--clean-first` runs `clean` target to remove previously generated files
- missed `monster_extra_generated.h` file added to the `flattests` target
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index bda80e7e..961d0bba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,6 +126,8 @@ set(FlatBuffers_Tests_SRCS ${CMAKE_CURRENT_BINARY_DIR}/tests/arrays_test_generated.h # file generate by running compiler on tests/native_type_test.fbs ${CMAKE_CURRENT_BINARY_DIR}/tests/native_type_test_generated.h + # file generate by running compiler on tests/monster_extra.fbs + ${CMAKE_CURRENT_BINARY_DIR}/tests/monster_extra_generated.h ) set(FlatBuffers_Sample_Binary_SRCS @@ -311,6 +313,7 @@ if(FLATBUFFERS_BUILD_SHAREDLIB) endif() function(compile_flatbuffers_schema_to_cpp_opt SRC_FBS OPT) + message(STATUS "Add the code-generation command for the `${SRC_FBS}` schema.") get_filename_component(SRC_FBS_DIR ${SRC_FBS} PATH) string(REGEX REPLACE "\\.fbs$" "_generated.h" GEN_HEADER ${SRC_FBS}) add_custom_command( @@ -342,6 +345,9 @@ if(FLATBUFFERS_BUILD_TESTS) compile_flatbuffers_schema_to_cpp(tests/monster_test.fbs) compile_flatbuffers_schema_to_cpp_opt(tests/native_type_test.fbs "") compile_flatbuffers_schema_to_cpp_opt(tests/arrays_test.fbs "--scoped-enums;--gen-compare") + if(NOT (MSVC AND MSVC_VERSION LESS 1900)) + compile_flatbuffers_schema_to_cpp(tests/monster_extra.fbs) # Test floating-point NAN/INF. + endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}/tests) add_executable(flattests ${FlatBuffers_Tests_SRCS}) set_property(TARGET flattests |