enh: Move CMake defines to separate header, unused by Bazel #235
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change avoids having to configure a private .h.in file during the Bazel build such that these files are not available to dependent projects in the GENDIR of the external gflags project.
Alternative change which fixes #233 instead of PR #234.
For no good reason, Bazel seems to add the GENDIR to the include path of dependent projects, which cannot be fixed easily. A solution would be to place private generated header files in a subdirectory as suggested in #234, but unfortunately the path of this directory cannot be referenced with a macro such as
$(GENDIR)which differs when gflags is used as external dependency in another project. A possible solution I explored was to use$(location :config_h), but this gives the full file path, not the directory path. Using$(location :config_h)/..seemed to work at some point, but isn't very pretty either.So, instead of trying to get things right for Bazel, simply avoid having to have a genrule for
config.hin the first place, as this rule is mainly a dummy to get rid of unused#cmakedefines.