-
Notifications
You must be signed in to change notification settings - Fork 198
CLI Args Junction #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
CLI Args Junction #688
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4377940
update args projects ids to match cmake-generated ones
planetchili 2ea304c
update cmake with option to junction cli args json files
planetchili f24c112
add cli args cmake capability documentation
planetchili 7685ec5
Fix command line args linking and ETLTrimmer preset GUID.
planetchili d71788c
Single path only for args symlings
planetchili d94ec3e
Fix cmake_path NORMALIZE syntax for CLI args build-dir check.
planetchili File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
18 changes: 0 additions & 18 deletions
18
IntelPresentMon/PMInstallerExtension/PMInstallerExtension.args.json
This file was deleted.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
PresentMon/PresentMon.args.json → PresentMon/PresentMonConsole.args.json
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| include_guard(GLOBAL) | ||
|
|
||
| function(_pmon_command_line_args_is_build_binary_dir out_var) | ||
| cmake_path(SET _pmon_expected_build_dir NORMALIZE "${CMAKE_SOURCE_DIR}/build") | ||
| cmake_path(SET _pmon_actual_binary_dir NORMALIZE "${CMAKE_BINARY_DIR}") | ||
| if(_pmon_actual_binary_dir STREQUAL _pmon_expected_build_dir) | ||
| set("${out_var}" TRUE PARENT_SCOPE) | ||
| else() | ||
| set("${out_var}" FALSE PARENT_SCOPE) | ||
| endif() | ||
| endfunction() | ||
|
|
||
| function(_pmon_command_line_args_apply) | ||
| set(_pmon_mappings | ||
| "IntelPresentMon/KernelProcess|KernelProcess|IntelPresentMon/KernelProcess/KernelProcess.args.json" | ||
| "IntelPresentMon/PresentMonService|PresentMonService|IntelPresentMon/PresentMonService/PresentMonService.args.json" | ||
| "PresentMon|PresentMonConsole|PresentMon/PresentMonConsole.args.json" | ||
| "IntelPresentMon/SampleClient|SampleClient|IntelPresentMon/SampleClient/SampleClient.args.json" | ||
| "Tools/ETLTrimmer|ETLTrimmer|Tools/ETLTrimmer/ETLTrimmer.args.json" | ||
| ) | ||
|
|
||
| set(_pmon_linked 0) | ||
|
|
||
| foreach(_pmon_mapping IN LISTS _pmon_mappings) | ||
| string(REPLACE "|" ";" _pmon_fields "${_pmon_mapping}") | ||
| list(GET _pmon_fields 0 _pmon_subdir) | ||
| list(GET _pmon_fields 1 _pmon_target) | ||
| list(GET _pmon_fields 2 _pmon_source_rel) | ||
|
|
||
| set(_pmon_vcxproj "${CMAKE_BINARY_DIR}/${_pmon_subdir}/${_pmon_target}.vcxproj") | ||
| if(NOT TARGET "${_pmon_target}" AND NOT EXISTS "${_pmon_vcxproj}") | ||
| continue() | ||
| endif() | ||
|
|
||
| set(_pmon_source "${CMAKE_SOURCE_DIR}/${_pmon_source_rel}") | ||
| if(NOT EXISTS "${_pmon_source}") | ||
| message( | ||
| WARNING | ||
| "Command line args symlink: missing source preset ${_pmon_source_rel}." | ||
| ) | ||
| continue() | ||
| endif() | ||
|
|
||
| set(_pmon_link "${CMAKE_BINARY_DIR}/${_pmon_subdir}/${_pmon_target}.args.json") | ||
| if(EXISTS "${_pmon_link}") | ||
| file(REMOVE "${_pmon_link}") | ||
| endif() | ||
|
|
||
| file(CREATE_LINK "${_pmon_source}" "${_pmon_link}" SYMBOLIC RESULT _pmon_link_result) | ||
|
planetchili marked this conversation as resolved.
|
||
| if(_pmon_link_result) | ||
| message( | ||
| WARNING | ||
| "Command line args symlink: could not link\n" | ||
| " ${_pmon_link}\n" | ||
| " -> ${_pmon_source}\n" | ||
| " (${_pmon_link_result}). Enable Windows Developer Mode or run from an elevated shell." | ||
| ) | ||
| continue() | ||
| endif() | ||
|
|
||
| math(EXPR _pmon_linked "${_pmon_linked} + 1") | ||
| endforeach() | ||
|
|
||
| if(_pmon_linked GREATER 0) | ||
| message(STATUS "Linked ${_pmon_linked} Command Line Arguments preset(s) under ${CMAKE_BINARY_DIR}.") | ||
| endif() | ||
| endfunction() | ||
|
|
||
| function(pmon_register_command_line_args_symlinks) | ||
| if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") | ||
| return() | ||
| endif() | ||
|
|
||
| _pmon_command_line_args_is_build_binary_dir(_pmon_is_build_dir) | ||
| if(NOT _pmon_is_build_dir) | ||
| if(PMON_LINK_COMMAND_LINE_ARGS) | ||
| message( | ||
| STATUS | ||
| "PMON_LINK_COMMAND_LINE_ARGS is ON but the binary directory is not " | ||
| "${CMAKE_SOURCE_DIR}/build; skipping command line args symlinks." | ||
| ) | ||
| endif() | ||
| return() | ||
| endif() | ||
|
|
||
| add_custom_target( | ||
| pmon_link_command_line_args | ||
| COMMAND | ||
| ${CMAKE_COMMAND} | ||
| -S "${CMAKE_SOURCE_DIR}" | ||
| -B "${CMAKE_BINARY_DIR}" | ||
| -DPMON_LINK_COMMAND_LINE_ARGS=ON | ||
| USES_TERMINAL | ||
| VERBATIM | ||
| ) | ||
| set_target_properties( | ||
| pmon_link_command_line_args | ||
| PROPERTIES | ||
| EXCLUDE_FROM_DEFAULT_BUILD TRUE | ||
| FOLDER "Build" | ||
| ) | ||
|
|
||
| if(PMON_LINK_COMMAND_LINE_ARGS) | ||
| _pmon_command_line_args_apply() | ||
| endif() | ||
| endfunction() | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.