Commit graph

114 commits

Author SHA1 Message Date
David Carlier
7775257121 cmake build fix adding missing compilation unit. 2023-02-16 19:35:27 +00:00
Daniel Gibson
651503d48a Fix build with VisualC++'s internal CMake
.. which doesn't set CMAKE_GENERATOR_PLATFORM

so set YQ2ARCH in src/common/header/common.h when building with MSVC
2023-01-16 06:02:26 +01:00
Denis Pauk
ae13c7e034 Share MD2/SP2 files 2022-10-17 22:43:39 +03:00
David Carlier
2301ce0f78 Fix cmake's C11 build and removing C99 flag then. 2022-09-16 21:27:32 +01:00
Daniel Gibson
e124ddb4d0 GLES3 support in CMake 2022-04-27 00:33:46 +02:00
David Carlier
20171efc15 cmake build fix common linker settings. 2022-03-22 20:25:17 +00:00
David Carlier
cd641cfb9a cmake adding SYSTEMDIR variable to complete SYSTEMWIDE_SUPPORT option. 2022-03-17 12:10:54 +00:00
Daniel Gibson
34a8c3833f Some CMake improvements
- make sure MSVC builds in parallel
- make sure game.dll ends up in the correct directory
- set yquake2 as VS debugger start project
2022-03-12 17:01:37 +01:00
Daniel Gibson
16c97f6ece CMake: MSVC build is cleaner now (and shows less warnings)
- suppress some compiler warnings
- don't pass GCC/clang-specific flags to MSVC

