Skip to content

Commit 7ded9dd

Browse files
committed
add linux to setup.py
1 parent 56309f4 commit 7ded9dd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def check_os(os_name):
4040
print("\nChecking System")
4141
print("===============\n")
4242
print(f" Operating System : {os_name}")
43-
supported = {"macOS"}
43+
supported = {"macOS", "Linux"}
4444
if os_name not in supported:
4545
print("Unsupported operating system")
4646
sys.exit(1)
@@ -51,9 +51,11 @@ def download_dawn(os_name):
5151

5252
outfile_map = {
5353
"macOS": "third_party/lib/libdawn.dylib"
54+
"Linux": "third_party/lib/libdawn.so",
5455
}
5556
url_map = {
5657
"macOS": "https://github.com/austinvhuang/dawn-artifacts/releases/download/prerelease/libdawn.dylib"
58+
"Linux": "https://github.com/austinvhuang/dawn-artifacts/releases/download/prerelease/libdawn.so",
5759
}
5860

5961
outfile = outfile_map.get(os_name)
@@ -87,6 +89,12 @@ def setup_env(os_name):
8789

8890
with open("source", "w") as f:
8991
f.write(f"export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:{lib_dir}\n")
92+
if os_name == "Linux":
93+
print(" Before running the program, run the following command or add it to your shell profile:")
94+
print(f" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{lib_dir}")
95+
96+
with open("source", "w") as f:
97+
f.write(f"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{lib_dir}\n")
9098

9199
def main():
92100
os_name = get_os_name()

0 commit comments

Comments
 (0)