This makes cross-compiling easier, and saves having to build once each
for TFE and TSE.
I considered using CMake's import/export feature, but there's little
point when you're only importing one binary target. Pointing the ECC
variable at the ecc binary itself is simpler.
I copied the minimum CMake version of 2.8.7 from the parent
project. To be confident this would actually work, I tested building
under CentOS 7 with CMake 2.8.12.
Quoting Clang:
"reference cannot be bound to dereferenced null pointer in well-defined
C++ code; comparison may be assumed to always evaluate to false"
Conflicts:
Sources/CMakeLists.txt
except for EntitiesMP/Fish.es which I'm not sure about, and in
Computer.cpp the weird "if (_iActiveMessage < _acmMessages.Count()==0)"
construct whichs intention I didn't fully grasp, either.
many unused functions and variables are now commented out
You'll still get tons of warnings, which should mostly fall in one of
the following categories:
1. Unnecessary variables or values generated from .es scripts
2. Pointers assigned to from functions with side-effects: DO NOT REMOVE!
Like CEntity *penNew = CreateEntity_t(...); - even if penNew isn't
used, CreateEntity() must be called there!
Fixed -Wreorder warnings (hopefully the last?), also several potentially
uninitialized variables.
In SetupPixelFormat_OGL() Assert if gap_iDepthBits ends up being 0.
Small adjustments to cmake warning settings for gcc/clang
OSX build was a bit broken, it needs to be linked against zlib.
Furthermore it now uses the systems libSDL2 framework, unless you use
-DUSE_SYSTEM_SDL2=FALSE
i386 ASM is now disabled by default, we have plain C fallbacks for
everything that seems to work well enough (and if not they need more
testing which is likely to happen this way)
ssam expects lib* to be in the Debug subdir, so make cmake put it there,
this way it's easier to copy the binaries to your install/Bin/ dir to
test.
clang gives a lot of -Wlogical-op-parentheses warnings, suppress them.
Set the ENABLE_EXPORTS property on the main executables, which adds
linker flag -rdynamic if the compiler supports it. This ensures symbols
are available for dynamic objects (such as shared libEntitiesMPD.so) to
use.
- Detect FreeBSD.
- Set both PLATFORM_UNIX and PLATFORM_FREEBSD. The latter is required to
distinguish FreeBSD from other unixoid platforms like Linux.
- On FreeBSD 3rd party libs are installed to /usr/local, we need to add
/usr/local/include as include directory.
- Add linker options for FreeBSD. FreeBSD has no -ldl.
CMakeLists.txt: Modified to link system wide SDL2 libraries and link to
system wide headers
SplashScreen.cpp: commented out as its post SDL2.0.4 >> SDL_WINDOW_SKIP_TASKBAR
This help cross-compilation. You can do something like this now, to get a
native ECC that runs on the build machine, then build the rest for the
cross-compile target system:
rm -rf cmake-build-ecc
mkdir $_
cd $_
cmake ..
make ecc
cd ..
rm -rf cmake-build
mkdir $_
cd $_
cmake -DECC=/wherever/SeriousEngine/Sources/cmake-build-ecc/ecc ..
make
* Only use ENOSR and ENOPKG if defined
ENOSR and ENOPKG are part of the POSIX optional STREAMS extension, and
are not available on most other platforms than GNU/Linux.
* Support building on other GNU platforms than Linux
Build for other GNU platforms the same way as Linux: this includes
CMAKE_SYSTEM_NAME "GNU" (GNU/Hurd) and "GNU/kFreeBSD" (GNU/kFreeBSD).