diff --git a/CMakeLists.txt b/CMakeLists.txt index 60f24c286..e9b99863b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.15...3.30) project(freud) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(DEFAULT_BUILD_TYPE "Release") @@ -84,8 +85,10 @@ include_directories( add_subdirectory(freud) # enable compile_commands.json -set(CMAKE_EXPORT_COMPILE_COMMANDS ON FORCE) -if(NOT WIN32) - file(CREATE_LINK "${CMAKE_BINARY_DIR}/compile_commands.json" - "${CMAKE_SOURCE_DIR}/compile_commands.json" SYMBOLIC) +if (NOT WIN32) + file(CREATE_LINK + "${CMAKE_BINARY_DIR}/compile_commands.json" + "${CMAKE_SOURCE_DIR}/compile_commands.json" + SYMBOLIC + ) endif()