This will be used only when compiling under MinGW, since MinGW's GLEW
config script seems to be really broken.
Fixes#4662.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Enable multithreaded compilation for VS, prevent it Optimizing the models per-build, fix up the pioneer-thirdparty paths, GLOB the header files, copy the DLLs needed for visual studio, Changed the appveyor MSVC prepare script
Use CMake to detect the availability of feclearexcept, feenableexcept,
fedisableexcept.
Fixes#4645.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
On all platforms (Windows, Linux, OSX), the automated builds and build
instructions don't use the pioneer-thirdparty repo. It's only ever
useful on Windows when building with Visual Studio.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Add a few defines and make 'main' functions extern "C" (see SDL_main.h)
to fix the build under Visual Studio 2017.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Libpng is a dependency of SDL2_image, not a direct dependency, so we
don't need to link against it.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* Fix last formatting errors
Obtained by running clang-format on all *.cpp *.h files present in the
src/ directory and its subfolders.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* CMake: Replace src/buildopts.h with a generated version
This has two benefits:
- The options WITH_OBJECTVIEWER and WITH_DEVKEYS are no more hardcoded,
and can be deselected in the configuration of CMake;
- The PIONEER_VERSION and PIONEER_EXTRAVERSION are no more passed inside
CPPFLAGS. Before, commiting changes meant that PIONEER_EXTRAVERSION
was updated to the new git tag, which meant that the whole sources had
to be recompiled again.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* Don't include buildopts.h fom libs.h
Virtually all sources files include libs.h. If libs.h includes
buildopts.h, all the sources will be recompiled if one macro changes in
buildopts.h, and we don't want that.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
* Avoid including buildopts.h in headers
Without it, a lot of source files will be recompiled when buildopts.h
is updated.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
This prevents the following error when git is found and the source
directory is not a git repo.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
target_link_libraries() cannot be given more than one target.
Also, all binaries must be linked to shlwapi, including savegamedump.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
This script can be used to generate an executable package file that will
install Pioneer into the users' system.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The meta-data will give information about the program, such as its
license, version, and description.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The PIONEER_DATA_DIR option, which was already in use in the CMake
script, is now present in the CMake UI like it should.
CMake will now install the data files inside the path specified
by PIONEER_DATA_DIR, instead of a hardcoded path.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The Windows build of Pioneer is linked dynamically to the DLLs of its
dependencies. For Pioneer to work correctly, these DLLs need to be
present in the system. We then make sure that when Pioneer is installed,
these DLLs are copied to the executable's directory.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The bin/etc/share/var etc. separation is a UNIX thing, we don't need to
do that when building for Windows.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Set policy CMP0072 to tell CMake to use libOpenGL.so instead of the
(deprecated filename) libGL.so.
This avoids a configuration warning when both filenames are found.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
The normal system include path (on Linux) for GLEW is
/usr/include/GL/glew.h (and the other headers). Previously the code here
has included glew/glew.h, which is incompatible with using the system
GLEW library.
Instead, we need to include GL/glew.h as expected and change the include
path in the build commands as needed depending on whether the system
directory or the bundled GLEW is being used.
It's a little tricky to ensure that we actually get the header from the
correct place for both build configurations, because when we're using
the bundled GLEW configuration /usr/include/ (or the standard include
path) will still be on the include path, so *both* the system glew.h
and the bundled glew.h will be available in the search path. We
just have to rely on the include flag order being right and the compiler
preferring include paths from flags to system include paths.
It should be fine... but it's a pain to actually test that it's correct.
- CMake modules to find external dependencies are in CMakeModules.
- Executables are output to bin/
- Object file archives are output to lib/
- Currently, it's set up to be configured within build/debug and
build/release (or more generally, build/{build-type}); configuring
from other directories is untested.
- build/, bin/ and lib/ have been added to the .gitignore list.