CUSTOMBUILD error on flatbenchmark
Hi!
I'm getting a minor error when buiding from source. All targets build fine and tests are OK, but I report this issue anyway
Platform : Windows 10 Build chain : CMake + Visual Studio 2019 Build env : ConEmu + msys64 bash
flatbuffers working copy in : ~/dev/cpp/www-git/flatbuffers Out-of-tree build in : ~/build/cpp/www-git/flatbuffers
CMake configuration :
$ cmake -B ~/build/cpp/www-git/flatbuffers \
-D FLATBUFFERS_BUILD_SHAREDLIB=ON \
-D FLATBUFFERS_INSTALL=ON \
-D FLATBUFFERS_BUILD_FLATLIB=ON \
-D FLATBUFFERS_BUILD_FLATC=ON \
-D FLATBUFFERS_BUILD_FLATHASH=ON \
-D FLATBUFFERS_BUILD_TESTS=ON \
-D FLATBUFFERS_BUILD_BENCHMARKS=ON \
$ cmake --build ~/build/cpp/www-git/flatbuffers --config Release
Microsoft (R) Build Engine version 16.11.2+f32259642 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits réservés.
benchmark.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\src\Release\benchmark.lib
args_product_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\args_product_test.exe
basic_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\basic_test.exe
gmock_main.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\lib\Release\gmock_main.lib
benchmark_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\benchmark_gtest.exe
benchmark_main.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\src\Release\benchmark_main.lib
benchmark_name_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\benchmark_name_gtest.exe
benchmark_random_interleaving_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\benchmark_random_interl
eaving_gtest.exe
benchmark_setup_teardown_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\benchmark_setup_teardown_test
.exe
benchmark_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\benchmark_test.exe
commandlineflags_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\commandlineflags_gtest.exe
output_test_helper.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\output_test_helper.lib
complexity_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\complexity_test.exe
diagnostics_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\diagnostics_test.exe
display_aggregates_only_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\display_aggregates_only_test.e
xe
donotoptimize_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\donotoptimize_test.exe
filter_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\filter_test.exe
fixture_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\fixture_test.exe
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
Generating Code...
flatbuffers.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatbuffers.lib
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
idl_gen_cpp.cpp
idl_gen_csharp.cpp
idl_gen_dart.cpp
idl_gen_kotlin.cpp
idl_gen_go.cpp
idl_gen_java.cpp
idl_gen_ts.cpp
idl_gen_php.cpp
idl_gen_python.cpp
idl_gen_lobster.cpp
idl_gen_lua.cpp
idl_gen_rust.cpp
idl_gen_fbs.cpp
idl_gen_grpc.cpp
idl_gen_json_schema.cpp
idl_gen_swift.cpp
Generating Code...
Compiling...
flatc.cpp
flatc_main.cpp
binary_annotator.cpp
annotated_binary_text_gen.cpp
bfbs_gen_lua.cpp
bfbs_gen_nim.cpp
code_generators.cpp
cpp_generator.cc
go_generator.cc
java_generator.cc
python_generator.cc
swift_generator.cc
ts_generator.cc
Generating Code...
flatc.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatc.exe
gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\lib\Release\gtest.lib
Run Flatbuffers Benchmark Codegen: cpp/flatbuffers/bench_generated.h
Usage: ..\Release\flatc.exe [-b|--binary, -t|--json, -c|--cpp, -g|--go,
-j|--java, -d|--dart, -T|--ts, -n|--csharp, -p|--python, --lobster, -l|--lua,
-r|--rust, --php, --kotlin, --jsonschema, --swift, --nim, -o, -I, -M, --version,
-h|--help, --strict-json, --allow-non-utf8, --natural-utf8, --defaults-json,
--unknown-json, --no-prefix, --scoped-enums, --swift-implementation-only,
--gen-includes, --no-includes, --gen-mutable, --gen-onefile, --gen-name-strings,
--gen-object-api, --gen-compare, --gen-nullable, --java-checkerframe,
--gen-generated, --gen-jvmstatic, --gen-all, --gen-json-emit, --cpp-include,
--cpp-ptr-type, --cpp-str-type, --cpp-str-flex-ctor, --cpp-field-case-style,
--cpp-std, --cpp-static-reflection, --object-prefix, --object-suffix,
--go-namespace, --go-import, --raw-binary, --size-prefixed, --proto,
--proto-namespace-suffix, --oneof-union, --grpc, --schema, --bfbs-filenames,
--bfbs-comments, --bfbs-builtins, --bfbs-gen-embed, --conform,
--conform-includes, --filename-suffix, --filename-ext, --include-prefix,
--keep-prefix, --reflect-types, --reflect-names, --rust-serialize,
--rust-module-root-file, --root-type, --require-explicit-ids, --force-defaults,
--force-empty, --force-empty-vectors, --flexbuffers, --no-warnings,
--warnings-as-errors, --cs-global-alias, --cs-gen-json-serializer,
--json-nested-bytes, --ts-flat-files, --annotate,
--no-leak-private-annotation]... FILE... [-- BINARY_FILE...]
CUSTOMBUILD : error : [C:\Users\olivier\build\cpp\www-git\flatbuffers\benchmarks\flatbenchmark.vcxproj]
unable to load file: cpp/flatbuffers/bench.fbs
..\Release\flatc.exe:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for 'C: \Users\olivier\build\cpp\www-git\flatbuffers\CMakeFiles\fb474780e1a2ad1ac275f79ef9983f78\bench_generated.h.rule' exited with code 1. [C:\Users\olivier\build\cpp \www-git\flatbuffers\benchmarks\flatbenchmark.vcxproj]
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
Generating Code...
flatbuffers_shared.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatbuffers.dll
flathash.cpp
flathash.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flathash.exe
Run generation: 'samples/monster.bfbs'
Run generation: 'samples/monster_generated.h'
Run generation: 'tests/alignment_test_generated.h'
Run generation: 'tests/arrays_test.bfbs'
Run generation: 'tests/arrays_test_generated.h'
Run generation: 'tests/monster_extra_generated.h'
Run generation: 'tests/monster_test.bfbs'
Run generation: 'tests/monster_test_bfbs_generated.h'
Run generation: 'tests/monster_test_generated.h'
Run generation: 'tests/namespace_test/namespace_test1_generated.h'
Run generation: 'tests/namespace_test/namespace_test2_generated.h'
Run generation: 'tests/native_inline_table_test_generated.h'
Run generation: 'tests/native_type_test_generated.h'
Run generation: 'tests/optional_scalars_generated.h'
Run generation: 'tests/union_vector/union_vector_generated.h'
All generated files were updated.
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
sample_bfbs.cpp
Generating Code...
flatsamplebfbs.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatsamplebfbs.exe
sample_binary.cpp
flatsamplebinary.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatsamplebinary.exe
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
sample_text.cpp
Generating Code...
flatsampletext.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flatsampletext.exe
idl_parser.cpp
idl_gen_text.cpp
reflection.cpp
util.cpp
idl_gen_fbs.cpp
evolution_test.cpp
flexbuffers_test.cpp
fuzz_test.cpp
json_test.cpp
monster_test.cpp
optional_scalars_test.cpp
parser_test.cpp
proto_test.cpp
reflection_test.cpp
test.cpp
test_assert.cpp
test_builder.cpp
util_test.cpp
native_type_test_impl.cpp
alignment_test.cpp
Generating Code...
Compiling...
code_generators.cpp
Generating Code...
flattests.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\Release\flattests.exe
gmock.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\lib\Release\gmock.lib
gtest_main.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\lib\Release\gtest_main.lib
internal_threading_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\internal_threading_test.exe
link_main_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\link_main_test.exe
map_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\map_test.exe
memory_manager_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\memory_manager_test.exe
multiple_ranges_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\multiple_ranges_test.exe
options_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\options_test.exe
perf_counters_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\perf_counters_gtest.exe
perf_counters_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\perf_counters_test.exe
register_benchmark_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\register_benchmark_test.exe
repetitions_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\repetitions_test.exe
report_aggregates_only_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\report_aggregates_only_test.exe
reporter_output_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\reporter_output_test.exe
skip_with_error_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\skip_with_error_test.exe
spec_arg_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\spec_arg_test.exe
statistics_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\statistics_gtest.exe
string_util_gtest.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\string_util_gtest.exe
templated_fixture_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\templated_fixture_test.exe
user_counters_tabular_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\user_counters_tabular_test.exe
user_counters_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\user_counters_test.exe
user_counters_thousands_test.vcxproj -> C:\Users\olivier\build\cpp\www-git\flatbuffers\_deps\googlebenchmark-build\test\Release\user_counters_thousands_test.e
xe
So the build goes nearly completely smooth, and all targets are generated, but this error occurs in the middle
CUSTOMBUILD : error : [C:\Users\olivier\build\cpp\www-git\flatbuffers\benchmarks\flatbenchmark.vcxproj]
unable to load file: cpp/flatbuffers/bench.fbs
I get the same error if configuring an in-tree build (i.e. a classic 'build' subdirectory under source root)
In both cases the '~\build\cpp\www-git\flatbuffers\benchmarks\cpp\flatbuffers' (respectively '.\build\benchmarks\cpp\flatbuffers') are empty so there is actually no bench.fbs file here,
=> Either the build should point to the benchmarks\cpp\flatbuffers source subdirectory, or the file be copied in the corresponding build subdirectory.