diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml new file mode 100644 index 00000000..e4d8fe8e --- /dev/null +++ b/.github/workflows/cmake-multi-platform.yml @@ -0,0 +1,82 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake on multiple platforms + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + fail-fast: false + + # Set up a matrix to run the following 3 configurations: + # 1. + # 2. + # 3. + # + # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + matrix: + os: [ubuntu-latest, windows-latest] + triplet: [x64-linux, x64-windows] + build_type: [Debug, Release, RelWithDebInfo, MinSizeRel] + c_compiler: [gcc, clang, cl] + include: + - os: windows-latest + c_compiler: cl + cpp_compiler: cl + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ + exclude: + - os: windows-latest + c_compiler: gcc + - os: windows-latest + c_compiler: clang + - os: ubuntu-latest + c_compiler: cl + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + echo "scripts-dir=${{ github.workspace }}/scripts" >> "$GITHUB_OUTPUT" + + - name: Set up dependencies with custom script + run: | + chmod +x ${{ steps.strings.outputs.scripts-dir }}/vcpkg.sh + ${{ steps.strings.outputs.scripts-dir }}/script.sh ${{ matrix.triplet } https ${{ github.workspace }}/vcpkg + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + +# - name: Test +# working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail +# run: ctest --build-config ${{ matrix.build_type }} diff --git a/FetchDependencies.sh b/FetchDependencies.sh index 4135caec..dd62ad17 100644 --- a/FetchDependencies.sh +++ b/FetchDependencies.sh @@ -1,77 +1,2 @@ -if [ -z "$1" ]; then - echo "No triplet supplied, defaulting to x64-windows" - platform="x64-windows" -else - platform=$1 -fi - -if [ -z "$2" ]; then - echo "No clonemode supplied, defaulting to https" - clonemode="https" -else - clonemode=$2 -fi - -mkdir -p vcpkg -if [ "$clonemode" = "https" ]; then - git clone https://github.com/Microsoft/vcpkg.git -elif [ "$clonemode" = "ssh" ]; then - git clone git@github.com:microsoft/vcpkg.git -else - echo '\033[0;31mIncorrect clonemode! Expected https or ssh got something else!' - exit -fi - -cd vcpkg -git pull -chmod +x bootstrap-vcpkg.sh -./bootstrap-vcpkg.sh -./vcpkg integrate install - -echo "Installing AngelScript" -./vcpkg install angelscript[addons] --triplet $platform --recurse - -echo "Installing argparse" -./vcpkg install argparse --triplet $platform - -echo "Installing Assimp" -./vcpkg install assimp --triplet $platform - -echo "Installing ImGui" -./vcpkg install imgui[core,docking-experimental,glfw-binding,opengl3-binding] --triplet $platform --recurse -./vcpkg install imguizmo --triplet $platform - -echo "Installing EnTT" -./vcpkg install entt --triplet $platform - -echo "Istalling Eventpp" -./vcpkg install eventpp --triplet $platform - -echo "Installing GLEW" -./vcpkg install glew --triplet $platform - -echo "Installing GLFW" -./vcpkg install glfw3 --triplet $platform - -echo "Installing GLM" -./vcpkg install glm --triplet $platform - -echo "Installing ICU" -./vcpkg install icu --triplet $platform - -echo "Installing LunaSVG" -./vcpkg install lunasvg --triplet $platform - -echo "Installing STB" -./vcpkg install stb --triplet $platform - -echo "Installing TinyXML2" -./vcpkg install tinyxml2 --triplet $platform - -echo "Installing ZeroMQ (cppzmp)" -./vcpkg install cppzmq --triplet $platform - -./vcpkg upgrade - -./vcpkg integrate install +./scripts/vcpkg.sh read -rsp $'Press any key to continue...\n' -n1 key \ No newline at end of file diff --git a/scripts/vcpkg.sh b/scripts/vcpkg.sh new file mode 100644 index 00000000..4b42213f --- /dev/null +++ b/scripts/vcpkg.sh @@ -0,0 +1,83 @@ +if [ -z "$1" ]; then + echo "No triplet supplied, defaulting to x64-windows" + platform="x64-windows" +else + platform=$1 +fi + +if [ -z "$2" ]; then + echo "No clonemode supplied, defaulting to https" + clonemode="https" +else + clonemode=$2 +fi + +if [ -z "$3" ]; then + echo "No vcpkg path supplied, defaulting to ./vcpkg" + path="./vcpkg" +else + path=$3 +fi + +mkdir -p $path +cd $path +if [ "$clonemode" = "https" ]; then + git clone https://github.com/Microsoft/vcpkg.git . +elif [ "$clonemode" = "ssh" ]; then + git clone git@github.com:microsoft/vcpkg.git . +else + echo '\033[0;31mIncorrect clonemode! Expected https or ssh got something else!' + exit +fi + +git pull +chmod +x bootstrap-vcpkg.sh +./bootstrap-vcpkg.sh +./vcpkg integrate install + +echo "Installing AngelScript" +./vcpkg install angelscript[addons] --triplet $platform --recurse + +echo "Installing argparse" +./vcpkg install argparse --triplet $platform + +echo "Installing Assimp" +./vcpkg install assimp --triplet $platform + +echo "Installing ImGui" +./vcpkg install imgui[core,docking-experimental,glfw-binding,sdl2-binding,opengl3-binding,vulkan-binding,dx11-binding,dx12-binding] --triplet $platform --recurse +./vcpkg install imguizmo --triplet $platform + +echo "Installing EnTT" +./vcpkg install entt --triplet $platform + +echo "Istalling Eventpp" +./vcpkg install eventpp --triplet $platform + +echo "Installing GLEW" +./vcpkg install glew --triplet $platform + +echo "Installing GLFW" +./vcpkg install glfw3 --triplet $platform + +echo "Installing GLM" +./vcpkg install glm --triplet $platform + +echo "Installing ICU" +./vcpkg install icu --triplet $platform + +echo "Installing LunaSVG" +./vcpkg install lunasvg --triplet $platform + +echo "Installing STB" +./vcpkg install stb --triplet $platform + +echo "Installing TinyXML2" +./vcpkg install tinyxml2 --triplet $platform + +echo "Installing ZeroMQ (cppzmp)" +./vcpkg install cppzmq --triplet $platform + +./vcpkg upgrade + +./vcpkg integrate install \ No newline at end of file