From ab639e635a85f5a8318b4ba983c80739f154d9f9 Mon Sep 17 00:00:00 2001 From: Seth Hamilton Date: Sun, 7 Sep 2025 14:05:49 -0500 Subject: [PATCH] working compdb export --- .gitignore | 2 +- build.sh | 2 +- export_compdb.sh | 8 ++++++++ export_compile_commands.sh | 12 ------------ test.txt | 3 --- 5 files changed, 10 insertions(+), 17 deletions(-) create mode 100644 export_compdb.sh delete mode 100644 export_compile_commands.sh delete mode 100644 test.txt diff --git a/.gitignore b/.gitignore index 5a6225b..e263687 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -**PTHREADS-BUILT** **obj** **bin** .cache** +compile_commands.json diff --git a/build.sh b/build.sh index b2f051e..64f404f 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ ( cd bin srcs=../src/* - cl $srcs -I ../inc/ -Od -std:c++20 -Fe main.exe + cl $srcs -I ../inc/ -Od -std:c++20 -Fe ) diff --git a/export_compdb.sh b/export_compdb.sh new file mode 100644 index 0000000..8d8f1f9 --- /dev/null +++ b/export_compdb.sh @@ -0,0 +1,8 @@ +srcs=src/* +working_dir=$pwd + +echo [ > compile_commands.json + +find src -iname "*.cpp" -exec sh -c 'echo { \"directory\": \"$(pwd)\", \"command\": \"cl {} -I inc -Od -std:c++20 -Fo\", \"file\": \"{}\" }, >> compile_commands.json' \; + +echo ] >> compile_commands.json diff --git a/export_compile_commands.sh b/export_compile_commands.sh deleted file mode 100644 index 540ef1f..0000000 --- a/export_compile_commands.sh +++ /dev/null @@ -1,12 +0,0 @@ -srcs=src/* -working_dir=$pwd -command_pre="cl" -command_post="-I inc -Od -std:c++20 -Fo" - -echo [ > compile_commands.json - -find src -iname "*.cpp" -o -iname "*.c" -exec sh -c 'echo { "directory": "$(pwd)", "command": "$(command_pre) {} $(command_pos)", "file": "{}" }, >> compile_commands.json' \; - -echo ] >> compile_commands.json - -# axiomatic, diff --git a/test.txt b/test.txt deleted file mode 100644 index fa05939..0000000 --- a/test.txt +++ /dev/null @@ -1,3 +0,0 @@ -10 2000 150000 2 -1 200 -0 10000