1
OXCE Builds & Ports / Strange problem cross-compiling OXCE+ in Linux
« on: December 03, 2024, 11:11:12 pm »
Hello,
I've tried crosscompiling OXCE+ under Linux-Ubuntu22.04 following instructions given here: https://openxcom.org/forum/index.php?topic=7048.0
I installed and built MXE -with minor issues; I've to include a #ifndef "guard" to mxe/usr/lib/gcc/x86_64-w64-mingw32.static/8.5.0/include/cpuid.h, to avoid including that header twice-
Then I followed instructions to build OXCE+:
git clone https://github.com/MeridianOXC/OpenXcom.git
cd OpenXcom
mkdir build
cd build
export PATH=/opt/mxe/usr/bin:$PATH
/opt/mxe/usr/bin/x86_64-w64-mingw32.static-cmake -DCMAKE_BUILD_TYPE=Release -DDEV_BUILD=OFF -DBUILD_PACKAGE=OFF ..
make -j4
And I got a lot of " fatal error: SDL.h: No such file or directory". It seems that x86_64-w64-mingw32.static-cmake considers a CMAKE_SYSTEM_NAME as Windows, and in the "recipe" at OXCE+ CMakeLists.txt, there are some parts "if ( WIN32 )" (l37) and if(NOT UNIX AND IS_DIRECTORY ${DEPS_DIR})" (l84), that cause building process look for yaml-cpp and SDL includes&libs inside of OpenXcom-oxce-plus/deps -which is empty- instead of inside /opt/mxe/usr/x86_64-w64-mingw32.static/ where you can find them.
I managed to "fix" CMakeList.txt nullifying conflictive parts in CMakeLists.txt recipe -if ( WIN32 ) --> if ( 0 ) , if(NOT UNIX AND IS_DIRECTORY ${DEPS_DIR}) --> if(0) -
In this state, it correctly crosscompile and build OXCE+ either for x86_64-w64-mingw32.static (64bits EXE) or i686-w64-mingw32.static (32bits EXE).
But this is just a "dirty patch" and I would like to know what I'm doing wrong or what is failing in the process.
So if anyone (Meridian?) can give me some light about this, I'd be very grateful.
Thanks in advance
I've tried crosscompiling OXCE+ under Linux-Ubuntu22.04 following instructions given here: https://openxcom.org/forum/index.php?topic=7048.0
I installed and built MXE -with minor issues; I've to include a #ifndef "guard" to mxe/usr/lib/gcc/x86_64-w64-mingw32.static/8.5.0/include/cpuid.h, to avoid including that header twice-
Then I followed instructions to build OXCE+:
git clone https://github.com/MeridianOXC/OpenXcom.git
cd OpenXcom
mkdir build
cd build
export PATH=/opt/mxe/usr/bin:$PATH
/opt/mxe/usr/bin/x86_64-w64-mingw32.static-cmake -DCMAKE_BUILD_TYPE=Release -DDEV_BUILD=OFF -DBUILD_PACKAGE=OFF ..
make -j4
And I got a lot of " fatal error: SDL.h: No such file or directory". It seems that x86_64-w64-mingw32.static-cmake considers a CMAKE_SYSTEM_NAME as Windows, and in the "recipe" at OXCE+ CMakeLists.txt, there are some parts "if ( WIN32 )" (l37) and if(NOT UNIX AND IS_DIRECTORY ${DEPS_DIR})" (l84), that cause building process look for yaml-cpp and SDL includes&libs inside of OpenXcom-oxce-plus/deps -which is empty- instead of inside /opt/mxe/usr/x86_64-w64-mingw32.static/ where you can find them.
I managed to "fix" CMakeList.txt nullifying conflictive parts in CMakeLists.txt recipe -if ( WIN32 ) --> if ( 0 ) , if(NOT UNIX AND IS_DIRECTORY ${DEPS_DIR}) --> if(0) -
In this state, it correctly crosscompile and build OXCE+ either for x86_64-w64-mingw32.static (64bits EXE) or i686-w64-mingw32.static (32bits EXE).
But this is just a "dirty patch" and I would like to know what I'm doing wrong or what is failing in the process.
So if anyone (Meridian?) can give me some light about this, I'd be very grateful.
Thanks in advance