Skip to content

Monorepo migration: restructure libraries and fix build/runtime#31

Merged
jlfarris91 merged 17 commits into
mainfrom
feature/monorepo-migration
May 18, 2026
Merged

Monorepo migration: restructure libraries and fix build/runtime#31
jlfarris91 merged 17 commits into
mainfrom
feature/monorepo-migration

Conversation

@jlfarris91
Copy link
Copy Markdown
Owner

Summary

  • Restructures the Phoenix monorepo into a proper multi-library layout with dot-notation CMake targets (Phoenix, Phoenix.Sim, Phoenix.Sim.RTS, etc.)
  • Extracts feature subsystems from the monolithic Phoenix.Sim into sibling static libraries: Blackboard, Debug, Tasks, ECS, LDS, Nav, Strings
  • Moves core utility headers from Phoenix.Sim into a new top-level Phoenix library
  • Imports Phoenix.App, Phoenix.Editor, and Phoenix.Runtime from PhoenixEditor repo
  • Fixes all three code-gen tools (APIGen, LuaGen, WasmGen) to WHOLEARCHIVE the full set of extracted feature libs so their TypeRegistries are complete
  • Fixes a startup crash in FeatureTask::Initialize caused by operator[] inserting an empty MethodDescriptor for TaskBase
  • Fixes PhoenixRTS VS debugger working directory

Test plan

  • cmake --preset windows && cmake --build .build/windows --config Debug --target PhoenixRTS builds clean
  • PhoenixRTS launches without crash
  • Phoenix.Debug Lua namespace is available at runtime (no attempt to index a nil value errors in Phoenix.log)
  • api.json contains all reflected types including feature lib types
  • host_api.h and lua_bridge.c contain phx_Phoenix_Debug_* symbols

🤖 Generated with Claude Code

jlfarris91 and others added 15 commits May 18, 2026 00:15
- src/PhoenixSim        → src/Phoenix.Sim
- src/PhoenixPhysics    → src/Phoenix.Sim.Physics
- src/PhoenixRTS        → src/Phoenix.Sim.RTS
- src/PhoenixSteering   → src/Phoenix.Sim.Steering
- src/PhoenixScript     → src/Phoenix.Sim.Script
- src/PhoenixLua        → src/Phoenix.Sim.Lua

Fix all CMakeLists.txt paths: replace CMAKE_SOURCE_DIR-based vcpkg_installed
includes with CMAKE_CURRENT_SOURCE_DIR-relative paths so the libraries work
correctly when consumed as a subdirectory of another project.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…xEditor

Monorepo consolidation — pulled source from the PhoenixEditor repo:

- src/Phoenix/              Phoenix reflection library (Phoenix.Reflection target)
- src/Phoenix.App/          App framework (PhoenixApp.Core target)
- src/Phoenix.Editor/Core/  Editor core (PhoenixEditor.Core target)
- src/Phoenix.Editor/ImGui/ ImGui backend (PhoenixEditor.ImGui target)
- src/Phoenix.Runtime/Core/ Runtime core (PhoenixRuntime.Core target)
- src/Phoenix.Runtime/SDL3/ SDL3 backend (PhoenixRuntime.SDL3 target)
- apps/Phoenix.Editor/      Standalone editor executable
- tests/Phoenix.Editor/     Editor unit tests
- config/                   Editor runtime config files

Merged vcpkg.json (name: phoenix, unified standalone/testapp/tests features).
Rewrote root CMakeLists.txt to cover all libraries, tools, apps, and tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Renamed all PhoenixXxx/ include prefixes to Phoenix.Xxx/ to match the
new dot-notation directory layout (Phoenix.Sim/, Phoenix.Sim.RTS/, etc.).
Also fixed namespace missing from Runtime.Core source files, added
PhoenixSim link to PhoenixRuntime.Core, and fixed Lua PCH path.

Tools: adds fix_includes.py for future reference.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the stale build artifact committed by mistake and updates the
DEFS_DEST path in TestRTS so generated Lua definitions land in the
correct dot-notation module directory.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phoenix.Editor/Core  → src/Phoenix.Editor
Phoenix.Editor/ImGui → src/Phoenix.Editor.ImGui
Phoenix.Runtime/Core → src/Phoenix.Runtime
Phoenix.Runtime/SDL3 → src/Phoenix.Runtime.SDL3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Libraries: PhoenixSim→Phoenix.Sim, PhoenixPhysics→Phoenix.Sim.Physics,
PhoenixRTS→Phoenix.Sim.RTS, PhoenixSteering→Phoenix.Sim.Steering,
PhoenixScript→Phoenix.Sim.Script, PhoenixLua→Phoenix.Sim.Lua,
PhoenixApp.Core→Phoenix.App, PhoenixEditor.Core→Phoenix.Editor,
PhoenixEditor.ImGui→Phoenix.Editor.ImGui, PhoenixRuntime.Core→Phoenix.Runtime,
PhoenixRuntime.SDL3→Phoenix.Runtime.SDL3.

Tools: PhoenixAPIGen→Phoenix.Tools.APIGen, PhoenixLuaGen→Phoenix.Tools.LuaGen,
PhoenixWasmGen→Phoenix.Tools.WasmGen (directories renamed to match).

Exe: PhoenixEditor→Phoenix.Editor.App (OUTPUT_NAME keeps binary as PhoenixEditor.exe).
Tests: PhoenixTests→Phoenix.Tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phoenix.Tools.APIGen, Phoenix.Tools.LuaGen, Phoenix.Tools.WasmGen moved
from tools/ to src/ alongside other projects.

