Created
December 1, 2022 00:50
-
-
Save sonygod/2f51626a24363b23c9eaa6008d216e6f to your computer and use it in GitHub Desktop.
scons build wasm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Author: sonygod [email protected] | |
Date: 2022-11-29 14:31:23 | |
LastEditors: sonygod [email protected] | |
LastEditTime: 2022-11-29 15:07:59 | |
FilePath: \haxec\SConstruct | |
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE | |
''' | |
print("... Hello, Scons !") | |
import os; | |
env = Environment() | |
env.Append(CPPPATH = ["./src"]); | |
env.Append(LINKFLAGS = ['-s', 'EXPORTED_FUNCTIONS=\'["_malloc","_free","_get_minicycles","_is_planar"]\'']); | |
# -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' | |
env.Append(LINKFLAGS = ['-s', 'EXPORTED_RUNTIME_METHODS=\'["ccall", "cwrap"]\'']); | |
#-s ENVIRONMENT=web | |
env.Append(LINKFLAGS = ['-s', 'ENVIRONMENT=web']); | |
# -s EXPORT_ES6=1 | |
env.Append(LINKFLAGS = ['-s', 'EXPORT_ES6=1']); | |
# -s MODULARIZE=1 | |
env.Append(LINKFLAGS = ['-s', 'MODULARIZE=1']); | |
#-s MALLOC=emmalloc | |
env.Append(LINKFLAGS = ['-s', 'MALLOC=emmalloc']); | |
#-s ALLOW_MEMORY_GROWTH | |
env.Append(LINKFLAGS = ['-s', 'ALLOW_MEMORY_GROWTH']); | |
env.Append(LINKFLAGS = ['-O3']); | |
os.environ["EMSCRIPTEN_ROOT"] = "/root/emsdk/upstream/emscripten" | |
env.Tool("emscripten", toolpath = ["/root/emsdk/upstream/emscripten/tools/scons/site_scons/site_tools/emscripten"]) | |
env.Program(target="bin/LoadWASM", source=["src/Wasm_MiniCycles.cpp"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment