Skip to content

Commit

Permalink
Update build.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jblindsay committed May 19, 2024
1 parent 6992c12 commit 07c56d9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def build(do_clean=False, exclude_runner=False, create_zip_artifact=False):
plugins_dir = os.path.join(app_dir, 'whitebox-plugins/src')

target_dir = os.path.join(app_dir, 'target/release')
# if platform.system() == "Linux":
# target_dir = os.path.join(app_dir, 'target/x86_64-unknown-linux-musl/release')
if platform.system() == "Linux":
target_dir = os.path.join(app_dir, 'target/x86_64-unknown-linux-musl/release')

if do_clean:
print("Cleaning old files...")
Expand All @@ -52,18 +52,18 @@ def build(do_clean=False, exclude_runner=False, create_zip_artifact=False):


print("Compiling...")
result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE)
if len(result.stdout) > 0:
print(result.stdout)
# if platform.system() != 'Linux':
# result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE)
# if len(result.stdout) > 0:
# print(result.stdout)
# else:
# print("Compiling for musl target...")
# result = subprocess.run(['cargo', 'build', "--release", "--target=x86_64-unknown-linux-musl"], stdout=subprocess.PIPE)
# if len(result.stdout) > 0:
# print(result.stdout)
# result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE)
# if len(result.stdout) > 0:
# print(result.stdout)
if platform.system() != 'Linux':
result = subprocess.run(['cargo', 'build', "--release"], stdout=subprocess.PIPE)
if len(result.stdout) > 0:
print(result.stdout)
else:
print("Compiling for musl target...")
result = subprocess.run(['cargo', 'build', "--release", "--target=x86_64-unknown-linux-musl"], stdout=subprocess.PIPE)
if len(result.stdout) > 0:
print(result.stdout)

if not os.path.exists(output_plugin_dir):
os.makedirs(output_plugin_dir)
Expand Down

0 comments on commit 07c56d9

Please sign in to comment.