Add initial Bazel WORKSPACE and BUILD#4608
Conversation
BUILD
Outdated
| ]) | ||
|
|
||
| FLATBUFFERS_COPTS = [ | ||
| "-fexceptions", |
There was a problem hiding this comment.
We're not using exceptions anymore.
BUILD
Outdated
| "LICENSE", | ||
| "build_defs", | ||
| "reflection/reflection.fbs", | ||
| "samples/monster.fbs", |
There was a problem hiding this comment.
why is any of the tests and samples stuff exported?
There was a problem hiding this comment.
I think so you can reference the files for codelabs. Normall, bazel doesn't let you reference files from other packages unless you export the files.
There was a problem hiding this comment.
Probably not needed for this case, so I'll remove.
BUILD
Outdated
|
|
||
| FLATBUFFERS_COPTS_FOR_TESTING = FLATBUFFERS_COPTS + [ | ||
| "-DFLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE", | ||
| "-DFLATBUFFERS_TEST_PATH_PREFIX=third_party/flatbuffers/", |
There was a problem hiding this comment.
what's the need for this path?
BUILD
Outdated
| # Library shared between destkop and mobile targets to test flatbuffers. | ||
| # This is seperate from :flatbuffers and :flatc_library as it uses different | ||
| # preprocessor symbols to configure the build for testing. | ||
| cc_library( |
There was a problem hiding this comment.
why do we need a library for the tests?
| @@ -0,0 +1,2 @@ | |||
| workspace(name = "com_github_google_flatbuffers") | |||
There was a problem hiding this comment.
is this file strictly needed? always looking for ways to not clutter the root dir :)
There was a problem hiding this comment.
Yup, Bazel requires a WORKSPACE file at the root directory:
https://docs.bazel.build/versions/master/tutorial/cpp.html#build-with-bazel
|
@smiles can you have a look? |
|
As for the error you're getting, |
For google#4574. To test: bazel test --verbose_failures //:flatbuffers_test
|
@smiles can you give this a final review? |
stewartmiles
left a comment
There was a problem hiding this comment.
Looks reasonable to me.
For google#4574. To test: bazel test --verbose_failures //:flatbuffers_test
For #4574.