Allow override of prefix-map build flag#3228
Allow override of prefix-map build flag#3228yuyichao wants to merge 2 commits intorr-debugger:masterfrom
Conversation
|
I just realized that the prefix in the variable name and the variable value has nothing to do with each other.... Oh well, hopefully the comment at the variable initialization is clear enough... |
| CHECK_C_COMPILER_FLAG("-fmacro-prefix-map=foo=bar" SUPPORTS_MACRO_PREFIX_MAP) | ||
| if (SUPPORTS_MACRO_PREFIX_MAP) | ||
| set(FLAGS_COMMON "${FLAGS_COMMON} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") | ||
| set(PREFIX_FLAGS_COMMON "${PREFIX_FLAGS_COMMON} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=") |
There was a problem hiding this comment.
How is this supposed to be used? In clang at least, fmacro-prefix-map is a hash table, with later entries overriding earlier ones. Doesn't that moot the usefulness of this option?
There was a problem hiding this comment.
What do you mean by "usefulness of this option"? The point is that distribution should be able to override this. Without any flags passed in, this should behave exactly the same without this PR and as useful as it was.
It does seem that clang and gcc handles this differently. For GCC, it seems that any later flags override earlier ones but for clang, later, less-specific ones does not override earlier flags. To allow distro override to work correctly, it seems that I would need to just disable this if a similar flag is passed in.
By placing it before user supplied flags from the environment variables.
By placing it before user supplied flags from the environment variables.