Skip to content

Commit

Permalink
Create Dockerfile.windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tmp64 committed Dec 2, 2023
1 parent df7cdf0 commit da6a8e2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/_build
/_build_*
/cmake-build-*
/containers
/containers/*/out

# macOS garbage
.DS_Store
21 changes: 21 additions & 0 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM bhl-build

# Build
WORKDIR /build/bhl
COPY . .

RUN python ./scripts/BuildRelease.py \
--target client \
--build-type release \
--vs 2022 --toolset v143 \
--linux-compiler gcc-9 \
--out-dir ./_build_out_client \
--cmake-args=-DWARNINGS_ARE_ERRORS=ON

RUN python ./scripts/BuildRelease.py \
--target server \
--build-type release \
--vs 2022 --toolset v143 \
--linux-compiler gcc-9 \
--out-dir ./_build_out_server \
--cmake-args=-DWARNINGS_ARE_ERRORS=ON
2 changes: 1 addition & 1 deletion containers/windows/Dockerfile.bhl-build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM bhl-vs-2022

ENV BHL_BUILD_DATE="2023-11-27.1"
ENV BHL_GIT_VERSION="2.43.0"
ENV BHL_PYTHON_VERSION="3.12.0"
ENV BHL_PYTHON_VERSION="3.11.6"
ENV BHL_CMAKE_VERSION="3.27.8"
ENV BHL_7ZIP_VERSION="2301"
ENV BHL_NINJA_VERSION="1.11.1"
Expand Down
18 changes: 18 additions & 0 deletions containers/windows/build-bhl.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
. ./_common.ps1

$CurDir = "containers/windows"

$ImageTag = "bhl-build-bhl"
$TempCont = "${ImageTag}-temp"
$DockerFile = "Dockerfile.windows"
$OutDir = "$CurDir/out/bhl"

cd ../..
rm -r -fo -ea 0 $OutDir
mkdir $OutDir -ea 0

Invoke-Call -ScriptBlock { docker build -f $DockerFile -t $ImageTag . }
Invoke-Call -ScriptBlock { docker container create --name $TempCont $ImageTag }
Invoke-Call -ScriptBlock { docker container cp ${TempCont}:C:/build/bhl/_build_out_client $OutDir }
Invoke-Call -ScriptBlock { docker container cp ${TempCont}:C:/build/bhl/_build_out_server $OutDir }
Invoke-Call -ScriptBlock { docker container rm ${TempCont} }
7 changes: 5 additions & 2 deletions scripts/BuildRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def get_cmake_args(self):
elif self.script.vs_version == '2019':
args.extend(['-G', 'Visual Studio 16 2019'])
args.extend(['-A', 'Win32'])
elif self.script.vs_version == '2022':
args.extend(['-G', 'Visual Studio 17 2022'])
args.extend(['-A', 'Win32'])

args.extend(['-T', self.script.vs_toolset])

Expand Down Expand Up @@ -180,8 +183,8 @@ class Paths:
allowed_targets = ['client', 'server']
allowed_build_types = ['debug', 'release']

allowed_vs_versions = ['2017', '2019']
allowed_vs_toolsets = ['v141', 'v141_xp', 'v142']
allowed_vs_versions = ['2017', '2019', '2022']
allowed_vs_toolsets = ['v141', 'v141_xp', 'v142', 'v143']

allowed_linux_compilers = ['gcc', 'gcc-8', 'gcc-9']

Expand Down

0 comments on commit da6a8e2

Please sign in to comment.