forked from LeenkxTeam/LNXSDK
Update leenkx/blender/lnx/make.py
This commit is contained in:
parent
55fb300901
commit
979dfc605d
@ -694,8 +694,8 @@ def build_success():
|
||||
if wrd.lnx_audio == 'Disabled':
|
||||
cmd.append('--nosound')
|
||||
|
||||
elif state.target.startswith(('windows-hl', 'linux-hl', 'macos-hl', 'Hashlink')):
|
||||
log.info(f"Attempting to run Hashlink/C target: {state.target}")
|
||||
elif state.target.startswith(('windows-hl', 'linux-hl', 'macos-hl')):
|
||||
log.info(f"Runtime Hashlink/C target: {state.target}")
|
||||
|
||||
hl_build_dir, _, _ = lnx.utils.hashlink_paths(state.target)
|
||||
|
||||
@ -763,7 +763,6 @@ def build_success():
|
||||
if not compile_success:
|
||||
return
|
||||
|
||||
# Path is typically: <build_dir>/<Platform>/<Configuration>/<ProjectName>.exe
|
||||
exe_path = os.path.join(hl_build_dir, platform, build_mode, proj_name + '.exe')
|
||||
if not os.path.isfile(exe_path):
|
||||
exe_path = os.path.join(hl_build_dir, build_mode, proj_name + '.exe')
|
||||
@ -772,10 +771,17 @@ def build_success():
|
||||
return
|
||||
|
||||
log.info(f"Found compiled executable: {exe_path}")
|
||||
cmd = [exe_path]
|
||||
exe_dir = os.path.dirname(exe_path)
|
||||
log.info(f"Changing CWD to: {exe_dir}")
|
||||
os.chdir(exe_dir)
|
||||
|
||||
dest_exe_name = proj_name + '.exe'
|
||||
base_build_dir = lnx.utils.get_fp_build()
|
||||
dest_dir = os.path.join(base_build_dir, state.target)
|
||||
dest_path = os.path.join(dest_dir, dest_exe_name)
|
||||
try:
|
||||
shutil.move(exe_path, dest_path)
|
||||
cmd = [dest_path]
|
||||
except Exception as e:
|
||||
cmd = [exe_path]
|
||||
os.chdir(dest_dir)
|
||||
|
||||
elif state.target in ('linux-hl', 'macos-hl'):
|
||||
log.error(f"Compilation for {state.target} is not yet implemented in build_success.")
|
||||
@ -784,15 +790,6 @@ def build_success():
|
||||
log.error(f"Running logic for target {state.target} is not defined (expected Krom or Hashlink/C).")
|
||||
return
|
||||
|
||||
if cmd:
|
||||
log.info(f"Executing final command: {' '.join(cmd)}")
|
||||
try:
|
||||
state.proc_play = run_proc(cmd, play_done)
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
else:
|
||||
log.error("No command generated to run.")
|
||||
|
||||
try:
|
||||
state.proc_play = run_proc(cmd, play_done)
|
||||
except Exception:
|
||||
|
Loading…
x
Reference in New Issue
Block a user