From 4c64cbe99f2616a1d1126257da8d40773f4adba1 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Fri, 10 Feb 2023 20:20:18 +0100 Subject: [PATCH] build: mark uninteresting variables as advanced (#22208) Only the most important variables should be shown by default. --- cmake.config/CMakeLists.txt | 15 +++++++-------- cmake/FindIconv.cmake | 2 ++ cmake/Findlibvterm.cmake | 2 ++ cmake/Findunibilium.cmake | 2 ++ src/nvim/CMakeLists.txt | 6 +++--- src/nvim/po/CMakeLists.txt | 9 +++++++-- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/cmake.config/CMakeLists.txt b/cmake.config/CMakeLists.txt index 29d7622c01..da7b2b9b45 100644 --- a/cmake.config/CMakeLists.txt +++ b/cmake.config/CMakeLists.txt @@ -156,7 +156,6 @@ if (NOT "${HAVE_BE64TOH}") endif() endif() -# generate configuration header and update include directories configure_file ( "${PROJECT_SOURCE_DIR}/cmake.config/config.h.in" "${PROJECT_BINARY_DIR}/cmake.config/auto/config.h" @@ -176,21 +175,21 @@ file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h" INPUT "${PROJECT_BINARY_DIR}/cmake.config/auto/versiondef.h.gen") -# generate pathdef.c -find_program(WHOAMI_PROG whoami) -find_program(HOSTNAME_PROG hostname) +find_program(WHOAMI_PRG whoami) +find_program(HOSTNAME_PRG hostname) +mark_as_advanced(HOSTNAME_PRG WHOAMI_PRG) if (DEFINED ENV{USERNAME}) set(USERNAME $ENV{USERNAME}) -elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PROG}) - execute_process(COMMAND ${WHOAMI_PROG} +elseif (NOT DEFINED USERNAME AND EXISTS ${WHOAMI_PRG}) + execute_process(COMMAND ${WHOAMI_PRG} OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE USERNAME) endif() if (DEFINED ENV{HOSTNAME}) set(HOSTNAME $ENV{HOSTNAME}) -elseif (EXISTS ${HOSTNAME_PROG}) - execute_process(COMMAND ${HOSTNAME_PROG} +elseif (EXISTS ${HOSTNAME_PRG}) + execute_process(COMMAND ${HOSTNAME_PRG} OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE HOSTNAME) endif() diff --git a/cmake/FindIconv.cmake b/cmake/FindIconv.cmake index 63290fe889..a164abfea8 100644 --- a/cmake/FindIconv.cmake +++ b/cmake/FindIconv.cmake @@ -19,3 +19,5 @@ if(ICONV_LIBRARY) endif() libfind_process(Iconv) + +mark_as_advanced(ICONV_LIBRARY) diff --git a/cmake/Findlibvterm.cmake b/cmake/Findlibvterm.cmake index 19ecce40f0..4a2ae48ffa 100644 --- a/cmake/Findlibvterm.cmake +++ b/cmake/Findlibvterm.cmake @@ -18,3 +18,5 @@ find_package_handle_standard_args(libvterm add_library(libvterm INTERFACE) target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIR}) target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY}) + +mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY) diff --git a/cmake/Findunibilium.cmake b/cmake/Findunibilium.cmake index 7bfbcba942..3dbac31b5b 100644 --- a/cmake/Findunibilium.cmake +++ b/cmake/Findunibilium.cmake @@ -25,3 +25,5 @@ list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}") if(UNIBI_HAS_VAR_FROM) target_compile_definitions(unibilium INTERFACE NVIM_UNIBI_HAS_VAR_FROM) endif() + +mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY) diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 52bafffefe..5953dd3ab9 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -252,11 +252,11 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang") target_compile_definitions(main_lib INTERFACE _GNU_SOURCE) endif() -option(USE_GCOV "Enable gcov support" OFF) -if(USE_GCOV) +option(ENABLE_GCOV "Enable gcov support" OFF) +if(ENABLE_GCOV) if(CLANG_TSAN) # GCOV and TSAN results in false data race reports - message(FATAL_ERROR "USE_GCOV cannot be used with CLANG_TSAN") + message(FATAL_ERROR "ENABLE_GCOV cannot be used with CLANG_TSAN") endif() message(STATUS "Enabling gcov support") target_compile_options(main_lib INTERFACE --coverage) diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index a5a3c135d3..74f043fe03 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -1,9 +1,14 @@ find_package(Gettext REQUIRED) find_program(XGETTEXT_PRG xgettext) find_program(ICONV_PRG iconv) +mark_as_advanced( + GETTEXT_MSGFMT_EXECUTABLE + GETTEXT_MSGMERGE_EXECUTABLE + ICONV_PRG + XGETTEXT_PRG) -option(LANGUAGES "Localizations to build") -if(NOT LANGUAGES) +option(ENABLE_LANGUAGES "Localizations to build" ON) +if(ENABLE_LANGUAGES) set(LANGUAGES af ca