From 41db10db6b31f282791f009f616d87a65de8845a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Szab=C3=B3?= Date: Wed, 8 Jan 2025 17:14:20 -0800 Subject: [PATCH] Set up some DX features for OSS (#9565) Summary: These will be helpful both in the future and when applying parts of https://github.com/facebook/hhvm/issues/9564. * Set up .editorconfig to ensure consistent indents. * Instruct CMake to export a clangd JSON compilation database that IDEs can integrate with. Pull Request resolved: https://github.com/facebook/hhvm/pull/9565 Reviewed By: Wilfred Differential Revision: D67870812 fbshipit-source-id: 8d1db6b9002e65e8cf52d0a0d005ed4fe49259cf --- .editorconfig | 3 +++ .gitignore | 3 +++ CMakeLists.txt | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000000..a43ec75b0ae2b0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[{CMakeLists.txt,*.cmake,*.h,*.cpp}] +indent_style = space +indent_size = 2 diff --git a/.gitignore b/.gitignore index 392c8a15b1ff41..881ca58c8b012a 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ CPackSourceConfig.cmake # python scripts *.pyc + +# clangd JSON Compilation Database +compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 21225c1259a5b3..e3d8479c650993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,8 @@ cmake_policy(SET CMP0046 NEW) # projects are created. INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/VisualStudioToolset.cmake") +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # includes SET( CMAKE_MODULE_PATH