Skip to content

Commit

Permalink
Set ExecutionPolicy directly when invoking Powershell scripts (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
CoffeeFlux authored Dec 3, 2023
1 parent c29c240 commit 7fbef41
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Prerequisites:
3. Python 3
4. Meson
5. CMake
6. Powershell execution policy set to Unrestricted

There are a few optional dependencies that must be installed and on your PATH:

Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ if host_machine.system() == 'windows'
endif

if host_machine.system() == 'windows'
version_sh = find_program('tools/version.ps1')
powershell_exe = find_program('powershell')
version_sh = [powershell_exe,
'-ExecutionPolicy', 'Bypass',
'-File', meson.current_source_dir() / 'tools' / 'version.ps1']
else
version_sh = find_program('tools/version.sh')
endif
Expand Down
10 changes: 8 additions & 2 deletions packages/meson.build
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
conf_pkg = configuration_data()

if host_machine.system() == 'windows'
installer_setup = find_program(meson.project_source_root() / 'tools/win-installer-setup.ps1')
installer_setup = [powershell_exe,
'-ExecutionPolicy', 'Bypass',
'-File', meson.project_source_root() / 'tools/win-installer-setup.ps1']
run_target('win-installer',
command: [installer_setup, meson.project_build_root(), meson.project_source_root()])
portable_setup = find_program(meson.project_source_root() / 'packages/win_installer/portable/create-portable.ps1')

portable_setup = [powershell_exe,
'-ExecutionPolicy', 'Bypass',
'-File', meson.project_source_root() / 'packages/win_installer/portable/create-portable.ps1']
run_target('win-portable', command: [portable_setup, meson.project_build_root(), meson.project_source_root()])
elif host_machine.system() == 'darwin'
fontconfig_conf = run_command('pkg-config', '--variable=confdir', 'fontconfig').stdout().strip()
bundle_app_sh = find_program(meson.project_source_root() / 'tools/osx-bundle.sh')
run_target('osx-bundle',
command: [bundle_app_sh, meson.project_source_root(), meson.project_build_root(), 'wx-config', fontconfig_conf, '',
get_option('build_osx_bundle') ? 'TRUE' : 'FALSE'])

build_dmg_sh = find_program(meson.project_source_root() / 'tools/osx-dmg.sh')
run_target('osx-build-dmg',
command: [build_dmg_sh, meson.project_source_root(), meson.project_build_root(), meson.project_version()])
Expand Down

0 comments on commit 7fbef41

Please sign in to comment.