Commit Graph

34 Commits

Author SHA1 Message Date
fruzitent
7b92b5bde7
fix: infer CMAKE_MODULE_PATH in super-build (#4042) 2024-06-07 10:22:24 +02:00
Benji
b00e467494
Revert "Build specific example using -DBUILD_EXAMPLE cmake flag (#3921)" (#3922)
This reverts commit c1fd98591d.
2024-04-19 08:43:24 +02:00
Benji
c1fd98591d
Build specific example using -DBUILD_EXAMPLE cmake flag (#3921) 2024-04-17 19:26:18 +02:00
Alexandre Almeida
85a46e42bd
CMake: Remove USE_WAYLAND option (#3851)
* CMake: Remove USE_WAYLAND option

* Consistency fix

* Fix oversight
2024-03-04 19:59:26 +01:00
Ray
fd84ab3cf7 Bump CMake version required to avoid deprecated #3639 2023-12-15 19:17:44 +01:00
Peter0x44
e7a486fa81
Hide unneeded internal symbols when building raylib as an so or dylib (#3573) 2023-11-28 20:43:45 +01:00
Aniket Teredesai
b9f98dd8cd
[build]: add uninstall cmake target (#3511) 2023-11-06 10:12:36 +01:00
Random
03f5fce672
removed glfwSetWindowPos on InitWindow (#2732)
* removed glfwSetWindowPos on InitWindow

* removed execute permission from CMakeLists
2022-10-02 10:46:33 +02:00
archie2x
e87caa2687
Fix #2621: Set CMP0054 policy to NEW and appropriately quote ${PLATFORM} (#2622) 2022-08-09 09:52:56 +02:00
hristo
88a6f16c9a
Documentation cmake (#1549)
* Documenting the compiler flags

* Moved some android compiler flags and added documentation on them too.

* Some more restructuring.

Removed unnecessary comments that were self described by the code.
Added some more explanations around certain parts of CMake and especially around compiler flags.
2021-01-26 14:34:27 +01:00
hristo
9821725c6b
Big cmake changes (#1514)
* Delete emscripten.cmake

This file is not needed at this point. EMSDK provides a toolchain file that has a lot more things in it and is better supported. Project currently works fine with the documentation provided in Emscripten SDK on how to build projects.

* First pass file separation.

The main two files are cleaner now. Only important things can be seen. Major changes include:
- raylib_static is now the alias instead of raylib
- Repeating segments are removed and pulled into separate files into <root>/cmake
- File is reordered to make more sense
- Installs are better structured
- Library is build into an output directory "raylib" instead of "src"
- All public header files are now set as a public header file
- Source files need to be listed (it is a bad practice to capture them using wildcards and file globs)
- CMakeLists are better commented

* Second pass on the example dirs.

They are quite complex so I'm more hesitant to do major changes. Also it works pretty well. Noticed that I forgot one of the seperated files and added it into src/CMakeLists.txt.

* Returned the header copy as it was convenient to have the public headers copied.

* A better description to the variable RAYLIB_IS_MAIN

Co-authored-by: Rob Loach <robloach@gmail.com>

* Remove debug message

Co-authored-by: Rob Loach <robloach@gmail.com>

* Improvements based on review.

* Simplify the install condition to not be platform specific as it was before.

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

* Remove some CMAKE variables as they don't affect the build in any way

Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>

Co-authored-by: Rob Loach <robloach@gmail.com>
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
2021-01-13 23:10:02 +01:00
hristo
3ec8ac52f8
Building examples by default only if raylib is standalone. (#1460)
This change only modifies the default value. In cmake you can have raylib as a subdirectory (dependency) and when you have it as dependency you wouldn't probably want to use the example by default. You can still use the option to enable them though.
2020-12-14 19:24:20 +01:00
hristo
6e79476650
Fixed the build for web using CMake. (#1452)
* Fixed the build for web using CMake.

I found that the build for me was failing and I added some if defined checks in the core.c file where the glfwSetWindowAttrib was used. (error: implicit declaration of function 'glfwSetWindowAttrib' is invalid in C99 [-Werror,-Wimplicit-function-declaration])

I also changed some values in the toolchain file so that it correctly uses the .bat files when on windows.

* Cleaned up the additional variables (they are not important)

* Added more improvements to cmakelists

Added the option to use the system provided Emscripten toolchain to be more uniform with other libraries.

Fixed and issue which prevented example being built from cmake and also building with html extensions properly.

* Fixed ENUM to STRING because of a missed warning
2020-12-13 20:29:47 +01:00
raysan5
26f39e41a9 Remove games from building 2020-04-13 15:10:42 +02:00
Ahmad Fatoum
6c9f6cf084 Revert "CMake: Don't create symlinks on unsupporting file systems (#539)"
As noted in #539, the symlink check was to support compiling raylib on
VirtualBox vboxfs as no symlinks are supported there.

With me using Linux as daily driver outside VirtualBox now, this 'feature'
is most likely unused by anyone, but still annoys other users (#791).
Just revert it and be done with it. If there are really others building
raylib on vboxfs or a similarly crippled file system under Linux, they
should now step forward when their build breaks.

This reverts commit b8ca51fd01.
2020-04-08 11:01:26 +02:00
Ahmad Fatoum
3e0e91013f
Revert "CMake: make unsequenced modifications an error"
This reverts commit 23c1c0bdb2.

Because add_if_flag_compiles apparently allows unsequenced
even if the compiler doesn't support it..
2019-05-04 23:56:38 +02:00
Ahmad Fatoum
23c1c0bdb2
CMake: make unsequenced modifications an error
They not only result in discrepancies between different compiler,
but trigger undefined behavior. Avoid them by having them break
the CMake build and CI.
2019-05-04 23:20:29 +02:00
myd7349
61181f2c49 Fix CMake support on Win32 2019-04-09 18:03:25 +08:00
Ahmad Fatoum
3f09726331
CMake: Major cleanup to support find_package(raylib)
Remove that link_libraries_to_executable() hack and defines a proper
raylib target that can be used with target_link_libraries.

The same target is also available for external (user) code by using
find_package(raylib).

This results in:

- Remove hardcoded build directories from examples and games CMakeLists.txt
- Allow rlgl_standalone and other special examples to be built easily
- Allow CMake projects to find_package(raylib instead of fiddling with pkg-config
- Makes code a little more maintainable
- Fixes #471, #606.
- Makes code less confusing by removing the double use of PLATFORM (#584).

Note that this is still not _The Right Way_(TM), because normally
raylib-config.cmake (or its includes) would be automatically generated.
I didn't manage to get that to work though, so I went the easier route
of just wrapping pkg_check_modules for consumption by find_package.
2018-07-29 12:35:35 +02:00
Ahmad Fatoum
c3aeaf4a49
Travis CI: Add test case for pkg-config 2018-07-03 21:35:28 +02:00
Ahmad Fatoum
ff55af14f9
CMake: Move reusable code to new cmake/ directory 2018-05-21 01:08:29 +02:00
Ahmad Fatoum
f11fe80180
CMake: Use same message for symlink check and result 2018-05-10 23:07:25 +02:00
Ahmad Fatoum
b8ca51fd01
CMake: Don't create symlinks on unsupporting file systems (#539)
Panders to the idiosyncrasies of my work flow:
I have my raylib build directory mounted as a VirtualBox vboxfs for use
with my Linux VM, but vboxfs doesn't support symlinks, while raylib shared
library versioning on Unix expects symlinks to work.
If this happens, library versioning is now disabled on Unix with
an error message instead of just failing the build.
2018-05-10 21:03:43 +02:00
maficccc@gmail.com
4c0925067a Add message warning for msan 2018-03-14 15:23:14 +01:00
maficccc@gmail.com
82491fcf6c Add memory sanitizer for better debug 2018-03-14 00:13:23 +01:00
Ahmad Fatoum
1430d01906
jar_xm: Workaround for unaligned pointer accesses
jar_xm.h does some shady pointer casts leading to unaligned accesses
and breaking strict aliasing. x86 has special circuitry for doing
unaligned accesses, but on other architectures, it may trap and require
kernel fix-up or crash outright. With this patch, one obstacle in
porting raylib to the GameBoy Advance has been removed. Go for it ;-)

To avoid having to rewrite that `mempool' code, insert padding before
structs and instruct the compiler (GCC, most importantly), to be gentle
when optimizing.

This fixes #490 (Unless we got ourselves 256-bit pointers, if so,
hello future!)
2018-02-24 23:59:56 +01:00
Ahmad Fatoum
c9043b5a87
CMake: Add options to use -fsanitize={address,undefined}
To make bugs like #485, #486, #487 and #488 easier to find in future.
2018-02-24 15:37:38 +01:00
Ahmad Fatoum
8be93762d9
Make function calls without prior declaration an error
which is the default behavior on C99 and up.
2018-01-25 22:34:29 +01:00
Ahmad Fatoum
30ef3f3122
GCC/Clang: Treat void pointer arithmetic as error
As an extension, GNU C treats sizeof(void) as 1. MSVC doesn't.
Make it an error on GCC/Clang to avoid accidental MSVC breakage.
2018-01-18 13:22:41 +01:00
Ahmad Fatoum
ca921e5a53 CMake: Explicitly ask for C99 support
Otherwise using a compiler that defaults to -std=c89 or -std=gnu89 will
fail. Example:
http://www.cpantesters.org/cpan/report/abb85066-d283-11e7-9926-b2f4efb9c382

Apparently, -m32 Travis CI build was broken: -m32 was overridden by
-std=gnu99.  This fixes that.
2017-11-27 02:10:56 +01:00
ASDF
e173db19f7 CMake based build system.
Some people might find this handly
2017-08-27 13:28:02 -04:00
Ray
ad8a5a95b2 Move and update CMakeList 2016-06-06 14:38:54 +02:00
Joshua Reisenauer
9f2fc81df2 update to openal 2016-05-30 15:34:29 -07:00
Joshua Reisenauer
f74791ed7b better build system 2016-05-23 02:12:22 -07:00