summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAotrix <[email protected]>2026-10-07 23:10:09 +0200
committerAotrix <[email protected]>2026-10-07 23:10:09 +0200
commitd72983996f30ee785cca9f66eeea598a2432744e (patch)
tree6a7ef032549054a4ce9e5e9edc975796843a2f60
parent0d684f65b364baf8551acafccf7169a7af24ad93 (diff)
Add information regarding missing include directory
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md6
-rw-r--r--compile_commands.json4
-rw-r--r--main.cc6
-rwxr-xr-xremove.sh2
5 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1cd1d4..720f41d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,11 @@ add_clang_executable(remove-function-call
removeFunctionCall.cpp
)
+add_compile_options(
+ remove-function-call
+ /usr/lib/gcc/x86_64-pc-linux-gnu/16/include
+)
+
clang_target_link_libraries(remove-function-call
PRIVATE
clangAST
diff --git a/README.md b/README.md
index 361521f..6860c31 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,7 @@
./remove.sh file.cpp -parameter "NAME_OF_FUNCTION_PARAMETER" -value <true/false>
+
+IMPORTANT:
+Do not forget to add this to compile_commands.json:
+-I/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
+
+And make sure that compile_commands.json is at the root of folder (not in `build`)
diff --git a/compile_commands.json b/compile_commands.json
index da7fc2f..ff109c6 100644
--- a/compile_commands.json
+++ b/compile_commands.json
@@ -1,8 +1,8 @@
[
{
"directory": "/home/aotrix/development/clang_AST/removeFunctionCall/build",
- "command": "/usr/bin/c++ -std=gnu++20 -fno-exceptions -funwind-tables -o CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o -c /home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp",
+ "command": "/usr/bin/c++ -std=gnu++20 -fno-exceptions -funwind-tables -o CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o -c /home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp -I/usr/lib/gcc/x86_64-pc-linux-gnu/16/include",
"file": "/home/aotrix/development/clang_AST/removeFunctionCall/removeFunctionCall.cpp",
"output": "CMakeFiles/remove-function-call.dir/removeFunctionCall.cpp.o"
}
-] \ No newline at end of file
+]
diff --git a/main.cc b/main.cc
index 41a3200..f71f1f4 100644
--- a/main.cc
+++ b/main.cc
@@ -18,14 +18,10 @@ bool coucouEveryone()
int main()
{
std::string aValue{"stari"};
- if (configValue(aValue, "on"))
{
coucouEveryone();
}
- if (!configValue("burger", "on"))
- {
- std::cout << "Mouhahahaha I am a villain!\n";
- }
+
int abc;
return 0;
}
diff --git a/remove.sh b/remove.sh
index 781dc6d..c2f12b9 100755
--- a/remove.sh
+++ b/remove.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
echo "Removing calls..."
-./build/remove-function-call $1 $2
+./build/remove-function-call $1
clang-tidy $1 -checks=-*,readability-simplify-boolean-expr -fix >/dev/null 2>&1
echo "Done."