You've already forked flecs_tests
Makefile working with imgui
This commit is contained in:
50
fetch_libs.sh
Normal file
50
fetch_libs.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
LIB_DIR="lib"
|
||||
|
||||
echo "=== Fetching library dependencies ==="
|
||||
|
||||
# 1. Sokol (single-file headers)
|
||||
mkdir -p "$LIB_DIR/sokol"
|
||||
mkdir -p "$LIB_DIR/imgui"
|
||||
mkdir -p "$LIB_DIR/util"
|
||||
|
||||
if [ ! -f "$LIB_DIR/sokol/sokol_gfx.h" ]; then
|
||||
echo " > Fetching sokol (pinned to emdawnwebgpu-compatible version)..."
|
||||
git clone --depth 500 https://github.com/floooh/sokol.git "$LIB_DIR/sokol_tmp"
|
||||
git -C "$LIB_DIR/sokol_tmp" checkout 36debc7
|
||||
cp "$LIB_DIR/sokol_tmp"/*.h "$LIB_DIR/sokol/"
|
||||
cp "$LIB_DIR/sokol_tmp"/util/*.h "$LIB_DIR/util/" 2>/dev/null || true
|
||||
rm -rf "$LIB_DIR/sokol_tmp"
|
||||
else
|
||||
echo " > Sokol already present"
|
||||
fi
|
||||
|
||||
# 2. Dear ImGui
|
||||
if [ ! -f "$LIB_DIR/imgui/imgui/imgui.cpp" ]; then
|
||||
echo " > Fetching Dear ImGui..."
|
||||
mkdir -p "$LIB_DIR/imgui/imgui"
|
||||
git clone --depth 1 --branch v1.92.7-docking https://github.com/ocornut/imgui.git "$LIB_DIR/imgui_src"
|
||||
cp "$LIB_DIR/imgui_src"/*.cpp "$LIB_DIR/imgui/imgui/"
|
||||
cp "$LIB_DIR/imgui_src"/*.h "$LIB_DIR/imgui/imgui/"
|
||||
rm -rf "$LIB_DIR/imgui_src"
|
||||
else
|
||||
echo " > Dear ImGui already present"
|
||||
fi
|
||||
|
||||
# 3. cimgui
|
||||
if [ ! -f "$LIB_DIR/imgui/cimgui.cpp" ]; then
|
||||
echo " > Fetching cimgui..."
|
||||
git clone --depth 1 https://github.com/cimgui/cimgui.git "$LIB_DIR/cimgui_tmp"
|
||||
cp "$LIB_DIR/cimgui_tmp/cimgui.h" "$LIB_DIR/imgui/"
|
||||
cp "$LIB_DIR/cimgui_tmp/cimgui.cpp" "$LIB_DIR/imgui/"
|
||||
cp "$LIB_DIR/cimgui_tmp/cimconfig.h" "$LIB_DIR/imgui/"
|
||||
cp "$LIB_DIR/cimgui_tmp/cimgui_impl.h" "$LIB_DIR/imgui/"
|
||||
cp "$LIB_DIR/cimgui_tmp/cimgui_impl.cpp" "$LIB_DIR/imgui/"
|
||||
rm -rf "$LIB_DIR/cimgui_tmp"
|
||||
else
|
||||
echo " > cimgui already present"
|
||||
fi
|
||||
|
||||
echo "=== Done ==="
|
||||
Reference in New Issue
Block a user