PhoenixLuaRuntime moved to build/LuaRuntime — it is a CMake helper module
and emscripten build pipeline, not a native C++ project. Added README
explaining its role and the lua.wasm build pipeline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the editor app (Phoenix.Editor.App), Phoenix.Editor.ImGui, and
Phoenix.Runtime.SDL3 to the default local Windows build so they appear
as targets in Rider and VS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…RTS to apps/

Phoenix.Editor.App → PhoenixEditor
TestRTS → PhoenixRTS, relocated from tests/ to apps/PhoenixRTS

Dot-notation is now exclusively for linkable modules; executables use
flat PascalCase to make the distinction immediately clear.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consistent with the flat PascalCase naming convention for app executables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…braries

Phase A — Fix Phoenix core:
- Rename CMake target Phoenix.Reflection -> Phoenix
- Remove duplicate Reflection/ from Phoenix.Sim (kept Serialization.cpp/h)
- Have Phoenix.Sim link Phoenix for shared reflection types
- Fix all #include "Phoenix.Sim/Reflection/" -> "Phoenix/Reflection/" (233 files)

Phase B — Extract 7 feature projects from Phoenix.Sim:
- Phoenix.Sim/Blackboard -> src/Phoenix.Sim.Blackboard
- Phoenix.Sim/Strings    -> src/Phoenix.Sim.Strings
- Phoenix.Sim/Debug      -> src/Phoenix.Sim.Debug
- Phoenix.Sim/Mesh       -> src/Phoenix.Sim.Mesh
- Phoenix.Sim/Navigation -> src/Phoenix.Sim.Nav
- Phoenix.Sim/ECS        -> src/Phoenix.Sim.ECS (depends on Blackboard)
- Phoenix.Sim/LDS        -> src/Phoenix.Sim.LDS
Each has a new CMakeLists.txt and all include paths updated.

Phase C — Update build system:
- Root CMakeLists.txt: add_subdirectory for all 7 new projects
- Phoenix.Sim.Physics, .Steering, .RTS: explicit link deps for ECS/Debug/Nav/LDS
- apps/PhoenixRTS: explicit link for all consumed feature libs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rary

Relocates FixedPoint, Containers/MPMCQueue+Optional, CTZ, Corners, FPSCalc,
OffsetRef, Delegates, Logging, Profiling, Parallel, Color, MortonCode, Random,
Utils, and the platform implementation files from Phoenix.Sim into the Phoenix
core library. Phoenix.Sim now links Phoenix and uses include paths under
Phoenix/ for all moved headers.

Also fixes Phoenix.Sim.Mesh as an INTERFACE library (header-only, no .cpp),
adds Phoenix explicitly to Phoenix.Tools.APIGen link list, and fixes bare
relative includes of moved files found in Phoenix.App, Phoenix.Editor,
Phoenix.Sim, and PhoenixRTS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves FeatureTask, TaskBase, TaskDefinition, and TaskList out of Phoenix.Sim
into a new sibling library. Updates ECS, RTS, and PhoenixRTS CMakeLists to
link Phoenix.Sim.Tasks, and fixes all include paths from Phoenix.Sim/Tasks/
to Phoenix.Sim.Tasks/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After moving Blackboard, ECS, LDS, Tasks, Strings, and Debug out of
Phoenix.Sim, Phoenix.Tests was missing those libs and couldn't resolve
symbols from SimScriptBindings and test_lds_json.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix FeatureTask::Initialize crash: use find() instead of operator[]
  when looking up GetTaskDefinition — operator[] inserts an empty
  MethodDescriptor for TaskBase which has no such method, causing
  bad_function_call on Execute()
- Add all extracted feature libs (Blackboard, Debug, Tasks, ECS, LDS,
  Nav, Strings) to APIGen, LuaGen, and WasmGen with WHOLEARCHIVE so
  their TypeRegistries are complete and generated code (api.json,
  host_api.h, lua_bridge.c) includes all reflected types
- Fix PhoenixRTS VS debugger working directory (was pointing at
  tests/PhoenixRTS which does not exist; data files live in apps/PhoenixRTS)
- Rename PHXED_DECLARE_* delegate macros to PHX_DECLARE_* for
  consistent naming convention
- Regenerate Phoenix.d.lua with Phoenix.Debug namespace and new types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jlfarris91 jlfarris91 force-pushed the feature/monorepo-migration branch from 7279925 to 322901a Compare May 18, 2026 07:17
jlfarris91 and others added 2 commits May 18, 2026 00:24
Files added by the parallel work on main (InlineCallable.h,
ChaseLevDeque.h, MPMCQueue.h) still referenced "PhoenixSim/Platform.h"
— the pre-rename path. Update all three to "Phoenix/Platform.h".

PHX_CACHE_LINE_SIZE was added to Platform.h on main but the definition
was dropped during rebase when the file moved from Phoenix.Sim/ to
Phoenix/. Restore it (64 on x86-64, 128 on Apple Silicon).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update test files added by main that still referenced PhoenixSim/
  paths (renamed to Phoenix.Sim/ or Phoenix/):
    test_chase_lev_deque.cpp:  PhoenixSim/Containers/ChaseLevDeque.h
                            -> Phoenix.Sim/Containers/ChaseLevDeque.h
    test_inline_callable.cpp:  PhoenixSim/InlineCallable.h
                            -> Phoenix.Sim/InlineCallable.h
    test_parallel.cpp:         PhoenixSim/Parallel.h
                            -> Phoenix/Parallel.h
- Guard SDL3/imgui find_package with NOT EMSCRIPTEN — PHX_BUILD_TESTAPP
  defaults ON, causing SDL3 to be required during WASM configure even
  though apps/PhoenixRTS is already excluded for EMSCRIPTEN builds

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jlfarris91 jlfarris91 merged commit df29569 into main May 18, 2026
3 checks passed
@jlfarris91 jlfarris91 deleted the feature/monorepo-migration branch May 18, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant