Browse Source

CI: Update build script to use Xcode generator by default outside of CI

It is preferred that developers use Xcode when developing plugins for
macOS. On CI, Ninja is preferred for support of ccache and thus speed
of compilation.
PatTheMav 3 years ago
parent
commit
40e6d8edac
1 changed files with 3 additions and 2 deletions
  1. 3 2
      .github/scripts/.build.zsh

+ 3 - 2
.github/scripts/.build.zsh

@@ -61,10 +61,11 @@ build() {
   local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
   local -r -a _valid_configs=(Debug RelWithDebInfo Release MinSizeRel)
   if [[ ${host_os} == 'macos' ]] {
   if [[ ${host_os} == 'macos' ]] {
     local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles')
     local -r -a _valid_generators=(Xcode Ninja 'Unix Makefiles')
+    local generator="${${CI:+Ninja}:-Xcode}"
   } else {
   } else {
     local -r -a _valid_generators=(Ninja 'Unix Makefiles')
     local -r -a _valid_generators=(Ninja 'Unix Makefiles')
+    local generator='Ninja'
   }
   }
-  local generator='Ninja'
   local -r _usage="
   local -r _usage="
 Usage: %B${functrace[1]%:*}%b <option> [<options>]
 Usage: %B${functrace[1]%:*}%b <option> [<options>]
 
 
@@ -197,7 +198,7 @@ Usage: %B${functrace[1]%:*}%b <option> [<options>]
     )
     )
 
 
     if (( _loglevel == 0 )) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR)
     if (( _loglevel == 0 )) cmake_args+=(-Wno_deprecated -Wno-dev --log-level=ERROR)
-    if (( _logLevel > 2 )) cmake_args+=(--debug-output)
+    if (( _loglevel > 2 )) cmake_args+=(--debug-output)
 
 
     local num_procs
     local num_procs