Skip to content

Commit

Permalink
Update Amiga build configs
Browse files Browse the repository at this point in the history
1. Updates the Dockerfile to the same image and flags as the CI.
2. Sets `-O2` as the default CMake Release flag rather than passing it
   in a custom way.
  • Loading branch information
glebm committed Nov 10, 2024
1 parent bfd289d commit 44d5d2d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/amiga-m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ jobs:
-S . \
-B build \
-G Ninja \
-D M68K_COMMON="-s -fbbb=- -ffast-math -O2" \
-D M68K_CPU=68040 \
-D M68K_FPU=hard
-DCMAKE_BUILD_TYPE=Release \
-DM68K_COMMON="-s -fbbb=- -ffast-math" \
-DM68K_CPU=68040 \
-DM68K_FPU=hard
- name: Build DevilutionX
run: cmake --build build
Expand Down
4 changes: 4 additions & 0 deletions CMake/platforms/amiga.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ set(DEVILUTIONX_SYSTEM_ZLIB OFF)
# As this build uses an older compiler, there are lots of them.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")

# Lower the optimization level to O2 because there are issues with O3.
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")

# `fseeko` fails to link on Amiga.
add_definitions(-Dfseeko=fseek)

Expand Down
24 changes: 13 additions & 11 deletions Packaging/amiga/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM amigadev/crosstools:m68k-amigaos

RUN apt-get install --no-install-recommends -y smpq
RUN mkdir /devilutionx-deps-build
COPY Packaging/amiga/prep.sh /devilutionx-deps-build/prep.sh
RUN cd /devilutionx-deps-build && ./prep.sh

CMD PKG_CONFIG_PATH=/opt/m68k-amigaos/usr/lib/pkgconfig/:/opt/m68k-amigaos/usr/share/pkgconfig/ \
cmake -S. -Bbuild-amiga -DCMAKE_BUILD_TYPE=Release -DCPACK=ON -DM68K_CPU=68040 -DM68K_FPU=hard \
-DM68K_COMMON="-s -ffast-math -O3 -noixemul -D__BIG_ENDIAN__ -D__AMIGA__ -fpermissive" && \
cmake --build build-amiga -j $(nproc)
FROM amigadev/crosstools:m68k-amigaos-gcc10

RUN apt-get install --no-install-recommends -y smpq
RUN mkdir /devilutionx-deps-build
COPY Packaging/amiga/prep.sh /devilutionx-deps-build/prep.sh
RUN cd /devilutionx-deps-build && ./prep.sh

CMD cmake -S. -Bbuild-amiga -DCPACK=ON \
-DCMAKE_BUILD_TYPE=Release \
-DM68K_CPU=68040 \
-DM68K_FPU=hard \
-DM68K_COMMON="-s -fbbb=- -ffast-math" && \
cmake --build build-amiga -j $(nproc)

0 comments on commit 44d5d2d

Please sign in to comment.