Skip to content

Commit

Permalink
Remove sanitize-address, as libasan is not available. Move to buildin…
Browse files Browse the repository at this point in the history
…g SDL2_gfx since it's not part of sniper runtime.
  • Loading branch information
juvinious committed Mar 5, 2024
1 parent b269563 commit 3f16e75
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
37 changes: 21 additions & 16 deletions docker/Dockerfile.steam
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest

RUN apt update && \
apt install -y sudo wget git ninja-build make python3-pip libsdl2-gfx-dev && \
apt install -y sudo wget git ninja-build make python3-pip && \
apt remove -y meson

# Get latest meson
Expand All @@ -16,6 +16,10 @@ RUN mkdir -p /build/cross/include/SDL2

COPY src /build/src
COPY meson.build /build
RUN sed -i 's/is_static = true/is_static=false/' /build/meson.build && \
sed -i '24 s/-fsanitize=address/-I\.\.\/cross\/include/' /build/meson.build && \
sed -i '33 s/^/#/' /build/meson.build && \
sed -i '25 s/fsanitize=address/lpthread/' /build/meson.build
COPY misc/steam/steam.txt /build/steam.txt
COPY meson.options /build
COPY Makefile /build/Makefile
Expand All @@ -38,21 +42,22 @@ clean:\n\
RUN mkdir -p /build/.tmp

# SDL_gfx is not installed by default, we may need to statically link it if it doesn't work on steam deck or with steam natively
#RUN git clone https://github.com/ferzkopp/SDL2_gfx.git -- /build/.tmp/SDL_gfx
#RUN echo "sources = [\n\
# 'SDL2_framerate.c',\n\
# 'SDL2_gfxPrimitives.c',\n\
# 'SDL2_imageFilter.c',\n\
# 'SDL2_rotozoom.c',\n\
#]\n\
#\n\
#includes = include_directories('.')\n\
#\n\
#sdl_graphics_library = static_library('SDL2_gfx', sources,\n\
# include_directories: [includes],\n\
# dependencies: [sdl_dependency, zlib_dependency],\n\
#)\n" > /build/.tmp/SDL_gfx/meson.build
#RUN cp /build/.tmp/SDL_gfx/*.h /build/cross/include/SDL2
RUN git clone https://github.com/ferzkopp/SDL2_gfx.git -- /build/.tmp/SDL_gfx
RUN echo "sources = [\n\
'SDL2_framerate.c',\n\
'SDL2_gfxPrimitives.c',\n\
'SDL2_imageFilter.c',\n\
'SDL2_rotozoom.c',\n\
]\n\
\n\
includes = include_directories('.', '../../src')\n\
\n\
sdl_graphics_library = static_library('SDL2_gfx', sources,\n\
include_directories: [includes],\n\
dependencies: [sdl_dependency, zlib_dependency],\n\
)\n" > /build/.tmp/SDL_gfx/meson.build
RUN cp /build/.tmp/SDL_gfx/*.h /build/cross/include/SDL2 && \
sed -i "109i subdir('.tmp\/SDL_gfx')" /build/meson.build

RUN cd /build && make

Expand Down
25 changes: 9 additions & 16 deletions misc/steam/steam.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ common_args = ['-I..' / cross_root / 'include',
'-DDATA_PATH="data"',
'-DSTEAM'
]
#common_link_args = ['-L/usr/x86_64-w64-mingw32/lib', '-lz']

[binaries]
c = 'clang'
Expand All @@ -17,7 +16,6 @@ sdl2-config = 'sdl2-config'
cmake = 'cmake'

[properties]
#pkg_config_libdir = ['/usr/x86_64-w64-mingw32/lib/pkgconfig', cross_root / 'lib/pkgconfig']
pkg_config_libdir = []

[host_machine]
Expand All @@ -27,37 +25,32 @@ cpu = 'x86_64'
endian = 'little'

[built-in options]
#pkg_config_path = cross_root / 'lib/pkg-config'
#c_include_path = cross_root / 'include'
#cpp_include_path = cross_root / 'include'
c_args = common_args
cpp_args = common_args
c_link_args = ['-static', '-lsfml-window-s', '-lsfml-system-s',]
cpp_link_args = ['-static', '-static-libgcc', '-static-libstdc++',]
#includedir = cross_root / 'include'
#libdir = cross_root / 'lib'
default_library='static'
c_link_args = ['-lsfml-window-s', '-lsfml-system-s',]
#cpp_link_args = ['-static-libgcc', '-static-libstdc++',]
#default_library='static'

[sdl2:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

[SDL2_image:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

[SDL2_ttf:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

[SDL2_mixer:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

[zlib:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

[yaml-cpp:built-in options]
default_library = 'static'
#default_library = 'static'
werror = false

0 comments on commit 3f16e75

Please sign in to comment.