Fix building MKLDNNPlugin when the source path contains spaces#5109
Merged
ilya-lavrenov merged 1 commit intoopenvinotoolkit:masterfrom Apr 12, 2021
IRDonch:handle-spaces
Merged
Fix building MKLDNNPlugin when the source path contains spaces#5109ilya-lavrenov merged 1 commit intoopenvinotoolkit:masterfrom IRDonch:handle-spaces
ilya-lavrenov merged 1 commit intoopenvinotoolkit:masterfrom
IRDonch:handle-spaces
Conversation
The key changes are: * Using VERBATIM to ensure CMake property passes command-line arguments to child processes. * Using the INCLUDE_DIRECTORIES property instead of COMPILE_FLAGS to add include directories, because COMPILE_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, because ARCH_SET is a list, and therefore the "-DXARCH_SET=..." argument gets split into multiple arguments (this happens to work by coincidence without VERBATIM). IMO, the code looks better this way anyway. * It's no longer necessary to replace spaces in XARCH_SET in cross_compiled_disp_gen.cmake, because those spaces were an artifact of how the CMake arguments were passed before.
ilya-lavrenov
approved these changes
Apr 12, 2021
mryzhov
pushed a commit
to mryzhov/openvino
that referenced
this pull request
Apr 23, 2021
…inotoolkit#5109) The key changes are: * Using VERBATIM to ensure CMake property passes command-line arguments to child processes. * Using the INCLUDE_DIRECTORIES property instead of COMPILE_FLAGS to add include directories, because COMPILE_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, because ARCH_SET is a list, and therefore the "-DXARCH_SET=..." argument gets split into multiple arguments (this happens to work by coincidence without VERBATIM). IMO, the code looks better this way anyway. * It's no longer necessary to replace spaces in XARCH_SET in cross_compiled_disp_gen.cmake, because those spaces were an artifact of how the CMake arguments were passed before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
VERBATIMto ensure CMake property passes command-line arguments to child processes.Using the
INCLUDE_DIRECTORIESproperty instead ofCOMPILE_FLAGSto add include directories, becauseCOMPILE_FLAGSare treated as space-separated values. (A small side benefit is that this doesn't rely on-Ibeing the include directory option.)In addition, some changes had to be made in order to preserve behavior:
The
_GEN_ARGS_LISTvariable has to be inlined, becauseARCH_SETis 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_SETincross_compiled_disp_gen.cmake, because those spaces were an artifact of how the CMake arguments were passed before.