From 90aab6796dda679771f77e8b584fe8cc8e7abd47 Mon Sep 17 00:00:00 2001 From: Paul Seyfert Date: Wed, 12 Jun 2019 15:36:10 +0200 Subject: [PATCH] provide CMAKE__COMPILER_LAUNCHER in cmake completion https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_LAUNCHER.html --- src/_cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/_cmake b/src/_cmake index 55efa73..43fc43a 100644 --- a/src/_cmake +++ b/src/_cmake @@ -294,6 +294,7 @@ _cmake_define_lang_property_names() { local cmake_lang="$@[-2]" cmake_lang_desc="$@[-1]" local properties; properties=( "CMAKE_${cmake_lang}_COMPILER:${cmake_lang_desc} compiler" + "CMAKE_${cmake_lang}_COMPILER_LAUNCHER:${cmake_lang_desc} compiler launcher (e.g. ccache)" "CMAKE_${cmake_lang}_FLAGS:${cmake_lang_desc} compiler flags for all builds" "CMAKE_${cmake_lang}_FLAGS_DEBUG:${cmake_lang_desc} compiler flags for all Debug build" "CMAKE_${cmake_lang}_FLAGS_RELEASE:${cmake_lang_desc} compiler flags for all Relase build" @@ -345,6 +346,7 @@ _cmake_define_property_values() { (CMAKE_INSTALL_PREFIX) _files -/ && ret=0;; (CMAKE_EXPORT_COMPILE_COMMANDS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; (CMAKE_*_COMPILER) _wanted compilers expl 'compiler' _cmake_compilers && ret=0;; + (CMAKE_*_COMPILER_LAUNCHER) _wanted compilers expl 'compiler launcher' _cmake_launchers && ret=0;; (CMAKE_*_FLAGS(|_?*)) _message -e compiler-flags 'compiler flags' && _dispatch $service -value-,CPPFLAGS,-default- && ret=0;; (CMAKE_*_STANDARD_REQUIRED) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; (CMAKE_*_EXTENSIONS) _wanted booleans expl 'boolean' _cmake_booleans && ret=0;; @@ -438,12 +440,25 @@ _cmake_booleans() { # --------------- # _cmake_compilers +# +# by default just executable commands, but can be overriden by users. # --------------- (( $+functions[_cmake_compilers] )) || _cmake_compilers() { _command_names -e } +# --------------- +# _cmake_launchers +# +# by default just executable commands, but can be overriden by users. +# useful commands might be ccache, distcc, ... +# --------------- +(( $+functions[_cmake_launchers] )) || +_cmake_launchers() { + _command_names -e +} + local cmake_command_actions;cmake_command_actions=( '-E[CMake command mode]:*:command' )