Feature/oro 0 premake update#138
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Premake5-based build setup and related helper scripts to better separate generated build files (via --builddir), reduce duplicated Premake logic, and standardize naming/formatting across test/demo projects.
Changes:
- Reworked root
premake5.luato add--builddir/ warning-level options, centralize common link logic (linkVersionLib()), and align configurations (incl. RelWithDebInfo). - Updated multiple
premake5.luaproject files to use workspace-relativelocationand the shared Windows version-lib helper. - Tidied Python/shell/batch scripts for kernel baking/compilation and unit test execution; expanded
.gitignorefor generated outputs.
Reviewed changes
Copilot reviewed 36 out of 39 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
premake5.lua |
Major workspace/options refactor; adds --builddir, centralizes shared settings and project includes. |
Orochi/enable_cuew.lua |
Cleans CUDA path detection and switches to externalincludedirs for CUDA SDK includes. |
UnitTest/premake5.lua |
Renames UnitTest target and aligns to new workspace conventions (location/helper usage). |
UnitTest/main.cpp |
Minor whitespace cleanup. |
UnitTest/demosTest.cpp |
Uses BUILD_CONFIG for demo binary path construction. |
Test/premake5.lua |
Updates demo project location and Windows version-lib linking via helper. |
Test/DeviceEnum/premake5.lua |
Updates location and uses linkVersionLib(). |
Test/WMMA/premake5.lua |
Updates location and uses linkVersionLib(). |
Test/Texture/premake5.lua |
Updates location and uses linkVersionLib(). |
Test/RadixSort/premake5.lua |
Updates location and uses linkVersionLib(). |
Test/VulkanComputeSimple/premake5.lua |
Moves Windows-specific options/links behind a Windows filter block. |
Test/SimpleD3D12/premake5.lua |
Reformats and consolidates file/link lists; updates location. |
Test/SimpleD3D12/simpleD3D12.cpp |
Small safety refactors (avoid addresses of temporaries) and explicit casts. |
tools/stringify.py |
Refactors into functions/main; improves readability and CLI handling. |
tools/genArgs.py |
Refactors into functions/main; standardizes parsing and output. |
tools/bakeKernel.sh |
Adds shebang/comments; keeps kernel baking flow. |
tools/bakeKernel.bat |
Adds header/comments; keeps kernel baking flow. |
scripts/unittest.sh |
Adds config selection and consistent naming for UnitTest target execution. |
scripts/unittest.bat |
Adds config parsing/suffix handling for UnitTest target execution. |
scripts/unittest_vega20.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_vega20.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/unittest_vega10.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_vega10.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/unittest_navi2.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_navi2.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/unittest_navi1.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_navi1.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/unittest_gfx1102.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_gfx1102.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/unittest_gfx1100.sh |
Adds config selection and consistent UnitTest target naming. |
scripts/unittest_gfx1100.bat |
Adds config parsing/suffix handling and updates UnitTest target name. |
scripts/kernelCompile.py |
Refactors kernel compilation script into functions/main and standardizes subprocess usage. |
scripts/enumArch.py |
Refactors architecture enumeration and improves parsing/readability. |
scripts/create_archive.cmake |
Cleans formatting and clarifies variable expectations. |
scripts/convert_binary_to_array.py |
Refactors into functions/main and clarifies CLI/metadata output. |
scripts/amdGpuList.json |
Adds additional AMD gfx targets. |
.gitignore |
Expands ignored generated artifacts and organizes ignore rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if _OPTIONS["bakeKernel"] then | ||
| if os.ishost("windows") then | ||
| os.execute("%[./tools/bakeKernel.bat]") | ||
| else | ||
| os.execute("%[./tools/bakeKernel.sh]") | ||
| end | ||
| end |
| set CONFIG=%1 | ||
| if "%CONFIG%"=="" set CONFIG=Release | ||
| set SUFFIX= | ||
| if "%CONFIG%"=="Debug" set SUFFIX=D | ||
|
|
||
| rd /s /q cache | ||
| ..\dist\bin\Release\Unittest64.exe --gtest_filter=-*link_bundledBc*:*VulkanComputeSimple64* --gtest_output=xml:../result.xml | ||
| ..\dist\bin\Release\UnitTest64.exe --gtest_filter=-*link_bundledBc*:*VulkanComputeSimple64* --gtest_output=xml:../result.xml |
There was a problem hiding this comment.
Fixed in the latest commit — the hard-coded Release path and bare UnitTest64.exe are now replaced with ..\dist\bin\%CONFIG%\UnitTest64%SUFFIX%.exe, so unittest.bat Debug correctly runs the Debug binary and unittest.bat RelWithDebInfo runs the RelWithDebInfo binary.
| if _OPTIONS["kernelcompile"] then | ||
| os.execute("cd ./bitcodes/ && generate_bitcodes.bat") | ||
| os.execute("cd ./bitcodes/ && generate_bitcodes_nvidia.bat") | ||
| end |
| process = subprocess.Popen( | ||
| ['llc', '-march=amdgcn', '-mcpu=help'], | ||
| shell=True, | ||
| stdout=subprocess.PIPE, | ||
| stderr=subprocess.PIPE | ||
| ) |
| print(" ".join(command)) | ||
|
|
||
| use_shell = (os.name == 'nt') | ||
| return subprocess.Popen(command, shell=use_shell) |
| """Stringify GPU kernel source files into C++ string literals. | ||
|
|
||
| Reads kernel source files and converts them into C++ const char* variables | ||
| that can be compiled directly into the binary. | ||
|
|
||
| Usage: | ||
| python stringify.py <kernel_file> [encryption_key] | ||
| """ |
| def main(): | ||
| if len(sys.argv) < 2: | ||
| print("Usage: {} <kernel_file> [encryption_key]".format(sys.argv[0]), file=sys.stderr) | ||
| sys.exit(1) |
Summary
Refactor and clean up the Premake5 build configuration. No changes to Orochi library code or public APIs.
Changes
--builddiroption — generated project files and intermediate artifacts are now written to the path specified by--builddir(defaults to the project root), keeping the working tree clean.copydirhelper, dead options and files; aligned indentation, descriptions, and option names across allpremake5.luafiles.scripts/andtools/Python and shell scripts tidied: consistent argument parsing, removed dead code, minor portability fixes..gitignoreexpanded — additional generated paths covered so they are not accidentally staged.Testing
Build scripts verified on Linux. No Orochi source files were modified.