Author: brane
Date: Tue Jun  3 02:16:16 2025
New Revision: 1926070

URL: http://svn.apache.org/viewvc?rev=1926070&view=rev
Log:
In the CMake build: dont' generate .clangd by default, the source tree
could be read-only.

* CMakeLists.txt
  (DOT_CLANGD): New option to generate .clangd, off by default. Use it to
   decide about including SerfGenClangd.cmake and in the configure summary.

Modified:
    serf/trunk/CMakeLists.txt

Modified: serf/trunk/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1926070&r1=1926069&r2=1926070&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Tue Jun  3 02:16:16 2025
@@ -59,6 +59,7 @@ option(GSSAPI_ROOT:PATH "Path to GSSAPI'
 
 # Build options
 option(DEBUG "Enable debugging info and strict compile warnings" OFF)
+option(DOT_CLANGD "Generate a .clangd file at the root of the source tree" OFF)
 option(SKIP_SHARED "Disable building shared Serf libraries" OFF)
 option(SKIP_STATIC "Disable building static Serf libraries" OFF)
 option(DISABLE_LOGGING "Disable the logging framework at compile time" OFF)
@@ -405,7 +406,9 @@ set_target_properties(${SERF_TARGETS}
                       OUTPUT_NAME "serf-${SERF_MAJOR_VERSION}")
 
 # Generate the .clangd file
-include(SerfGenClangd)
+if(DOT_CLANGD)
+  include(SerfGenClangd)
+endif()
 
 # Install targets
 install(TARGETS ${SERF_TARGETS}
@@ -463,6 +466,7 @@ endif()
 set(_build_shared OFF)
 set(_build_static OFF)
 set(_build_tests OFF)
+set(_gen_dot_clangd OFF)
 set(_have_brotli OFF)
 set(_have_gssapi OFF)
 set(_have_sspi OFF)
@@ -476,6 +480,9 @@ endif()
 if(NOT SKIP_TESTS)
   set(_build_tests ON)
 endif()
+if(DOT_CLANGD)
+  set(_gen_dot_clangd ON)
+endif()
 
 get_directory_property(_cdef COMPILE_DEFINITIONS)
 if("SERF_HAVE_BROTLI" IN_LIST _cdef)
@@ -498,6 +505,7 @@ message(STATUS "    build type .........
 message(STATUS "    shared libraries .... ... : ${_build_shared}")
 message(STATUS "    static libraries ........ : ${_build_static}")
 message(STATUS "    tests ................... : ${_build_tests}")
+message(STATUS "    generate .clangd ........ : ${_gen_dot_clangd}")
 message(STATUS "  Options:")
 message(STATUS "    Brotli .................. : ${_have_brotli}")
 message(STATUS "    GSSAPI .................. : ${_have_gssapi}")


Reply via email to