Commit Graph

245 Commits

Author SHA1 Message Date
Chris Thrasher
f443a9529b Take advantage of clang-format-14 features 2023-07-08 14:39:24 -06:00
Chris Thrasher
20f34d38fd Add tests for sf::Font 2023-07-07 13:21:56 -06:00
Chris Thrasher
f65c0058b9
Merge branch '2.6.x' into feature/backmerge 2023-07-07 12:05:02 -06:00
Chris Thrasher
1f23f7818e Don't override CMAKE_MODULE_PATH
The Conan package for SFML has to fix this so apparently it's a
real world problem.
2023-06-23 10:14:21 -06:00
Chris Thrasher
e9e25d52bc Loosen restrictions on unrecognized compilers
A core tenet of CMake is the idea that you can use any valid C++
compiler. By enumerating all supported compilers and emitting and
hard error when an unrecognized compiler is detected, we are violating
that tenet.

Relaxing this message from a fatal error to merely a warning continues
to communicate to users that their build may not succeed but it leaves
the door open for the build to potential succeed if the compiler meets
all of our requirements.
2023-06-22 16:26:26 -06:00
Lukas Dürrenberger
48fde44047 Merge branch '2.6.x' into master 2023-06-21 13:31:16 +02:00
Lukas Dürrenberger
f47403ab4d Update version number to 2.6.0 2023-06-20 23:44:57 +02:00
Chris Thrasher
f6dfc04938 Switch to Catch2 2023-05-13 12:38:11 -06:00
binary1248
ea4c448a85 Add support for installing and using the Mesa 3D library for OpenGL rendering. 2023-04-06 11:15:56 -06:00
Chris Thrasher
485d367a91 Inline sfml_add_external 2023-04-05 16:16:53 -06:00
Jonny
741fe219da
Use built-in CMake support for iOS
* Use built-in iOS support for cmake and expand tests to cover more configurations
* Adjust CI builds
* Update examples version

---------

Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
2023-04-03 23:36:33 +02:00
Chris Thrasher
5e75336753
Merge remote-tracking branch 'origin/2.6.x' into feature/backmerge 2023-02-09 20:22:56 -07:00
Chris Thrasher
6aaf132d41 Add support for installing with static libs when using DRM 2023-02-09 20:12:43 -07:00
kimci86
205794eb3f Explicitly specify required X11 components 2023-02-07 17:21:34 -07:00
Chris Thrasher
eb162df723 Use X11's find module
Added in CMake 3.14 so this wasn't accessible in prior versions of
SFML
2023-02-06 15:12:58 -07:00
Chris Thrasher
ab34b9f9bf Invoke run-clang-tidy with Python executable
This is required since Windows can't support she-bang scripts like
macOS and Linux were taking advantange of. This is more verbose but
ultimately the same as before.
2023-01-14 15:13:02 -07:00
Chris Thrasher
8a5e0f6933 Fix bug where clang-tidy CI job always passes 2023-01-06 17:17:57 -07:00
Chris Thrasher
3b6db4d18c Enforce variable case 2022-12-12 16:10:03 -07:00
Chris Thrasher
ad416ab531 Check for minimum required clang-tidy version 2022-12-12 16:10:03 -07:00
Chris Thrasher
75b0c3a9a1 Disable warnings as errors for Clang on Windows 2022-12-12 12:09:51 -07:00
Chris Thrasher
75642ef7aa Enable warnings as errors for clang-cl.exe 2022-12-11 13:51:15 -07:00
Chris Thrasher
e54bf87e9b Enable MSVC deprecation warning 2022-12-11 13:51:15 -07:00
Chris Thrasher
8c6b578012 Disallow clang-format version 15 and newer 2022-11-27 13:39:40 -06:00
Chris Thrasher
a5dbe59f07
Merge branch '2.6.x' 2022-10-13 14:33:11 -06:00
Chris Thrasher
88f9a33479 Use PROJECT_ variables 2022-10-12 00:23:35 +02:00
Chris Thrasher
b848a7b29a Only reference the project's directories, not parent directories 2022-10-12 00:23:35 +02:00
Chris Thrasher
fc0bd0bfc8 Don't specify standard library on macOS
libc++ is already the default and GCC can't even be used so there's
no circumstance where we'd need to explicitly tell Clang to use
libc++. I confirmed that even with this removed, libc++ headers are
still being used and found.
2022-10-12 00:23:35 +02:00
Vittorio Romeo
fd5c358c98 Add PCH builds via 'SFML_ENABLE_PCH' CMake option 2022-10-09 14:21:11 +02:00
Vittorio Romeo
753644a5bd Fix CMake formatting inconsistencies 2022-10-06 20:33:40 +02:00
Lukas Dürrenberger
4970af8999 Use CMake property to drive static linking
Using a newer CMake version allows us to make use of the
MSVC_RUNTIME_LIBRARY added in CMake 3.15, which handles static linking
of the runtime library with MSVC a lot simpler
2022-09-30 22:17:03 +02:00
Chris Thrasher
50cec7d2ed Treat each test case as a unique test 2022-09-10 20:03:25 +03:00
Chris Thrasher
40b175adf4 Remove check for old macOS versions
There is no need to check for macOS 10.6 or lower. Snow Leopard came
out in 2009. Because it's nearly 13 years old, it's safe to say
nobody will be trying to build SFML 3 on Snow Leopard.

