From cb4f21d38739d31bf59e804c76f11b85aee1d609 Mon Sep 17 00:00:00 2001 From: Tyler Lentz Date: Wed, 24 Apr 2024 20:45:22 -0700 Subject: [PATCH] fix intellisense (#165) --- .vscode/c_cpp_properties.json | 3 +-- include/stdafx.h | 15 --------------- src/CMakeLists.txt | 9 --------- src/camera/CMakeLists.txt | 1 - src/core/CMakeLists.txt | 1 - src/cv/CMakeLists.txt | 1 - src/dummy.c | 25 ------------------------- src/network/CMakeLists.txt | 2 -- src/pathing/CMakeLists.txt | 1 - src/ticks/CMakeLists.txt | 1 - src/utilities/CMakeLists.txt | 1 - 11 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 include/stdafx.h delete mode 100644 src/dummy.c diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 56884244..c94dffab 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,8 +4,7 @@ "name": "CMake", "compileCommands": "${workspaceFolder}/build/compile_commands.json", "includePath": [ - "${workspaceFolder}/include", - "${workspaceFolder}/build/gen_protos/" + "${workspaceFolder}/include" ], "cppStandard": "c++20" } diff --git a/include/stdafx.h b/include/stdafx.h deleted file mode 100644 index 7b21f312..00000000 --- a/include/stdafx.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef INCLUDE_STDAFX_H_ -#define INCLUDE_STDAFX_H_ - -// Commonly used header files to be precompiled in order to speed up compilation -// In reality this doesn't seem to be doing much in speeding it up... -// Leaving the infrastructure here in case someone is able to figure out a way to -// make this actually speed up compilation. - -#include -#include -#include -#include -#include - -#endif // INCLUDE_STDAFX_H_ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c873e17b..48129c11 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,16 +1,7 @@ -# DONT REMOVE THE DUMMY FILE!!! IT WILL SEEM LIKE IT IS OKAY BUT IT WILL BREAK THE NEXT TIME -# YOU RECLONE OR RM -RF THE BUILD DIRECTORY!!! DON'T BE A DUMMY! add_library(obcpp_protos STATIC ${PROJECT_SOURCE_DIR}/build/gen_protos/protos/obc.pb.cc - dummy.c ) -# LOL -# https://stackoverflow.com/questions/68735830/cmake-precompiled-headers-issue-with-mixed-c-c-project -target_precompile_headers(obcpp_protos PUBLIC - "$<$:\"stdafx.h\">" - "$<$:>") - add_subdirectory(camera) add_subdirectory(core) add_subdirectory(cv) diff --git a/src/camera/CMakeLists.txt b/src/camera/CMakeLists.txt index 726bb19b..b3eb637f 100644 --- a/src/camera/CMakeLists.txt +++ b/src/camera/CMakeLists.txt @@ -17,7 +17,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 9fce0e2d..1f5440e4 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -24,7 +24,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/cv/CMakeLists.txt b/src/cv/CMakeLists.txt index 480c3b02..d0fd517a 100644 --- a/src/cv/CMakeLists.txt +++ b/src/cv/CMakeLists.txt @@ -24,7 +24,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/dummy.c b/src/dummy.c deleted file mode 100644 index 63f4a42e..00000000 --- a/src/dummy.c +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Try and remove this. Just try it, dummy. - * - * Ok, but seriously. DON'T DELETE THIS FILE. You might think, "there's no fucking way - * this file is actually doing anything." And if you were to remove this file and then - * remove the reference to it in src/CMakeLists.txt and recompile, it would look like you - * were correct! It will be fine! - * - * But if you do do this--and I would encourage you to try!--see what happens if you reclone - * the repo or rm -rf your build directory. You will get some unholy error message complaining - * about some nonexistent file deep in the bowels of the build directory. - * Then you'll come crying back to your daddy and begging for a git restore src/dummy.c, - * like the dummy you are. - * - * Don't be a dummy, and don't delete this file. - * - * (for more information, see the stackoverflow post linked in src/CMakeLists.txt) - */ - -int dummy() { - int i = 0; - ++i; - --i; - i = 12; -} diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 7851b09a..d716267a 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -34,7 +34,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) @@ -61,7 +60,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/pathing/CMakeLists.txt b/src/pathing/CMakeLists.txt index 89017fbc..deeb4f6d 100644 --- a/src/pathing/CMakeLists.txt +++ b/src/pathing/CMakeLists.txt @@ -21,7 +21,6 @@ add_library(${LIB_NAME} STATIC target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS}) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/ticks/CMakeLists.txt b/src/ticks/CMakeLists.txt index 06cc68c0..b787f7c9 100644 --- a/src/ticks/CMakeLists.txt +++ b/src/ticks/CMakeLists.txt @@ -32,7 +32,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME}) diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt index 0a4c58c7..b0f0ae57 100644 --- a/src/utilities/CMakeLists.txt +++ b/src/utilities/CMakeLists.txt @@ -20,7 +20,6 @@ target_link_libraries(${LIB_NAME} PRIVATE ${LIB_DEPS} ) -target_precompile_headers(${LIB_NAME} REUSE_FROM obcpp_protos) set_unity_for_target(${LIB_NAME}) target_add_protobuf(${LIB_NAME})