(also made sure it still builds with MinGW)
2022-03-12 17:01:27 +01:00
Daniel Gibson
35232218e9 CMake: Correctly identify CPU architecture, hopefully
because, sadly, CMAKE_SYSTEM_PROCESSOR is almost useless and they don't
have a more useful alternative either :-/
2022-03-12 16:57:14 +01:00
Daniel Gibson
ed918cf423 CMake: Make the game build with Visual Studio (2019 16.8 or newer)
The easiest way to build this is to check out the dhewm3-libs project
(https://github.com/dhewm/dhewm3-libs/) to provide the dependencies
(SDL2, OpenAL, cURL) and set YQUAKE2LIBS accordingly, by passing
-DYQUAKE2LIBS=c:/path/to/dhewm3-libs/i686-w64-mingw32 to cmake.

I wouldn't really recommend building with MSVC - I just somehow made it
work and ignored all the warnings and I have no idea how portable the
resulting binaries are etc. For binaries you actually want to use, please
continue using MinGW-w64. Especially my workaround for VLAs (C99 variable
length arrays) is kinda fishy, particularly if those arrays are allocated
in a loop (that's inly done in ref_gl1.dll's code).

The only reason I did this is that I had to debug on Windows and, at least
for my specific bug, gdb didn't really work with binaries produced by
MingGW-w64 and MSVC's debugger works well with binaries produced by MSVC.

Currently requires VS 2019 16.8 or newer with C11 (/std:c11) because I
couldn't get YQ2_ALIGNAS_TYPE() to work with MSVC without _Alignas().
If we can get this to work, VS2015 or newer might suffice (but not older
versions, because their so called C standardlib didn't provide exotic
functions like snprintf()).

# Conflicts:
#	CMakeLists.txt
2022-03-12 16:55:55 +01:00
David Carlier
ea1d491ff3 cmake limiting the scope of concern to C only and detecting
the compiler from to one particular frontend since it can
happen to have differents for C and C++.
2022-03-02 19:31:37 +00:00
David Carlier
ff3315d5d6 Haiku doc update, little code style fixes. 2022-02-26 08:35:10 +00:00
Yamagi
fb1a2b0ce7 Add a warning that the CMakeLists.txt is unmaintained. 2021-07-23 08:25:07 +02:00
Yamagi
3e0af336d0 Revert "Retire unmaintained CMakeLists.txt."
It turned out that there're some special cases not (yet) covered by the
Makefile. Crossbuilding in specialized chroot environments are one
example.
2021-07-23 08:19:28 +02:00
Yamagi
0763dee264 Retire unmaintained CMakeLists.txt.
I added the CMakeLists.txt 6 or 7 years ago so I could load the code
into Jetbrains Clion. I have moved to another editor years ago and the
cmake stuff is effectively unmaintained since then. We kept it around
in case that we'll do a MSVC port, but that's unlikely at this point.
Since bugreport and problems with the CMakeLists.txt keep coming up,
finally retire them. They can be resurrected from the git history if
we'll ever need them again.

Part of #725.
2021-06-29 11:06:19 +02:00
David Carlier
53c684525f solairs/illumos build fix proposal. 2021-06-13 08:25:56 +01:00
Yamagi
8c297a003f Remove rev_vk from the CmakeLists.txt. 2021-05-28 09:32:42 +02:00
David Carlier
8dc76d54d1 Proposing to make vulkan support eventually optional.
Still some alternative oses does not have vulkan support or not full (e.g. Raspberry).
2020-12-23 09:50:37 +00:00
Yamagi
85b9f84b3d Don't link against the Vulkan loader, load it at runtime. 2020-12-12 14:45:04 +01:00
Denis Pauk
b94afbc6c1 remove unused vk_mem_alloc 2020-12-12 14:45:04 +01:00
Yamagi
0cdfd8f292 Bring the CMakeLists.txt more inline with the Makefile:
* Always set -fvisibility=hidden
* Set -Wl,--no-undefined where it is supported
* Add missing libraries for Windows
2020-10-08 11:44:38 +02:00
David Carlier
0200434187 backtrace support rework proposal.
Linux/Solaris supports it in the libc however, BSD in general, Haiku
relies on an external library.
2020-08-03 10:19:41 +00:00
David Carlier
a2b274d1a5 Haiku porting proposal. 2020-06-20 19:05:55 +00:00
Yamagi
5b327c0417 Don't use yield opcode if unsupported.
This is an enhancement to the previous `yield` work:

* Don't enforce `-march=armv8-a` for aarch64 builds, because it is the
  initial ARMv8 revision and compilers will either use that or something
  newer.
* Refine preprocessor guards around `asm("yield");` so the code isn't
  compiled in if unsupported by the current `-march='.

Submitted by @smcv in #535.
2020-04-03 08:30:41 +02:00
Denis Pauk
eeff4dae43 fix march armv8 2020-03-20 08:01:36 +02:00
David Carlier
558ee70b3e Issue 'yield' in main loop to give CPU time to cool down.
This is functional equvalent to the 'pause' instruction on x86.
2020-03-18 15:50:45 +01:00
Yamagi Burmeister
751b09ba33 Quote the raw architecture string, it might contain whitespaces. 2019-07-31 13:42:28 +02:00
Max Crofts
a43f3873a5 Link SDL with q2ded on Windows
This is in line with what the makefile does.
2019-05-07 19:16:02 +10:00
Max Crofts
332a322d8e Remove frame.c from CMakeLists.txt 2019-05-07 19:15:47 +10:00
Denis Pauk
203bc4b202 Update stb_image and add stb_image_resize code 2019-01-30 22:43:54 +02:00
Denis Pauk
07c472cfd2 Remove adivtab 2019-01-30 22:42:21 +02:00
Yamagi Burmeister
46503018f0 Require cURL in CMakeLists.txt if USE_CURL is defined. 2019-01-05 16:53:00 +01:00
Yamagi Burmeister
2271c0bb91 Add the HTTP and cURL stuff to cmake. 2018-12-20 18:01:38 +01:00
makson96
88e0d21cf0
Use CMake 'GREATER' insted on 'GREATER_EQUAL' 2018-08-26 20:46:55 +02:00
Yamagi Burmeister
692c544f30 Some modernizations to cmake.
* Pass the same compiler flags like make.
* Update FindSDL2.
* Remove unneeded FindOggVorbis.

There still some options missing, like the RPATHes or he ability to
define the system wide installation directory.
2018-08-14 15:29:41 +02:00
Yamagi Burmeister
daf3dc6f41 Remove ZIP compile time option.
Having ZIP optional only complicates things and is unnecessary now that
the dependency to zlib is gone.
2018-08-14 11:12:38 +02:00
Yamagi Burmeister
0264c6d946 Remove DOGG compile time option.
Having OGG optional only complicates things and is unnecessary now that
the dependencies to libvorbis and libogg are gone.
2018-08-14 10:40:50 +02:00
Yamagi Burmeister
e7fa5518a9 Replace zlib dependency by miniz single header library.
I've chosen the minimal invasive way for this:

  * Import miniz and remove -lz linker flags.
  * Create a short header minizconf.h roviding everything we need
    originally defined by zconf.h and not provided by miniz.
  * Replace zlib.h with miniz.h and minizconf.h.
2018-08-10 10:24:25 +02:00
Yamagi Burmeister
79e8c1377b Replace libvorbisfile with stb_vorbis single header lib.
This is (or at least should) work exactly the same a before but
saves us the dependencies to libogg, libvorbis and libvorbisfile.
2018-08-08 15:05:23 +02:00
Yamagi Burmeister
b97757e99f Some small make fixes. 2018-08-07 11:50:16 +02:00
Yamagi Burmeister
10bdaaec06 Move stb_image_write.h into vid. It's used there, only. 2018-08-07 11:45:26 +02:00
Yamagi Burmeister
d328aa9a9e Move rev.h into the client. 2018-08-07 10:20:02 +02:00
Yamagi Burmeister
5bff7e1568 Move refresh.c into the client and rename to glimp_sdl.c.
The GL backends have been an integral part of the vid interface for
years.
2018-08-07 10:08:20 +02:00
Yamagi Burmeister
b805b4e044 Move vid.c and dependencies into the client.
The vid interface has been exclusive to the client for years, trace
that in the file hierarchy.
2018-08-07 10:00:21 +02:00
Yamagi Burmeister
61400d1ae8 Move input.c and input.h into the client and rename to sdl.c.
The input system backend was once used in the client and the renderers,
but for some years now it has been an integral part of the client only.
Move it there.
2018-08-07 09:43:34 +02:00
Yamagi Burmeister
956902538f Move sound.c into the sound system source and rename to sdl.c.
The OpenAL backend was already part of the sound system source. And
there's no need for the SDL backend to be part of the generic backends.
2018-08-07 09:31:08 +02:00
Yamagi Burmeister
5501c38736 Move qal.c and qal.h to the other sound system sources.
The OpenAL backends used only by the sound system, there no need to
have them in the generic part of the sources.
2018-08-07 09:23:07 +02:00
Yamagi Burmeister
98d315ff20 Tell cmake that we prefer GLVND.
Yamagi Quake II runs fine with GLVND, most modern distros are using it,
so tell cmake about it and prevent some warnings.
2018-08-07 09:04:46 +02:00
Yamagi Burmeister
333d19766f Remove SDL 1.2 support from the build systems. 2018-07-31 14:32:13 +02:00