-
Notifications
You must be signed in to change notification settings - Fork 0
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
compile compile command cleanup #130
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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,9 @@ | ||
include("GenericFindDependency") | ||
|
||
option(ABSL_PROPAGATE_CXX_STD "Use CMake C++ standard meta features (e.g. cxx_std_11) that propagate to targets that link to Abseil" true) | ||
|
||
GenericFindDependency( | ||
TARGET grpc++ | ||
SOURCE_DIR grpc | ||
SYSTEM_INCLUDES | ||
) |
This file contains 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 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,32 @@ | ||
include("GenericFindDependency") | ||
option(ENABLE_TESTING "Build tests" OFF) | ||
option(ENABLE_PUSH "Build prometheus-cpp push library" OFF) | ||
option(ENABLE_COMPRESSION "Enable gzip compression" ON) | ||
GenericFindDependency( | ||
TARGET prometheus-cpp::core | ||
SOURCE_DIR "prometheus-cpp" | ||
) | ||
|
||
# Change all of Prometheus's include directories to be system includes, to avoid | ||
# compiler errors. The generalised version of this in GenericFindDependency won't | ||
# work here because we are dealing with an aliased target | ||
get_target_property(_aliased prometheus-cpp::core ALIASED_TARGET) | ||
if(_aliased) | ||
get_target_property(prometheus_include_directories ${_aliased} INTERFACE_INCLUDE_DIRECTORIES) | ||
if(prometheus_include_directories) | ||
set_target_properties(${_aliased} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") | ||
target_include_directories(${_aliased} SYSTEM INTERFACE ${prometheus_include_directories}) | ||
endif() | ||
endif() | ||
|
||
# Change all of Prometheus's include directories to be system includes, to avoid | ||
# compiler errors. The generalised version of this in GenericFindDependency won't | ||
# work here because we are dealing with an aliased target | ||
get_target_property(_aliased prometheus-cpp::pull ALIASED_TARGET) | ||
if(_aliased) | ||
get_target_property(prometheus_include_directories ${_aliased} INTERFACE_INCLUDE_DIRECTORIES) | ||
if(prometheus_include_directories) | ||
set_target_properties(${_aliased} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") | ||
target_include_directories(${_aliased} SYSTEM INTERFACE ${prometheus_include_directories}) | ||
endif() | ||
endif() |
This file contains 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,27 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# | ||
# Application will allow users to strip away source files from the compile_commands.json file. | ||
# | ||
|
||
import argparse | ||
import json | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(description="Modifies a compile_commands.json file", allow_abbrev=False) | ||
parser.add_argument("file", type=str, help="path to the compile_commands.json file") | ||
parser.add_argument("--remove-third-party", action="store_true", help="removes all third party files") | ||
arguments = parser.parse_args() | ||
|
||
try: | ||
with open(arguments.file, "r") as file: | ||
data = json.load(file) | ||
|
||
if arguments.remove_third_party: | ||
data = [x for x in data if "third_party" not in x["file"]] | ||
|
||
with open(arguments.file, "w") as file: | ||
json.dump(data, file, indent=4) | ||
except BaseException as e: | ||
print(e, file=sys.stderr) | ||
exit(1) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these were generating warning messages