first pass modernized build instructions, linux good, macos good, win fail

This commit is contained in:
Harvey Fong 2026-01-07 16:21:16 -07:00
parent 5e5e37de36
commit 3c6497ea90
4 changed files with 160 additions and 133 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2025 Harvey Fong Copyright (c) 2026 Harvey Fong
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -5,45 +5,44 @@ PLATFORM = $(shell uname)
BUILD_TYPE ?= release# Default to release build if not specified BUILD_TYPE ?= release# Default to release build if not specified
# Common paths # Common paths
BELLA_SDK_PATH = ../bella_engine_sdk BELLA_SDK_PATH = $(abspath ../bella_engine_sdk)
RAYGUI_PATH = ../raygui RAYGUI_PATH = $(abspath ../raygui)
RAYLIB_PATH = ../raylib RAYLIB_PATH = $(abspath ../raylib)
# Path to dynamic raylib library # Path to dynamic raylib library
RAYLIB_DYLIB_PATH = ../raylib/build/raylib RAYLIB_DYLIB_PATH = $(abspath ../raylib/build/raylib)
OBJ_DIR = obj/$(PLATFORM)/$(BUILD_TYPE) OBJ_DIR = obj/$(PLATFORM)/$(BUILD_TYPE)
BIN_DIR = bin/$(PLATFORM)/$(BUILD_TYPE) BIN_DIR = bin/$(PLATFORM)/$(BUILD_TYPE)
OUTPUT_FILE = $(BIN_DIR)/$(EXECUTABLE_NAME) OUTPUT_FILE = $(BIN_DIR)/$(EXECUTABLE_NAME)
# Platform-specific configuration # Platform-specific configuration
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
# macOS configuration SDK_LIB_EXT = dylib
SDK_LIB_EXT = dylib SDK_LIB_FILE = lib$(BELLA_SDK_NAME).$(SDK_LIB_EXT)
SDK_LIB_FILE = lib$(BELLA_SDK_NAME).$(SDK_LIB_EXT) # Dynamic raylib library
# Dynamic raylib library RAYLIB_LIB_NAME = libraylib.$(SDK_LIB_EXT)
RAYLIB_LIB_NAME = libraylib.$(SDK_LIB_EXT) MACOS_SDK_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
MACOS_SDK_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
# Compiler settings # Compiler settings
CC = clang CC = clang
CXX = clang++ CXX = clang++
# Architecture flags # Architecture flags
ARCH_FLAGS = -arch x86_64 -arch arm64 -mmacosx-version-min=15.0 -isysroot $(MACOS_SDK_PATH) ARCH_FLAGS = -arch x86_64 -arch arm64 -mmacosx-version-min=15.0 -isysroot $(MACOS_SDK_PATH)
# Include paths # Include paths
INCLUDE_PATHS = -I$(BELLA_SDK_PATH)/src \ INCLUDE_PATHS = -I$(BELLA_SDK_PATH)/src \
-I$(RAYGUI_PATH)/src \ -I$(RAYGUI_PATH)/src \
-I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src
# Library paths # Library paths
SDK_LIB_PATH = $(BELLA_SDK_PATH)/lib SDK_LIB_PATH = $(BELLA_SDK_PATH)/lib
# Updated path to dynamic raylib library # Updated path to dynamic raylib library
RAYLIB_LIB_PATH = $(RAYLIB_DYLIB_PATH) RAYLIB_LIB_PATH = $(RAYLIB_DYLIB_PATH)
LIB_PATHS = -L$(SDK_LIB_PATH) -L$(RAYLIB_LIB_PATH) LIB_PATHS = -L$(SDK_LIB_PATH) -L$(RAYLIB_LIB_PATH)
# Platform-specific libraries # Platform-specific libraries
# For dynamic library, we don't need to explicitly link all of raylib's dependencies # For dynamic library, we don't need to explicitly link all of raylib's dependencies
LIBRARIES = -l$(BELLA_SDK_NAME) \ LIBRARIES = -l$(BELLA_SDK_NAME) \
-lraylib \ -lraylib \
-lm \ -lm \
-ldl \ -ldl \
@ -55,8 +54,8 @@ ifeq ($(PLATFORM), Darwin)
-framework CoreVideo \ -framework CoreVideo \
-framework Foundation -framework Foundation
# Linking flags # Linking flags
LINKER_FLAGS = -mmacosx-version-min=15.0 \ LINKER_FLAGS = -mmacosx-version-min=15.0 \
-isysroot $(MACOS_SDK_PATH) \ -isysroot $(MACOS_SDK_PATH) \
-framework Cocoa \ -framework Cocoa \
-framework IOKit \ -framework IOKit \
@ -69,36 +68,36 @@ ifeq ($(PLATFORM), Darwin)
-rpath @loader_path \ -rpath @loader_path \
-weak_library $(SDK_LIB_PATH)/libvulkan.dylib -weak_library $(SDK_LIB_PATH)/libvulkan.dylib
else else
# Linux configuration # Linux configuration
SDK_LIB_EXT = so SDK_LIB_EXT = so
SDK_LIB_FILE = lib$(BELLA_SDK_NAME).$(SDK_LIB_EXT) SDK_LIB_FILE = lib$(BELLA_SDK_NAME).$(SDK_LIB_EXT)
# Dynamic raylib library # Dynamic raylib library
RAYLIB_LIB_NAME = libraylib.so.550 RAYLIB_LIB_NAME = libraylib.so.550
RAYLIB_LIB_SONAME = libraylib.so.550 RAYLIB_LIB_SONAME = libraylib.so.550
RAYLIB_LIB_LINK = libraylib.so RAYLIB_LIB_LINK = libraylib.so
# Compiler settings # Compiler settings
CC = gcc CC = gcc
CXX = g++ CXX = g++
# Architecture flags # Architecture flags
ARCH_FLAGS = -m64 -D_FILE_OFFSET_BITS=64 ARCH_FLAGS = -m64 -D_FILE_OFFSET_BITS=64
# Include paths # Include paths
INCLUDE_PATHS = -I$(BELLA_SDK_PATH)/src \ INCLUDE_PATHS = -I$(BELLA_SDK_PATH)/src \
-I$(RAYGUI_PATH)/src \ -I$(RAYGUI_PATH)/src \
-I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src
# Library paths # Library paths
SDK_LIB_PATH = $(BELLA_SDK_PATH)/lib SDK_LIB_PATH = $(BELLA_SDK_PATH)/lib
# Updated path to dynamic raylib library # Updated path to dynamic raylib library
RAYLIB_LIB_PATH = $(RAYLIB_DYLIB_PATH) RAYLIB_LIB_PATH = $(RAYLIB_DYLIB_PATH)
SYSTEM_LIB_PATH = /usr/lib/x86_64-linux-gnu/ SYSTEM_LIB_PATH = /usr/lib/x86_64-linux-gnu/
LIB_PATHS = -L$(SDK_LIB_PATH) -L$(RAYLIB_LIB_PATH) LIB_PATHS = -L$(SDK_LIB_PATH) -L$(RAYLIB_LIB_PATH)
# Platform-specific libraries # Platform-specific libraries
# For dynamic library, we don't need to explicitly link all dependencies of raylib # For dynamic library, we don't need to explicitly link all dependencies of raylib
LIBRARIES = -l$(BELLA_SDK_NAME) \ LIBRARIES = -l$(BELLA_SDK_NAME) \
-lraylib \ -lraylib \
-lm \ -lm \
-ldl \ -ldl \
@ -108,8 +107,8 @@ else
-lGL \ -lGL \
-lvulkan -lvulkan
# Linking flags # Linking flags
LINKER_FLAGS = -m64 \ LINKER_FLAGS = -m64 \
-fvisibility=hidden \ -fvisibility=hidden \
-O3 \ -O3 \
-Wl,-rpath,'$$ORIGIN' \ -Wl,-rpath,'$$ORIGIN' \
@ -118,19 +117,19 @@ endif
# Build type specific flags # Build type specific flags
ifeq ($(BUILD_TYPE), debug) ifeq ($(BUILD_TYPE), debug)
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED
else
CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED
else endif
CPP_DEFINES = -D_DEBUG -DDL_USE_SHARED COMMON_FLAGS = $(ARCH_FLAGS) -fvisibility=hidden -g -O0 $(INCLUDE_PATHS)
endif
COMMON_FLAGS = $(ARCH_FLAGS) -fvisibility=hidden -g -O0 $(INCLUDE_PATHS)
else else
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED
else else
CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED CPP_DEFINES = -DNDEBUG=1 -DDL_USE_SHARED
endif endif
COMMON_FLAGS = $(ARCH_FLAGS) -fvisibility=hidden -O3 $(INCLUDE_PATHS) COMMON_FLAGS = $(ARCH_FLAGS) -fvisibility=hidden -O3 $(INCLUDE_PATHS)
endif endif
# Language-specific flags # Language-specific flags
@ -150,14 +149,16 @@ $(OUTPUT_FILE): $(OBJECT_FILES)
@mkdir -p $(@D) @mkdir -p $(@D)
$(CXX) -o $@ $^ $(LINKER_FLAGS) $(LIB_PATHS) $(LIBRARIES) $(CXX) -o $@ $^ $(LINKER_FLAGS) $(LIB_PATHS) $(LIBRARIES)
@echo "Copying libraries to $(BIN_DIR)..." @echo "Copying libraries to $(BIN_DIR)..."
@cp $(SDK_LIB_PATH)/$(SDK_LIB_FILE) $(BIN_DIR)/$(SDK_LIB_FILE) # Copy raylib dylib files preserving symbolic links
# Copy bella and dl_usd_ms libraries to the binary directory
@cp -P $(SDK_LIB_PATH)/libbella_engine_sdk.$(SDK_LIB_EXT) $(BIN_DIR)/
@cp -P $(SDK_LIB_PATH)/libdl_usd_ms.$(SDK_LIB_EXT) $(BIN_DIR)/
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
@# Copy raylib dylib files preserving symbolic links
@cp -P $(RAYLIB_LIB_PATH)/libraylib.5.5.0.dylib $(BIN_DIR)/ @cp -P $(RAYLIB_LIB_PATH)/libraylib.5.5.0.dylib $(BIN_DIR)/
@cp -P $(RAYLIB_LIB_PATH)/libraylib.550.dylib $(BIN_DIR)/ @cp -P $(RAYLIB_LIB_PATH)/libraylib.550.dylib $(BIN_DIR)/
@cp -P $(RAYLIB_LIB_PATH)/libraylib.dylib $(BIN_DIR)/ @cp -P $(RAYLIB_LIB_PATH)/libraylib.dylib $(BIN_DIR)/
else else
@# Copy raylib shared library files for Linux
@cp $(RAYLIB_LIB_PATH)/$(RAYLIB_LIB_NAME) $(BIN_DIR)/ @cp $(RAYLIB_LIB_PATH)/$(RAYLIB_LIB_NAME) $(BIN_DIR)/
@ln -sf $(RAYLIB_LIB_NAME) $(BIN_DIR)/$(RAYLIB_LIB_LINK) @ln -sf $(RAYLIB_LIB_NAME) $(BIN_DIR)/$(RAYLIB_LIB_LINK)
endif endif
@ -171,6 +172,7 @@ clean:
rm -f $(OBJ_DIR)/*.o rm -f $(OBJ_DIR)/*.o
rm -f $(OUTPUT_FILE) rm -f $(OUTPUT_FILE)
rm -f $(BIN_DIR)/$(SDK_LIB_FILE) rm -f $(BIN_DIR)/$(SDK_LIB_FILE)
ifeq ($(PLATFORM), Darwin) ifeq ($(PLATFORM), Darwin)
rm -f $(BIN_DIR)/libraylib*.dylib rm -f $(BIN_DIR)/libraylib*.dylib
else else

149
README.md
View File

@ -13,82 +13,105 @@ workdir/
├── bella_engine_sdk/ ├── bella_engine_sdk/
├── raylib/ ├── raylib/
├── raygui/ ├── raygui/
└── poomer-raylib-bella_onimage/ ├── poomer-raylib-bella_onimage/
└── cmake/ (macos)
``` ```
# MacOS
# Ubuntu Linux x64
``` ```
cd ~ sudo apt install -y build-essential git cmake mesa-vulkan-drivers libgl1 libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev mesa-vulkan-drivers
mkdir workdir mkdir workdir && cd workdir
cd workdir mkdir raylib raygui poomer-raylib-bella_onimage
curl -LO https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-macos-universal.dmg
open cmake-3.31.6-macos-universal.dmg # Install Bella SDK
curl -LO https://downloads.bellarender.com/bella_engine_sdk-24.6.0.dmg wget https://downloads.bellarender.com/bella_engine_sdk-25.3.0-linux.tar.gz
hdiutil attach bella_engine_sdk-24.6.0.dmg tar -xvf bella_engine_sdk-25.3.0-linux.tar.gz
cp -R /Volumes/Bella\ Engine\ SDK\ 24.6.0/bella_engine_sdk .
git clone https://github.com/raysan5/raylib.git # Build raylib
mkdir -p raylib/build cd raylib
cd raylib/build git clone https://github.com/raysan5/raylib.git .
/Applications/CMake.app/Contents/bin/cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. cmake -B ./build -DBUILD_SHARED_LIBS=ON -DUSE_EXTERNAL_GLFW=OFF
make -j4 cmake --build ./build -j$(nproc)
cd ../..
# Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git git clone https://github.com/raysan5/raygui.git
# Build poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/oom.git git clone https://git.indoodle.com/oomer/oom.git
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git
cd poomer-raylib-bella_onimage cd poomer-raylib-bella_onimage
make git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
make -j$(nproc)
bin/Linux/release/poomer-raylib-bella_onimage
```
## MacOS x64 and arm64
```
# Install xcode
xcode-select --install
mkdir workdir && cd workdir
mkdir cmake raylib raygui poomer-raylib-bella_onimage
# Install Bella SDK
curl -O https://downloads.bellarender.com/bella_engine_sdk-25.3.0-macos.zip
unzip bella_engine_sdk-25.3.0-macos.zip
# Build cmake
cd cmake
git clone https://github.com/Kitware/CMake.git .
./configure
make -j$(sysctl -n hw.ncpu)
# Build raylib
cd ../raylib
git clone https://github.com/raysan5/raylib.git .
../cmake/bin/cmake -B ./build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
../cmake/bin/cmake --build ./build -j$(sysctl -n hw.ncpu)
# Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git
# Build poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/oom.git
cd ../poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
make -j$(sysctl -n hw.ncpu)
bin/Darwin/release/poomer-raylib-bella_onimage bin/Darwin/release/poomer-raylib-bella_onimage
``` ```
# Linux ## Windows x64
``` - Download Visual Studio Community Edition
sudo apt install -y build-essential curl git cmake - Run VisualStudioSetup.exe
sudo apt install -y libx11-dev - Workload = [x] Desktop development with C++
sudo apt install -y xorg-dev - Individual components = [x] Git For Windows
cd ~
mkdir workdir
cd workdir
curl -LO https://downloads.bellarender.com/bella_engine_sdk-24.6.0.tar.gz
tar -xvf bella_engine_sdk-24.6.0.tar.gz
git clone https://github.com/raysan5/raylib.git
mkdir -p raylib/build
cd raylib/build
cmake -DBUILD_SHARED_LIBS=ON -DUSE_EXTERNAL_GLFW=OFF ..
make -j4
cd ../..
git clone https://github.com/raysan5/raygui.git
git clone https://git.indoodle.com/oomer/oom.git
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git
cd poomer-raylib-bella_onimage
make
bin/Linux/release/poomer-raylib-bella_onimage -h
```
#### x64 Native Tools for VS
# Windows
- Install Visual Studio Community 2022
- Add Desktop development with C++ workload
- Launch x64 Native tools Command Prompt for VS2022
``` ```
cd %USERPROFILE% mkdir workdir && cd workdir
mkdir workdir mkdir raylib raygui poomer-raylib-bella_onimage
cd workdir
mkdir bella_engine_sdk # Install Bella SDK
cd bella_engine_sdk curl -O https://downloads.bellarender.com/bella_engine_sdk-25.3.0-win32.zip
curl -LO https://downloads.bellarender.com/bella_engine_sdk-24.6.0.zip tar -xf bella_engine_sdk-25.3.0-win32.zip
tar -xf bella_engine_sdk-24.6.0.zip
cd .. # Build raylib
git clone https://github.com/raysan5/raylib.git
cd raylib cd raylib
mkdir build git clone https://github.com/raysan5/raylib.git .
cd build cmake -B ./build
cmake .. #cd build
msbuild raylib.sln /p:Configuration=Release #msbuild raylib.sln /p:Configuration=Release
cd ../.. cmake --build ./build --config Release -j%NUMBER_OF_PROCESSORS%
#Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git git clone https://github.com/raysan5/raygui.git
# Build poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/oom.git git clone https://git.indoodle.com/oomer/oom.git
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git
cd poomer-raylib-bella_onimage cd poomer-raylib-bella_onimage
msbuild poomer-raylib-bella_onimage.vcxproj /p:Configuration=release /p:Platform=x64 /p:PlatformToolset=v143 git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
msbuild poomer-raylib-bella_onimage.vcxproj /p:Configuration=release
x64\release\poomer-raylib-bella_onimage.exe -h x64\release\poomer-raylib-bella_onimage.exe -h
``` ```

View File

@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PseudoDebug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PseudoDebug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@ -54,7 +54,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>lib;..\raylib\build\raylib\Release</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>lib;..\raylib\build\raylib\Release</AdditionalLibraryDirectories>
<AdditionalDependencies>bella_engine_sdk.lib;raylib.lib;Shlwapi.lib;vulkan-1.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>dl_usd_ms.lib;bella_engine_sdk.lib;raylib.lib;Shlwapi.lib;vulkan-1.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>vulkan-1.dll</DelayLoadDLLs> <DelayLoadDLLs>vulkan-1.dll</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
@ -95,6 +95,8 @@
<Command>echo Post-build event started &amp; <Command>echo Post-build event started &amp;
copy "$(ProjectDir)..\bella_engine_sdk\lib\bella_engine_sdk.dll" "$(TargetDir)" &amp; copy "$(ProjectDir)..\bella_engine_sdk\lib\bella_engine_sdk.dll" "$(TargetDir)" &amp;
echo bella_engine_sdk.dll copied &amp; echo bella_engine_sdk.dll copied &amp;
copy "$(ProjectDir)..\bella_engine_sdk\lib\dl_usd_ms.dll" "$(TargetDir)" &amp;
echo dl_usd_ms.dll copied &amp;
copy "$(ProjectDir)..\bella_engine_sdk\lib\dl_core.dll" "$(TargetDir)" &amp; copy "$(ProjectDir)..\bella_engine_sdk\lib\dl_core.dll" "$(TargetDir)" &amp;
echo dl_core.dll copied &amp; echo dl_core.dll copied &amp;
copy "$(ProjectDir)..\bella_engine_sdk\lib\dl_oidn_core.dll" "$(TargetDir)" &amp; copy "$(ProjectDir)..\bella_engine_sdk\lib\dl_oidn_core.dll" "$(TargetDir)" &amp;