From 9944853102160d1f98a875ec36799b54b7d2190d Mon Sep 17 00:00:00 2001 From: Robear Selwans Date: Mon, 8 Mar 2021 20:05:50 +0200 Subject: [PATCH] Added buildscripts for Windows * lua51.dll copy * evol.dll copy --- buildscripts/evoldllcopy.ps1 | 3 +++ buildscripts/luadllcopy.ps1 | 4 ++++ meson.build | 19 +++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 buildscripts/evoldllcopy.ps1 create mode 100644 buildscripts/luadllcopy.ps1 diff --git a/buildscripts/evoldllcopy.ps1 b/buildscripts/evoldllcopy.ps1 new file mode 100644 index 0000000..0142347 --- /dev/null +++ b/buildscripts/evoldllcopy.ps1 @@ -0,0 +1,3 @@ +$builddir=$args[0] # root build directory + +cp $builddir/subprojects/evol/evol.dll -Destination $builddir \ No newline at end of file diff --git a/buildscripts/luadllcopy.ps1 b/buildscripts/luadllcopy.ps1 new file mode 100644 index 0000000..c25700f --- /dev/null +++ b/buildscripts/luadllcopy.ps1 @@ -0,0 +1,4 @@ +$sourcedir=$args[0] # root source directory +$builddir=$args[1] # root build directory + +cp $sourcedir/subprojects/luajit/src/lua51.dll -Destination $builddir diff --git a/meson.build b/meson.build index 728fcc6..813f74f 100644 --- a/meson.build +++ b/meson.build @@ -4,6 +4,7 @@ project('evol-sandbox', 'c', add_global_arguments('-fms-extensions', '-DEV_APP_CONFIG="' + meson.current_source_dir() + '/appconfig.meta"', language: 'c') +evol_subproj = subproject('evol') evol_dep = dependency('evol') subproject('evmod_glfw') @@ -13,7 +14,21 @@ sandbox_incdir = [] configure_file(input: 'config.lua', output: 'config.lua', copy: true) -exe = executable( +if build_machine.system() == 'windows' + # evol dll needs to be copied for each build + evoldllcopy = custom_target( + 'evolDLLCopy', + depends: evol_subproj.get_variable('evol_lib'), + output: 'evolDLL', + command: ['powershell.exe', meson.current_source_dir() + '/buildscripts/evoldllcopy.ps1', meson.project_build_root()], + build_by_default: true, + ) + + # lua dll only needs to be copied in the environment setup + run_command('powershell.exe', meson.current_source_dir() + '/buildscripts/luadllcopy.ps1', meson.project_source_root(), meson.project_build_root()) +endif + +sandbox_exe = executable( 'sandbox', 'src/main.c', dependencies: [ @@ -24,4 +39,4 @@ exe = executable( include_directories: sandbox_incdir, ) -test('basic', exe) +