Ports: Prevent exporting symbols for ScummVM

Both LibGUI and ScummVM have a GUI::Widget class. This interferes with
normal operation of LibGUI, since the wrong GUI::Widget::~Widget() is
invoked when SerenitySDLWidget (from the SDL2 port) is destructed.

By adding `-fvisibility=hidden` to the compiler flags, we set the
symbol visibility to hidden by default and the correct destructor is
invoked again.
This commit is contained in:
Jelle Raaijmakers 2021-10-18 00:12:28 +02:00 committed by Linus Groh
parent 59b2bac3a5
commit 3941e4fe24

View file

@ -17,5 +17,14 @@ launcher_category=Games
launcher_command=/usr/local/bin/scummvm
icon_file=icons/scummvm.ico
export FREETYPE2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/freetype2"
export SDL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
function pre_configure() {
export CPPFLAGS="-fvisibility=hidden"
export FREETYPE2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/freetype2"
export SDL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2"
}
function post_configure() {
unset CPPFLAGS
unset FREETYPE2_CFLAGS
unset SDL_CFLAGS
}