collapse milepost/src to src/

This commit is contained in:
Martin Fouilleul 2023-08-09 17:49:22 +02:00
parent bfadcad7f3
commit 1c608aeda6
100 changed files with 54 additions and 55 deletions

View File

@ -14,7 +14,6 @@ fi
ORCA_DIR=../.. ORCA_DIR=../..
STDLIB_DIR=../../cstdlib STDLIB_DIR=../../cstdlib
ORCA_SDK_DIR=../../sdk ORCA_SDK_DIR=../../sdk
MILEPOST_DIR=../../milepost
python3 ../../scripts/embed_text_files.py --prefix=glsl_ --output src/glsl_shaders.h src/shaders/*.glsl python3 ../../scripts/embed_text_files.py --prefix=glsl_ --output src/glsl_shaders.h src/shaders/*.glsl
@ -29,7 +28,8 @@ wasmFlags="--target=wasm32 \
-D__ORCA__ \ -D__ORCA__ \
-I $STDLIB_DIR/include \ -I $STDLIB_DIR/include \
-I $ORCA_SDK_DIR \ -I $ORCA_SDK_DIR \
-I $ORCA_DIR/ext -I $MILEPOST_DIR -I $MILEPOST_DIR/src" -I $ORCA_DIR/ext \
-I $ORCA_DIR/src"
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c $CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c

View File

@ -14,7 +14,6 @@ fi
ORCA_DIR=../.. ORCA_DIR=../..
STDLIB_DIR=../../cstdlib STDLIB_DIR=../../cstdlib
ORCA_SDK_DIR=../../sdk ORCA_SDK_DIR=../../sdk
MILEPOST_DIR=../../milepost
wasmFlags="--target=wasm32 \ wasmFlags="--target=wasm32 \
--no-standard-libraries \ --no-standard-libraries \
@ -28,7 +27,7 @@ wasmFlags="--target=wasm32 \
-I $STDLIB_DIR/include \ -I $STDLIB_DIR/include \
-I $ORCA_SDK_DIR \ -I $ORCA_SDK_DIR \
-I $ORCA_DIR/ext \ -I $ORCA_DIR/ext \
-I $MILEPOST_DIR -I $MILEPOST_DIR/src" -I $ORCA_DIR/src"
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c $CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c

View File

@ -14,7 +14,6 @@ fi
ORCA_DIR=../.. ORCA_DIR=../..
STDLIB_DIR=../../cstdlib STDLIB_DIR=../../cstdlib
ORCA_SDK_DIR=../../sdk ORCA_SDK_DIR=../../sdk
MILEPOST_DIR=../../milepost
wasmFlags="--target=wasm32 \ wasmFlags="--target=wasm32 \
--no-standard-libraries \ --no-standard-libraries \
@ -28,7 +27,7 @@ wasmFlags="--target=wasm32 \
-I $STDLIB_DIR/include \ -I $STDLIB_DIR/include \
-I $ORCA_DIR/ext \ -I $ORCA_DIR/ext \
-I $ORCA_SDK_DIR \ -I $ORCA_SDK_DIR \
-I $MILEPOST_DIR/ext -I $MILEPOST_DIR -I $MILEPOST_DIR/src" -I $ORCA_DIR/src"
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c $CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c

View File

@ -12,6 +12,8 @@ else
fi fi
ORCA_DIR=../.. ORCA_DIR=../..
STDLIB_DIR=../../cstdlib
ORCA_SDK_DIR=../../sdk
wasmFlags="--target=wasm32 \ wasmFlags="--target=wasm32 \
--no-standard-libraries \ --no-standard-libraries \
@ -23,7 +25,10 @@ wasmFlags="--target=wasm32 \
-mbulk-memory \ -mbulk-memory \
-D__ORCA__ \ -D__ORCA__ \
-I $ORCA_DIR/ext \ -I $ORCA_DIR/ext \
-isystem ../../cstdlib/include -I ../../sdk -I../../milepost/ext -I ../../milepost -I ../../milepost/src" -I $STDLIB_DIR/include \
-I $ORCA_DIR/ext \
-I $ORCA_SDK_DIR \
-I $ORCA_DIR/src"
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c $CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c

View File

@ -67,7 +67,6 @@ def build_runtime(args):
def clean(args): def clean(args):
yeet("build") yeet("build")
yeet("milepost/build")
yeet("ext/angle") yeet("ext/angle")
yeet("scripts/files") yeet("scripts/files")
yeet("scripts/__pycache__") yeet("scripts/__pycache__")
@ -75,9 +74,9 @@ def clean(args):
def build_milepost(target, release): def build_milepost(target, release):
print("Building milepost...") print("Building milepost...")
with pushd("milepost"):
os.makedirs("../build/bin", exist_ok=True) os.makedirs("build/bin", exist_ok=True)
os.makedirs("../build/lib", exist_ok=True) os.makedirs("build/lib", exist_ok=True)
if target == "lib": if target == "lib":
if platform.system() == "Windows": if platform.system() == "Windows":
@ -100,25 +99,22 @@ def build_milepost(target, release):
def build_milepost_lib_win(release): def build_milepost_lib_win(release):
embed_text_files("src\\glsl_shaders.h", "glsl_", [ embed_text_files("src\\graphics\\glsl_shaders.h", "glsl_", [
"src\\glsl_shaders\\common.glsl", "src\\graphics\\glsl_shaders\\common.glsl",
"src\\glsl_shaders\\blit_vertex.glsl", "src\\graphics\\glsl_shaders\\blit_vertex.glsl",
"src\\glsl_shaders\\blit_fragment.glsl", "src\\graphics\\glsl_shaders\\blit_fragment.glsl",
"src\\glsl_shaders\\path_setup.glsl", "src\\graphics\\glsl_shaders\\path_setup.glsl",
"src\\glsl_shaders\\segment_setup.glsl", "src\\graphics\\glsl_shaders\\segment_setup.glsl",
"src\\glsl_shaders\\backprop.glsl", "src\\graphics\\glsl_shaders\\backprop.glsl",
"src\\glsl_shaders\\merge.glsl", "src\\graphics\\glsl_shaders\\merge.glsl",
"src\\glsl_shaders\\raster.glsl", "src\\graphics\\glsl_shaders\\raster.glsl",
"src\\glsl_shaders\\balance_workgroups.glsl", "src\\graphics\\glsl_shaders\\balance_workgroups.glsl",
]) ])
includes = [ includes = [
"/I", "src", "/I", "src",
"/I", "src/util",
"/I", "src/platform",
"/I", "ext", "/I", "ext",
"/I", "../ext", "/I", "ext/angle/include",
"/I", "../ext/angle/include",
] ]
libs = [ libs = [
"user32.lib", "user32.lib",
@ -131,7 +127,7 @@ def build_milepost_lib_win(release):
"ole32.lib", "ole32.lib",
"shell32.lib", "shell32.lib",
"shlwapi.lib", "shlwapi.lib",
"/LIBPATH:../ext/angle/bin", "/LIBPATH:ext/angle/bin",
"libEGL.dll.lib", "libEGL.dll.lib",
"libGLESv2.dll.lib", "libGLESv2.dll.lib",
"/DELAYLOAD:libEGL.dll", "/DELAYLOAD:libEGL.dll",
@ -148,8 +144,8 @@ def build_milepost_lib_win(release):
"/LD", "/link", "/LD", "/link",
"/MANIFEST:EMBED", "/MANIFESTINPUT:src/win32_manifest.xml", "/MANIFEST:EMBED", "/MANIFESTINPUT:src/win32_manifest.xml",
*libs, *libs,
"/OUT:../build/bin/milepost.dll", "/OUT:build/bin/milepost.dll",
"/IMPLIB:../build/bin/milepost.dll.lib", "/IMPLIB:build/bin/milepost.dll.lib",
], check=True) ], check=True)
@ -160,20 +156,20 @@ def build_milepost_lib_mac(release):
cflags = ["-std=c11"] cflags = ["-std=c11"]
debug_flags = ["-O3"] if release else ["-g", "-DDEBUG", "-DLOG_COMPILE_DEBUG"] debug_flags = ["-O3"] if release else ["-g", "-DDEBUG", "-DLOG_COMPILE_DEBUG"]
ldflags = [f"-L{sdk_dir}/usr/lib", f"-F{sdk_dir}/System/Library/Frameworks/"] ldflags = [f"-L{sdk_dir}/usr/lib", f"-F{sdk_dir}/System/Library/Frameworks/"]
includes = ["-Isrc", "-Isrc/util", "-Isrc/platform", "-Iext", "-I../ext", "-I../ext/angle/include"] includes = ["-Isrc", "-Isrc/util", "-Isrc/platform", "-Iext", "-Iext/angle/include"]
# compile metal shader # compile metal shader
subprocess.run([ subprocess.run([
"xcrun", "-sdk", "macosx", "metal", "xcrun", "-sdk", "macosx", "metal",
# TODO: shaderFlagParam # TODO: shaderFlagParam
"-fno-fast-math", "-c", "-fno-fast-math", "-c",
"-o", "../build/mtl_renderer.air", "-o", "build/mtl_renderer.air",
"src/graphics/mtl_renderer.metal", "src/graphics/mtl_renderer.metal",
], check=True) ], check=True)
subprocess.run([ subprocess.run([
"xcrun", "-sdk", "macosx", "metallib", "xcrun", "-sdk", "macosx", "metallib",
"-o", "../build/bin/mtl_renderer.metallib", "-o", "build/bin/mtl_renderer.metallib",
"../build/mtl_renderer.air", "build/mtl_renderer.air",
], check=True) ], check=True)
# compile milepost. We use one compilation unit for all C code, and one # compile milepost. We use one compilation unit for all C code, and one
@ -181,14 +177,14 @@ def build_milepost_lib_mac(release):
subprocess.run([ subprocess.run([
"clang", "clang",
*debug_flags, "-c", *debug_flags, "-c",
"-o", "../build/milepost_c.o", "-o", "build/milepost_c.o",
*cflags, *flags, *includes, *cflags, *flags, *includes,
"src/milepost.c" "src/milepost.c"
], check=True) ], check=True)
subprocess.run([ subprocess.run([
"clang", "clang",
*debug_flags, "-c", *debug_flags, "-c",
"-o", "../build/milepost_objc.o", "-o", "build/milepost_objc.o",
*flags, *includes, *flags, *includes,
"src/milepost.m" "src/milepost.m"
], check=True) ], check=True)
@ -197,9 +193,9 @@ def build_milepost_lib_mac(release):
subprocess.run([ subprocess.run([
"ld", "ld",
*ldflags, "-dylib", *ldflags, "-dylib",
"-o", "../build/bin/libmilepost.dylib", "-o", "build/bin/libmilepost.dylib",
"../build/milepost_c.o", "../build/milepost_objc.o", "build/milepost_c.o", "build/milepost_objc.o",
"-L../ext/angle/bin", "-lc", "-Lext/angle/bin", "-lc",
"-framework", "Carbon", "-framework", "Cocoa", "-framework", "Metal", "-framework", "QuartzCore", "-framework", "Carbon", "-framework", "Cocoa", "-framework", "Metal", "-framework", "QuartzCore",
"-weak-lEGL", "-weak-lGLESv2", "-weak-lEGL", "-weak-lGLESv2",
], check=True) ], check=True)
@ -208,12 +204,12 @@ def build_milepost_lib_mac(release):
subprocess.run([ subprocess.run([
"install_name_tool", "install_name_tool",
"-change", "./libEGL.dylib", "@rpath/libEGL.dylib", "-change", "./libEGL.dylib", "@rpath/libEGL.dylib",
"../build/bin/libmilepost.dylib", "build/bin/libmilepost.dylib",
], check=True) ], check=True)
subprocess.run([ subprocess.run([
"install_name_tool", "install_name_tool",
"-change", "./libGLESv2.dylib", "@rpath/libGLESv2.dylib", "-change", "./libGLESv2.dylib", "@rpath/libGLESv2.dylib",
"../build/bin/libmilepost.dylib", "build/bin/libmilepost.dylib",
], check=True) ], check=True)
# add executable path to rpath. Client executable can still add its own # add executable path to rpath. Client executable can still add its own
@ -221,7 +217,7 @@ def build_milepost_lib_mac(release):
subprocess.run([ subprocess.run([
"install_name_tool", "install_name_tool",
"-id", "@rpath/libmilepost.dylib", "-id", "@rpath/libmilepost.dylib",
"../build/bin/libmilepost.dylib", "build/bin/libmilepost.dylib",
], check=True) ], check=True)