Merge branch 'main' into superpong

This commit is contained in:
martinfouilleul 2023-07-05 18:13:21 +02:00
commit 4578c8d767
2 changed files with 18 additions and 12 deletions

View File

@ -5,13 +5,13 @@ set wasmFlags=--target=wasm32^
--no-standard-libraries ^ --no-standard-libraries ^
-fno-builtin ^ -fno-builtin ^
-Wl,--no-entry ^ -Wl,--no-entry ^
-Wl,--export-all ^ -Wl,--export-dynamic ^
-Wl,--allow-undefined ^
-g ^ -g ^
-O2 ^
-mbulk-memory ^
-D__ORCA__ ^ -D__ORCA__ ^
-I ..\.. -I ..\..\src -I ..\..\sdk -I..\..\milepost -I ..\..\milepost\src -isystem ..\..\cstdlib\include -I ..\..\sdk -I..\..\milepost\ext -I ..\..\milepost -I ..\..\milepost\src
clang %wasmFlags% -o .\module.wasm ..\..\sdk\orca.c src\main.c clang %wasmFlags% -o .\module.wasm ..\..\sdk\orca.c ..\..\cstdlib\src\*.c src\main.c
python3 ..\..\scripts\mkapp.py --orca-dir ..\.. --name Pong --icon icon.png --resource-dir data module.wasm
python3 ..\..\scripts\mkapp.py --orca-dir ../.. --name Pong --icon icon.png --data-dir dir1 module.wasm

View File

@ -184,15 +184,21 @@ def windows_make_app(args):
#----------------------------------------------------------- #-----------------------------------------------------------
#NOTE: copy wasm module and data #NOTE: copy wasm module and data
#----------------------------------------------------------- #-----------------------------------------------------------
shutil.copy(args.module, wasm_dir + '/module.wasm') shutil.copy(args.module, wasm_dir + '/module.wasm')
if args.data_files != None: if args.resource_files != None:
for data in args.data_files: for resource in args.resource_files:
shutil.copy(data, data_dir) shutil.copytree(resource, data_dir + '/' + os.path.basename(resource), dirs_exist_ok=True)
if args.data_dirs != None: if args.resource_dirs != None:
for data in args.data_dirs: for resource_dir in args.resource_dirs:
shutil.copytree(data, data_dir + '/' + os.path.basename(data), dirs_exist_ok=True) for resource in os.listdir(resource_dir):
src = resource_dir + '/' + resource
if os.path.isdir(src):
shutil.copytree(src, data_dir + '/' + os.path.basename(resource), dirs_exist_ok=True)
else:
shutil.copy(src, data_dir)
#----------------------------------------------------------- #-----------------------------------------------------------
#NOTE: copy runtime resources #NOTE: copy runtime resources