Skip to content

Commit

Permalink
Gate appending electron by meson feature
Browse files Browse the repository at this point in the history
  • Loading branch information
gasinvein committed Jun 9, 2024
1 parent 2a874d0 commit 4965f57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ function update_display_server_args () {
fi
fi

# shellcheck disable=SC2050
if [ "@ELECTRON_ENABLED@" -eq 0 ]; then
return 0
fi

if [ -e "$wayland_socket" ]; then
DISPLAY_SERVER_ARGS=(
"--ozone-platform=wayland"
Expand Down
5 changes: 5 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ else
sdk_version = get_option('sdk_version')
endif

feature_electron = get_option('electron').enable_if(
get_option('zypak').enabled()
)

editor_args = []
foreach arg : get_option('editor_args')
editor_args += '"@0@"'.format(arg)
Expand Down Expand Up @@ -67,6 +71,7 @@ wrapper_data = configuration_data({
'WRAPPER_PATH': wrapper_path,
'EDITOR_BINARY': editor_path,
'EDITOR_ARGS': ' '.join(editor_args),
'ELECTRON_ENABLED': feature_electron.enabled().to_int(),
'ZYPAK_ARGS': ' '.join(zypak_args),
'EXPORT_ENVS': ' && '.join(export_envs),
'EXPORT_ENVS_INNER': ' && '.join(export_envs_inner),
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ option('first_run_template', type: 'string', value: 'first_run.txt')
option('sdk_update_template', type: 'string', value: 'sdk_update.txt')
option('flagfile_prefix', type: 'string', value: 'flatpak-vscode')
option('default_loglevel', type: 'string', value: '1')
option('electron', type: 'feature', value: 'auto')
option('zypak', type: 'feature', value: 'disabled')
option('zypak_args', type: 'array', value: ['host'])
option('envs', type: 'array', value: [])
Expand Down

0 comments on commit 4965f57

Please sign in to comment.