This was added in de70f691e way back in 2011 when Snow Leopard was
a mere cub.
2022-08-22 11:26:57 +08:00
Chris Thrasher
b7510fd09e Fix formatting and style
Use all lower_case commands with no space between the command name
and the open parentheses. Don't repeat conditional in else() and
endif() calls.
2022-08-22 11:26:57 +08:00
Chris Thrasher
8384139983 Remove unnecessary variable assignment
This same code already exists in src/CMakeLists.txt
2022-08-22 11:26:57 +08:00
Chris Thrasher
1dcaa9a396 Fix CMake error messages 2022-08-22 11:26:57 +08:00
Chris Thrasher
aa82ea132b Set warnings with target_compile_options
The use of target_compile_options makes it easy to append warnings
to a target. The use of generator expressions also more succinctly
handles a few edge cases for compiler bugs and platform-specific
oddities.

This should be easy to read and maintain than the variable-based
solution it replaces.
2022-08-14 14:00:00 +08:00
Chris Thrasher
142ccf57bd Enable compiler warnings for Android 2022-08-12 18:01:36 +02:00
Chris Thrasher
97537d36b3 Remove unnecessary CMake version checks
Now that the project requires CMake version 3.15, all of these
checks are guaranteed to eveluate one way or the other so they can
be removed.
2022-07-18 12:43:49 +02:00
Chris Thrasher
55a1a2a4c4 Format .m files 2022-07-14 21:47:49 +02:00
metaquarx
88e9f82bee Add '.clang-format' file, CI integration, and formatting exceptions
Co-authored-by: Vittorio Romeo <vittorio.romeo@outlook.com>
Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
Co-authored-by: kimci86 <kimci86@hotmail.fr>
2022-07-11 20:04:56 +02:00
Chris Thrasher
0812054e02 Remove trailing whitespace 2022-06-25 21:32:55 +02:00
Bambo-Borris
12c091e0ce Disable /WX for clang-cl 2022-06-12 17:40:01 +02:00
Chris Thrasher
5fde1ca613 Hide symbols in cross platform manner 2022-05-21 21:35:35 +02:00
Chris Thrasher
3301c47755 Remove CompileOptionsOverride
These overrides existed to prevent MSVC errors related to duplicate
compiler warnings. Because we required a version of CMake older
3.15, CMake would add /W3 as a default compiler flag when using
MSVC. We then add /W4 in addition to that. Modern CMake versions
seem to deduplicate these warnings but older versions did not.

The easist fix is to raise the minimum CMake version to 3.15 which
changes the default behavior to no longer add /W3 without being
explicitly specified. See the below link for more information about
this behavior change.

https://cmake.org/cmake/help/latest/policy/CMP0092.html
2022-05-09 15:38:39 +02:00
Chris Thrasher
2a5ce3c989 Apply compiler warnings to tests 2022-05-02 08:39:02 +02:00
Chris Thrasher
8a4563361f Set compiler warnings on a per-target, not per-file basis
No 1st party SFML targets contain 3rd party source code so it's
safe and correct to apply warnings to the entire target.
2022-05-02 08:39:02 +02:00
Lukas Dürrenberger
9a6142bd22 Merge branch '2.6.x' 2022-04-27 08:12:25 +02:00
Radek Dutkiewicz
b6ca47e128 DRM Implementation
Ported sfml-pi DRM/KMS backend written by @mickelson 
Port co-authored by @substring

Co-authored-by: Andrew Mickelson <andrew.mickelson@gmail.com>
Co-authored-by: Gil Delescluse <frog2wah@gmail.com>
2022-04-26 07:44:14 +02:00
Chris Thrasher
4b93727413 Enable MSVC standards conformance 2022-04-19 08:33:27 +02:00
friendlyanon
9b3735c05f Honor OPTIONAL_COMPONENTS when finding SFML
The "main" component is not available everywhere, but passing it to the
find_package(SFML) call via the OPTIONAL_COMPONENTS still fails the call
on platforms like Linux.

This commit enables SFML to be used the same in a cross-platform fashion
without forcing consumers to put custom logic around importing SFML.
Example that works with this commit, but break before:

    find_package(SFML REQUIRED graphics OPTIONAL_COMPONENTS main)
    target_link_libraries(dummy PRIVATE SFML::graphics)
    if(SFML_MAIN_FOUND)
      target_link_libraries(dummy PRIVATE SFML::main)
    endif()
2022-03-29 00:30:04 +02:00