From 9874f3697158ff31989b413803925d4472856772 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Tue, 5 Mar 2024 14:55:53 +0000 Subject: [PATCH] [cmake] Always generate compile_commands.json I can't think of a valid reason not to generate compile_commands.json and several reasons why we should 1. I don't like typing configure options that much. 2. I like editor completion to work without me having to regenerate my build. 3. It's a good way to inspect final build flags without having to query the build system. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c09b5f0a3c..9e0e430c66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,9 @@ set(UR_CONFORMANCE_TARGET_TRIPLES "" CACHE STRING "List of sycl targets to build CTS device binaries for") set(UR_CONFORMANCE_AMD_ARCH "" CACHE STRING "AMD device target ID to build CTS binaries for") +# There's little reason not to generate the compile_commands.json +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + include(Assertions) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)