From b031e747567be0bd7ecfac4af9a3acd5720a5372 Mon Sep 17 00:00:00 2001 From: Benedikt Galbavy Date: Sat, 13 Apr 2024 15:58:15 +0200 Subject: [PATCH] Added compile commands copy function to CMake --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c259861..797b71e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,4 +38,11 @@ target_link_libraries(${PROJECT_NAME} PUBLIC # should be private when all SDL fu if(CMAKE_BUILD_TYPE MATCHES "Debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer") target_link_libraries(${PROJECT_NAME} PRIVATE "-fsanitize=address") -endif() \ No newline at end of file +endif() + +# link/copy compile commands to root dir +file(CREATE_LINK + ${PROJECT_BINARY_DIR}/compile_commands.json + ${PROJECT_SOURCE_DIR}/compile_commands.json + COPY_ON_ERROR SYMBOLIC +) \ No newline at end of file