diff --git a/.github/workflows/build-game.yml b/.github/workflows/build-game.yml index 759bdb0b..b387e8db 100644 --- a/.github/workflows/build-game.yml +++ b/.github/workflows/build-game.yml @@ -6,17 +6,17 @@ on: [ push, pull_request ] jobs: build-gcc: name: Linux build on Ubuntu - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v3 with: submodules: true - name: Cache conan - uses: actions/cache@v3.0.11 + uses: actions/cache@v3 with: - key: conan-root-${{ hashFiles('conanfile.txt') }} - path: ~/.conan/ + key: conan-ubuntu-${{ hashFiles('conanfile.py') }} + path: ~/.conan2/ - name: Install dependencies run: | @@ -52,16 +52,12 @@ jobs: - name: Configure run: | - conan config set general.revisions_enabled=1 - echo "tools.system.package_manager:mode = install" > ~/.conan/global.conf - echo "tools.system.package_manager:sudo = True" >> ~/.conan/global.conf - conan profile new --detect --force default - conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja" default - conan profile update settings.compiler.libcxx=libstdc++11 default + conan profile detect --force + echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf + echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f - mkdir build && cd build - conan install .. -s build_type=Release -b missing -pr:b=default - cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_MASTER_SERVER=ON -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" + conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja" -of build + cmake --preset conan-release -DBUILD_MASTER_SERVER=ON shell: bash - name: Build @@ -71,7 +67,7 @@ jobs: shell: bash - name: Clean Conan pkgs - run: conan remove "*" -fsb + run: conan cache clean "*" -sbd shell: bash build-msvc: @@ -83,41 +79,42 @@ jobs: steps: - run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v3 with: submodules: true - name: Install Build tools - shell: cmake -P {0} - run: | - file(MAKE_DIRECTORY $ENV{BUILD_TOOLS_PATH}) - file(DOWNLOAD https://cdn.anotherfoxguy.com/build-tools.zip "$ENV{TMP}/build-tools.zip" SHOW_PROGRESS) - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "$ENV{TMP}/build-tools.zip" WORKING_DIRECTORY "$ENV{BUILD_TOOLS_PATH}") + run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH% + shell: cmd - name: Cache conan packages - uses: actions/cache@v3.0.11 + uses: actions/cache@v3 with: - key: conan-${{ hashFiles('conanfile.txt') }} - path: ~/.conan + key: conan-windows-${{ hashFiles('conanfile.py') }} + path: ~/.conan2 - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.12.0 + uses: ilammy/msvc-dev-cmd@v1.12.1 - name: Configure - run: | - conan config set general.revisions_enabled=1 + run: | conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f - mkdir build && cd build - conan install .. -b missing -pr:b=../tools/conan-profiles/vs-19-release-ninja - cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=redist -DBUILD_MASTER_SERVER=ON -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" + conan install . -b missing -pr:b=tools/conan-profiles/vs-19-release-ninja -pr=tools/conan-profiles/vs-19-release-ninja -of build + cmake --preset conan-release -DCMAKE_INSTALL_PREFIX=redist -DCREATE_CONTENT_FOLDER=ON shell: cmd - name: Build run: | cd build - ninja + ninja install shell: cmd + - name: Upload redist folder + uses: actions/upload-artifact@v3 + with: + name: stuntrally-win + path: build/redist + - name: Clean Conan pkgs - run: conan remove "*" -fsb + run: conan cache clean "*" -sbd shell: cmd diff --git a/.gitignore b/.gitignore index e38fd4ee..73f204b2 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,6 @@ Build/ EmscriptenDependencies EmscriptenBuild cmake-build-*/ -.idea/ \ No newline at end of file +.idea/ +_build +CMakeUserPresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index a5d7d6f0..dd14ef7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,9 @@ foreach (EXE ${EXE_LIST}) add_executable(${EXE} WIN32 ${EXE_SOURCES}) + # Generate source groups for use in IDEs + source_group(TREE ${CMAKE_CURRENT_LIST_DIR} FILES ${EXE_SOURCES}) + foreach (subdir ${SRC_DIRS}) #message( STATUS ${subdir} ) target_include_directories(${EXE} PRIVATE ${subdir}) @@ -167,22 +170,24 @@ foreach (EXE ${EXE_LIST}) target_precompile_headers(${EXE} PRIVATE src/game/pch.h) endif () - # threads target_link_libraries( - ${EXE} - Boost::boost + ${EXE} + PRIVATE + Threads::Threads + OGRE::OGRE Bullet::Bullet + SDL2::SDL2 MyGUI::MyGUI + Vorbis::vorbis + Vorbis::vorbisfile Ogg::ogg - OGRE::OGRE OpenAL::OpenAL - SDL2::SDL2 - Threads::Threads - Vorbis::vorbis - tinyxml2::tinyxml2 tinyxml::tinyxml + tinyxml2::tinyxml2 ) endforeach () message(STATUS "---------- SR end") + +feature_summary(WHAT ALL) diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..d7b170a1 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,34 @@ +from conan import ConanFile + + +class StuntRally3(ConanFile): + name = "StuntRally3" + settings = "os", "compiler", "build_type", "arch" + generators = ( + "CMakeDeps", + "CMakeToolchain", + ) + default_options = { + "bullet3/*:extras": "True", + "bullet3/*:network_support": "True", + "sdl/*:sdl2main": "False", + } + + def requirements(self): + self.requires("boost/1.81.0") + self.requires("ogre3d-next/2023.04@anotherfoxguy/stable" , override=True) + self.requires( + "bullet3/3.25@anotherfoxguy/patched" + ) # Needs a patched to build on windows + self.requires("sdl/2.26.1") + self.requires("mygui-next/2023.04@anotherfoxguy/stable") + self.requires("ogg/1.3.5") + self.requires("vorbis/1.3.7") + self.requires("openal/1.22.2") + self.requires("enet/1.3.17") + self.requires("tinyxml/2.6.2") + self.requires("tinyxml2/9.0.0") + + self.requires("libpng/1.6.39", override=True) + self.requires("libwebp/1.3.0", override=True) + self.requires("zlib/1.2.13", override=True) diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index 38c7f439..00000000 --- a/conanfile.txt +++ /dev/null @@ -1,27 +0,0 @@ -[requires] -boost/1.80.0 -bullet3/3.24 -ogg/1.3.5 -ogre3d-next/2023.01@anotherfoxguy/testing -mygui-next/2022.10@anotherfoxguy/testing -openal/1.21.1 -sdl/2.26.0 -tinyxml/2.6.2 -tinyxml2/9.0.0 -vorbis/1.3.7 - -[generators] -CMakeDeps -CMakeToolchain - -[imports] -bin, *.exe -> bin @ root_package=ogre3d-next, keep_path=False -bin, *.dll -> bin @ keep_path=False -lib, *.dll -> bin @ keep_path=False -lib, *.dylib -> bin @ keep_path=False -lib, *.so* -> bin @ keep_path=False - -[options] -bullet3:extras=True -bullet3:network_support=True -sdl:sdl2main=False \ No newline at end of file diff --git a/tools/conan-profiles/vs-19-debug b/tools/conan-profiles/vs-19-debug index 3c74e3c5..e2c293d9 100644 --- a/tools/conan-profiles/vs-19-debug +++ b/tools/conan-profiles/vs-19-debug @@ -1,11 +1,8 @@ [settings] os=Windows -os_build=Windows arch=x86_64 -arch_build=x86_64 -compiler=Visual Studio -compiler.version=16 +compiler=msvc +compiler.version=192 +compiler.runtime=dynamic +compiler.runtime_type=Debug build_type=Debug -[options] -[build_requires] -[env] diff --git a/tools/conan-profiles/vs-19-debug-ninja b/tools/conan-profiles/vs-19-debug-ninja index d0584463..f3cdbf4a 100644 --- a/tools/conan-profiles/vs-19-debug-ninja +++ b/tools/conan-profiles/vs-19-debug-ninja @@ -1,10 +1,10 @@ [settings] os=Windows -os_build=Windows arch=x86_64 -arch_build=x86_64 -compiler=Visual Studio -compiler.version=16 +compiler=msvc +compiler.version=192 +compiler.runtime=dynamic +compiler.runtime_type=Debug build_type=Debug [conf] tools.cmake.cmaketoolchain:generator=Ninja \ No newline at end of file diff --git a/tools/conan-profiles/vs-19-release b/tools/conan-profiles/vs-19-release index 86b9f596..724f12a9 100644 --- a/tools/conan-profiles/vs-19-release +++ b/tools/conan-profiles/vs-19-release @@ -1,11 +1,8 @@ [settings] os=Windows -os_build=Windows arch=x86_64 -arch_build=x86_64 -compiler=Visual Studio -compiler.version=16 +compiler=msvc +compiler.version=192 +compiler.runtime=dynamic +compiler.runtime_type=Release build_type=Release -[options] -[build_requires] -[env] diff --git a/tools/conan-profiles/vs-19-release-ninja b/tools/conan-profiles/vs-19-release-ninja index b41104e1..24be6d9f 100644 --- a/tools/conan-profiles/vs-19-release-ninja +++ b/tools/conan-profiles/vs-19-release-ninja @@ -1,10 +1,10 @@ [settings] os=Windows -os_build=Windows arch=x86_64 -arch_build=x86_64 -compiler=Visual Studio -compiler.version=16 +compiler=msvc +compiler.version=192 +compiler.runtime=dynamic +compiler.runtime_type=Release build_type=Release [conf] tools.cmake.cmaketoolchain:generator=Ninja \ No newline at end of file diff --git a/tools/conan-profiles/vs-19-relwithdebinfo b/tools/conan-profiles/vs-19-relwithdebinfo index cdb847a6..4749266f 100644 --- a/tools/conan-profiles/vs-19-relwithdebinfo +++ b/tools/conan-profiles/vs-19-relwithdebinfo @@ -5,7 +5,4 @@ arch=x86_64 arch_build=x86_64 compiler=Visual Studio compiler.version=16 -build_type=RelWithDebInfo -[options] -[build_requires] -[env] +build_type=RelWithDebInfo \ No newline at end of file diff --git a/tools/conan-profiles/vs-22-debug b/tools/conan-profiles/vs-22-debug new file mode 100644 index 00000000..30a6d9b0 --- /dev/null +++ b/tools/conan-profiles/vs-22-debug @@ -0,0 +1,8 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=193 +compiler.runtime=dynamic +compiler.runtime_type=Debug +build_type=Debug \ No newline at end of file diff --git a/tools/conan-profiles/vs-22-debug-ninja b/tools/conan-profiles/vs-22-debug-ninja new file mode 100644 index 00000000..5bd5d0e0 --- /dev/null +++ b/tools/conan-profiles/vs-22-debug-ninja @@ -0,0 +1,10 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=193 +compiler.runtime=dynamic +compiler.runtime_type=Debug +build_type=Debug +[conf] +tools.cmake.cmaketoolchain:generator=Ninja \ No newline at end of file diff --git a/tools/conan-profiles/vs-22-release b/tools/conan-profiles/vs-22-release new file mode 100644 index 00000000..488df695 --- /dev/null +++ b/tools/conan-profiles/vs-22-release @@ -0,0 +1,8 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=193 +compiler.runtime=dynamic +compiler.runtime_type=Release +build_type=Release \ No newline at end of file diff --git a/tools/conan-profiles/vs-22-release-ninja b/tools/conan-profiles/vs-22-release-ninja new file mode 100644 index 00000000..0e917e11 --- /dev/null +++ b/tools/conan-profiles/vs-22-release-ninja @@ -0,0 +1,10 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=193 +compiler.runtime=dynamic +compiler.runtime_type=Release +build_type=Release +[conf] +tools.cmake.cmaketoolchain:generator=Ninja \ No newline at end of file diff --git a/tools/conan-profiles/vs-22-relwithdebinfo b/tools/conan-profiles/vs-22-relwithdebinfo new file mode 100644 index 00000000..4c63b3ff --- /dev/null +++ b/tools/conan-profiles/vs-22-relwithdebinfo @@ -0,0 +1,8 @@ +[settings] +os=Windows +arch=x86_64 +compiler=msvc +compiler.version=193 +compiler.runtime=dynamic +compiler.runtime_type=RelWithDebInfo +build_type=RelWithDebInfo