From 6b98f3eb9299eafa4ed28a869322d2c921f3dc4d Mon Sep 17 00:00:00 2001 From: coco875 Date: Wed, 24 Jan 2024 21:26:29 +0100 Subject: [PATCH] add docker and windows build --- .github/workflows/windows_build.yml | 16 ++++++++++++++++ Dockerfile | 13 +++++++++++++ README.md | 24 ++++++++++++++++++------ 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/windows_build.yml create mode 100644 Dockerfile diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml new file mode 100644 index 0000000..a7ee5ce --- /dev/null +++ b/.github/workflows/windows_build.yml @@ -0,0 +1,16 @@ +name: Windows Compile + +on: + push: + branches: [ "*" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + cmake -S . -B "build/x64" -G "Visual Studio 16 2019" -T v142 -A x64 -DCMAKE_BUILD_TYPE=Debug \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..71df5e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:22.04 as build + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + cmake \ + ninja-build \ + libbz2-dev + +RUN mkdir /torch +WORKDIR /torch + +CMD echo 'Usage: docker run -it --rm -v .:/torch torch cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug && cmake --build build-cmake -j\n'\ + 'See https://github.com/HarbourMasters/Torch/blob/master/README.md for more information' \ No newline at end of file diff --git a/README.md b/README.md index 934503a..4de348b 100644 --- a/README.md +++ b/README.md @@ -31,16 +31,10 @@ A generic asset processor for N64 games ### Dependencies -#### Ubuntu ``` bash sudo apt-get install cmake ninja-build libbz2-dev ``` -#### Fedora -``` bash -sudo dnf install cmake ninja-build -``` - ### Compile ``` bash @@ -72,4 +66,22 @@ Requires Xcode (or xcode-tools) && `cmake, ninja` (can be installed via homebrew ``` bash cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug cmake --build build-cmake -j +``` + +# Docker + +Build the Docker image: +``` bash +docker build -t torch . +``` + +When building and using other tools, append the following in front of every command you run: +``` bash +docker run --rm -v .:/torch torch +``` + +For example: +``` bash +docker run --rm -v .:/torch torch cmake -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug +docker run --rm -v .:/torch torch cmake --build build-cmake -j ``` \ No newline at end of file