diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e7d82f4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: ci +on: [push] + +jobs: + build-win_x64: + strategy: + matrix: + configuration: [release, debug] + + name: build (win_x64) + runs-on: windows-latest + + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v3 + name: Clone repository + with: + submodules: recursive + + - uses: msys2/setup-msys2@v2 + name: Set up MSYS2 + with: + msystem: mingw64 + install: >- + mingw-w64-x86_64-gcc + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ninja + mingw-w64-x86_64-boost + mingw-w64-x86_64-pugixml + mingw-w64-x86_64-ogre3d + mingw-w64-x86_64-qt6 + + - name: Generate Ninja build files + run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration == 'release' && 'MinSizeRel' || 'Debug' }} . + + - name: Build (Ninja) + run: ninja -C build + + # ouch - unless and until we start using CMake's install command, these next few commands are a necessary evil + - name: Organize binaries + run: mkdir build/dist && mv build/*.exe build/dist && cd build/dist && for x in *.exe; do mv $x "RNR.$x"; done && cd ../../ + + - name: Add Qt dependencies + run: windeployqt6 build/dist/*.exe + + - name: Add runtime dependencies + run: ldd build/dist/*.exe | grep "=> /" | awk '{print $3}' | grep "mingw64" | xargs -I '{}' cp -v '{}' build/dist + + - name: Add OGRE plugins + run: cp Content/win32_plugins.cfg build/dist/plugins.cfg && mkdir build/dist/plugins/ && cat build/dist/plugins.cfg | grep "Plugin=" | sed -e "s/Plugin=//" | xargs -I '{}' cp -v '/mingw64/bin/{}.dll' build/dist/plugins/ + + - name: Add OGRE shaders + run: mkdir build/dist/ShaderCache && mkdir build/dist/shaders && cp -R /mingw64/share/OGRE/Media/Main build/dist/shaders && cp -R /mingw64/share/OGRE/Media/RTShaderLib build/dist/shaders + + - name: Add resources + run: cp -R Content/RNR build/dist/content && cp LICENSE build/dist + + - name: Set output variables + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: RNR (${{ steps.vars.outputs.sha_short }}-${{ matrix.configuration }}-win_x64) + path: build/dist \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 33e7535..d52826e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,5 +15,6 @@ add_compile_options(-Wno-attributes -Wno-return-type) # Ignore warnings generate find_package(Boost REQUIRED) find_package(OGRE REQUIRED COMPONENTS Bites CONFIG) +find_package(pugixml REQUIRED) add_subdirectory(Projects) \ No newline at end of file diff --git a/Content/linux_plugins.cfg b/Content/linux_plugins.cfg index b8eb61d..8bb32f8 100644 --- a/Content/linux_plugins.cfg +++ b/Content/linux_plugins.cfg @@ -1,27 +1,12 @@ -# Defines plugins to load - -# Define plugin folder PluginFolder=/usr/lib/OGRE -# Define plugins -# Plugin=RenderSystem_Direct3D9 -# Plugin=RenderSystem_Direct3D11 - Plugin=RenderSystem_GL - Plugin=RenderSystem_GL3Plus - Plugin=RenderSystem_GLES2 -# Plugin=RenderSystem_Metal -# Plugin=RenderSystem_Tiny -# Plugin=RenderSystem_Vulkan - Plugin=Plugin_ParticleFX - Plugin=Plugin_BSPSceneManager -# Plugin=Plugin_CgProgramManager -# Plugin=Plugin_GLSLangProgramManager -# Plugin=Codec_EXR - Plugin=Codec_STBI -# Plugin=Codec_RsImage -# Plugin=Codec_FreeImage - Plugin=Plugin_PCZSceneManager - Plugin=Plugin_OctreeZone - Plugin=Plugin_OctreeSceneManager - Plugin=Plugin_DotScene -# Plugin=Codec_Assimp +Plugin=RenderSystem_GL +Plugin=RenderSystem_GL3Plus +Plugin=RenderSystem_GLES2 +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Codec_STBI +Plugin=Plugin_PCZSceneManager +Plugin=Plugin_OctreeZone +Plugin=Plugin_OctreeSceneManager +Plugin=Plugin_DotScene \ No newline at end of file diff --git a/Content/win32_plugins.cfg b/Content/win32_plugins.cfg index 20178ba..36d176b 100644 --- a/Content/win32_plugins.cfg +++ b/Content/win32_plugins.cfg @@ -1,27 +1,11 @@ -# Defines plugins to load - -# Define plugin folder PluginFolder=plugins -# Define plugins - Plugin=RenderSystem_Direct3D9 - Plugin=RenderSystem_Direct3D11 - Plugin=RenderSystem_GL - Plugin=RenderSystem_GL3Plus - Plugin=RenderSystem_GLES2 -# Plugin=RenderSystem_Metal -# Plugin=RenderSystem_Tiny -# Plugin=RenderSystem_Vulkan - Plugin=Plugin_ParticleFX - Plugin=Plugin_BSPSceneManager -# Plugin=Plugin_CgProgramManager -# Plugin=Plugin_GLSLangProgramManager -# Plugin=Codec_EXR - Plugin=Codec_STBI -# Plugin=Codec_RsImage -# Plugin=Codec_FreeImage - Plugin=Plugin_PCZSceneManager - Plugin=Plugin_OctreeZone - Plugin=Plugin_OctreeSceneManager -# Plugin=Plugin_DotScene -# Plugin=Codec_Assimp +Plugin=RenderSystem_GL +Plugin=RenderSystem_GL3Plus +Plugin=RenderSystem_GLES2 +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Codec_STBI +Plugin=Plugin_PCZSceneManager +Plugin=Plugin_OctreeZone +Plugin=Plugin_OctreeSceneManager diff --git a/Projects/Client/Player/CMakeLists.txt b/Projects/Client/Player/CMakeLists.txt index 868164f..798c405 100644 --- a/Projects/Client/Player/CMakeLists.txt +++ b/Projects/Client/Player/CMakeLists.txt @@ -18,13 +18,6 @@ endif() qt_add_executable(Player ${SOURCE} ${HEADER}) -if(MINGW) - add_custom_command(TARGET Player POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS - ) -endif() - target_include_directories(Player PRIVATE Header) target_link_libraries(Player PRIVATE Common Engine) diff --git a/Projects/Client/Server/CMakeLists.txt b/Projects/Client/Server/CMakeLists.txt index f47982f..9b42ddc 100644 --- a/Projects/Client/Server/CMakeLists.txt +++ b/Projects/Client/Server/CMakeLists.txt @@ -9,12 +9,5 @@ endif() add_executable(Server ${SOURCE} ${HEADER}) -if(MINGW) - add_custom_command(TARGET Server POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS - ) -endif() - target_include_directories(Server PRIVATE Header) target_link_libraries(Server PRIVATE Engine) \ No newline at end of file diff --git a/Projects/Client/Studio/CMakeLists.txt b/Projects/Client/Studio/CMakeLists.txt index 6866b77..d484964 100644 --- a/Projects/Client/Studio/CMakeLists.txt +++ b/Projects/Client/Studio/CMakeLists.txt @@ -20,20 +20,10 @@ endif() qt_add_executable(Studio ${SOURCE} ${HEADER}) -if(MINGW) - add_custom_command(TARGET Studio POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy -t $ $ - COMMAND_EXPAND_LISTS - ) -endif() - target_include_directories(Studio PRIVATE Header) target_link_libraries(Studio PRIVATE Common Engine) set_target_properties(Studio PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON -) - -install(TARGETS Studio - RUNTIME_DEPENDENCIES) \ No newline at end of file +) \ No newline at end of file diff --git a/Projects/Engine/CMakeLists.txt b/Projects/Engine/CMakeLists.txt index 8b60705..644915a 100644 --- a/Projects/Engine/CMakeLists.txt +++ b/Projects/Engine/CMakeLists.txt @@ -48,21 +48,5 @@ add_library(Engine STATIC Source/Rendering/Adorn.cpp ) -find_package(pugixml REQUIRED) - target_include_directories(Engine PUBLIC ${BOOST_INCLUDE_DIRS} Header/) -target_link_libraries(Engine PUBLIC ${BOOST_LIBRARIES} pugixml OgreBites Luau.Analysis Luau.Ast Luau.Compiler Luau.VM) - -if(WIN32 OR MINGW) - file(COPY ${CMAKE_SOURCE_DIR}/Content/win32_plugins.cfg DESTINATION ${CMAKE_BINARY_DIR}) - file(RENAME ${CMAKE_BINARY_DIR}/win32_plugins.cfg ${CMAKE_BINARY_DIR}/plugins.cfg) - file(COPY ${OGRE_PLUGIN_DIR}/ DESTINATION ${CMAKE_BINARY_DIR}/plugins) -elseif(UNIX) - file(COPY ${CMAKE_SOURCE_DIR}/Content/linux_plugins.cfg DESTINATION ${CMAKE_BINARY_DIR}) - file(RENAME ${CMAKE_BINARY_DIR}/linux_plugins.cfg ${CMAKE_BINARY_DIR}/plugins.cfg) - file(COPY ${OGRE_PLUGIN_DIR}/ DESTINATION ${CMAKE_BINARY_DIR}/plugins) -endif() - -file(COPY ${CMAKE_SOURCE_DIR}/Content/RNR/ DESTINATION ${CMAKE_BINARY_DIR}/content) -file(COPY ${OGRE_MEDIA_DIR}/Main/ DESTINATION ${CMAKE_BINARY_DIR}/shaders) -file(COPY ${OGRE_MEDIA_DIR}/RTShaderLib/ DESTINATION ${CMAKE_BINARY_DIR}/shaders) \ No newline at end of file +target_link_libraries(Engine PUBLIC ${BOOST_LIBRARIES} pugixml OgreBites Luau.Analysis Luau.Ast Luau.Compiler Luau.VM) \ No newline at end of file diff --git a/README.md b/README.md index 9ebfe02..0962b94 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # RNR +[![GitHub CI Status](https://img.shields.io/github/actions/workflow/status/lrre-foss/rnr/ci.yml?branch=trunk&label=builds)](https://github.com/lrre-foss/rnr/actions) [![Star](https://img.shields.io/github/stars/lrre-foss/RNR?style=social)](https://github.com/lrre-foss/RNR/stargazers) RNR (**R**NR's **N**ot **R**oblox) is a project that aims to recreate the look and feel of classic Roblox with new features while remaining fully compatible with clients from that era. It is built upon an engine that closely resembles Roblox's own at the time, referencing disassemblies of legacy client binaries. @@ -19,7 +20,8 @@ There are several goals that RNR seeks to accomplish, them being; # Building RNR uses [CMake](https://cmake.org/) as its build system and [GCC](https://gcc.gnu.org/) as its compiler. To build RNR, you must first have the following packages installed: - [Boost](https://www.boost.org/) -- [Ogre](https://github.com/OGRECave/ogre) +- [OGRE](https://github.com/OGRECave/ogre) +- [pugixml](https://github.com/zeux/pugixml) - [Qt 6](https://www.qt.io/product/qt6) (if building the player or studio projects) For Windows: