Fix building MKLDNNPlugin when the source path contains spaces #5109
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.
The key changes are:
Using
VERBATIM
to ensure CMake property passes command-line arguments to child processes.Using the
INCLUDE_DIRECTORIES
property instead ofCOMPILE_FLAGS
to add include directories, becauseCOMPILE_FLAGS
are treated as space-separated values. (A small side benefit is that this doesn't rely on-I
being the include directory option.)In addition, some changes had to be made in order to preserve behavior:
The
_GEN_ARGS_LIST
variable has to be inlined, becauseARCH_SET
is a list, and therefore the-DXARCH_SET=...
argument gets split into multiple arguments (this happens to work by coincidence withoutVERBATIM
). IMO, the code looks better this way anyway.It's no longer necessary to replace spaces in
XARCH_SET
incross_compiled_disp_gen.cmake
, because those spaces were an artifact of how the CMake arguments were passed before.