USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
The only use of C4RTF in its final moments was parsing out plain text
from RTF files anyway, so why even go to all the trouble instead of just
storing plain text in the beginning?
Instead of conditionally adding src/C4Include.cpp, simply add it always. It
doesn't do anything with other compilers, but the tiny speedup from not
compiling it isn't worth the additional complexity.
This was used to name snapshot releases of the Network2 branch, and has
seen almost no use since.
C4ENGINEINFO(LONG) was a duplicate of C4ENGINENAME and C4ENGINECAPTION.
This employs a rather ugly hack to make CMake do what we want. CMake
doesn't allow us to add items directly to the solution (as opposed to
one of the projects inside it), and thus requires us to abuse its lack
of parameter validation to manually add the file.
This only didn't break earlier because this code was located before
find_package(GLEW). The add_definitions(${GLEW_DEFINITIONS}) call that
actually adds the macro is a bit broad, but the macro doesn't harm the
targets that do not use GLEW.
Since there's already a getopt library in thirdparty/, there's no need to
guess about ways to make it work with a system header without support in
the C library itself.
Keep the check for C++0x/C++11 for now. Remove that flag instead of not
adding it, because it most likely still is in the CMAKE_CXX_FLAGS, which
are cached.
Video recording and playback only worked on Windows, and recording only
handled video, not game audio. As such, it was of fairly limited use,
and there's lots of software available these days that handle both.
Moving the flags from CMAKE_CXX_FLAGS to OC_CXX_FLAGS, adding flags and
removing duplicates keeps CMAKS_CXX_FLAGS from growing. Unfortunately,
-std=gnu++0x needs to be in CMAKE_CXX_FLAGS before compiler features get
tested, but CMAKE_CXX_FLAGS is filled from OC_CXX_FLAGS further down.
Fortunately, all tests for compiler flags are quite simple, so they can be
done at the beginning, and the feature tests after that. Reorder the code
accordingly.
In order to be able to remove duplicates from the list, each flags needs to
be a separate list item. Otherwise, the flags from the previous run in
CMAKE_CXX_FLAGS, which are now separate list items due to
separate_arguments(), will not be recognized as duplicates of the freshly
added flags. Fortunately, in the next round the two sets of flags in
CMAKE_CXX_FLAGS will be reduced to one set, so there were never more than
two copies of the warning flags.
Hardly anyone ever tests the headless build, because it requires you to
run CMake a second time with -DUSE_CONSOLE=On. So now it's an included
project which you'll get whether you want it or not.
I'm well aware that this could be solved more nicely, and that we could
be splitting unchanged files out into a separate support library, but
that's left for a later date.
Another piece of code that hasn't been tested in ages, gone. The default
puncher address was still pointing to clonk.de, which I'm very certain
isn't providing UDP hole punching services anymore.
Instead of a bespoke hole punching implementation we should use a STUN
lib.
libmisc is the support library that references thread code and timing.
So the dependencies on pthread and rt should be attached to libmisc
instead of every single binary.
libc4script uses C4Group, so it has a dependency on libmisc. Make this
dependency explicit so all targets that use libc4script also
automatically pull in libmisc.
Nobody uses pkg-config on Windows, and we already have a perfectly
viable solution for finding libraries - it's called CMake. We're still
defering to pkg-config when it exists because who knows what arcane
cflags might be required on some systems.
mape uses several headers from OpenClonk that are marked for
pre-compilation. MSVC does not support using headers flagged as such
without also linking to the object file that gets generated from the
compilation step.
The minimum GTK version is now GTK+ 3.4, which is available since 2012.
It's part of Ubuntu LTS 12.04, and so should be available on any halfway
modern linux distribution.
This should allow getting rid of using deprecated GTK+ API much easier.
autotools by default checks for a bunch of stuff absolutely nobody cares
about. The macros removed here were stuff left over from porting the old
autotools build to cmake.
For one, people are unlikely to still have these variables in their
cache, and for another, if building fails, the proper solution is to
start from a clean slate anyway.
We already require support for std::unique_ptr, which itself requires
support for rvalue references. As such, we know we can use rvalue
references, and thus don't have to keep carrying dead code around.
On Windows, we need to know whether the library we're linking against is
a static library or a shared library import stub. If it's a shared lib
(and only then), we need to #define GLEW_STATIC.
Other OSes handle library imports differently and don't care.
Instead of doing the transformation when drawing a mesh. This allows making
the OpenGL normal matrix more consistent, since it does not include the
Ogre-To-Clonk transformation, and so that the transformation does not need
to be inverted in the shader.
As a side effect, all Attach transformations were updated, since before
they were specified in the OGRE reference frame, not the Clonk reference
frame.
* fix the if-conditional
* don't use pkgconfig (there is no .pc file upstream)
Signed-off-by: Julius Michaelis <caesar@hg.openclonk.org>
(Added license to FindTinyXML.cmake)
Unlike std::make_shared, std::make_unique was unfortunately missing from
C++11. It's a useful utility though.
Technically, declaring a new name in the std namespace is undefined, but
the other way to make make_unique available to all callers regardless of
C++ version, putting it into a distinct utility namespace and importing
the declaration from std if available, makes for more ugly code.
Depending on how current your headers are, the userParam parameter to
GLDEBUGPROCARB may be const, or it may not. The ARB has added the const
qualifier at some point after publishing the specs. Hooray for breaking
API changes.
thirdparty needs to be pristine code so we can update those libraries
without having to figure out whether we need to apply some more patches.
This means we can't easily fix warnings in there; telling GCC that these
are system headers means it won't emit any.
For some reason, even the most recent (as of this writing) CMake 3.1.0
doesn't know about Boost 1.57.0, which was released two months before
CMake. Add it to the known version list.
CMake 3.1's if() by default now interprets quoted variable names as
strings. This is a good idea from a strictness perspective, so make it
do this even if we're in 2.8.9 compatibility mode.
Printing pointers from the crash handler has been broken starting
with an update to MinGW at some point in the past, when they stopped
using printf from MSVCRT, instead replacing it with a private
implementation. Fix this by checking for inttypes.h availability, and
using it (and its format macro) when possible.