Commit Graph

112 Commits

Author SHA1 Message Date
Chris Thrasher
3f6403e279 Stop manipulating standard library flags for macOS builds 2023-09-25 22:41:36 -06:00
Chris Thrasher
78973e4a06 Use imported targets for Vorbis and Ogg
The name of the find module was changed to match the name used by
the reference implementation of Vorbis. Likely the target names were
taken from what the reference implementation names those targets.
2023-08-29 23:18:00 -06:00
Chris Thrasher
af7d6c2589 Simplify sfml_find_package
All in service of hopefully removing sfml_find_package one day since
that will simplify packaging SFML and better set us up for adopting
a package manager.
2023-08-23 09:14:59 -06:00
Chris Thrasher
ddfb7f6cb0 Use modern name for macOS
In a few places I left references to the old name where appropriate.
There are also many CMake references to "OSX" that we have to keep
using since CMake does not offer alternative names for those variables
and target properties.
2023-07-24 21:25:26 -06:00
Chris Thrasher
b298b728f5 Remove unnecessary export() call 2023-07-23 19:41:03 -06:00
Chris Thrasher
20f34d38fd Add tests for sf::Font 2023-07-07 13:21:56 -06: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
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
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
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
5fde1ca613 Hide symbols in cross platform manner 2022-05-21 21:35:35 +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
Chris Thrasher
5236513f16 Simplify how tests are built 2022-02-16 13:51:29 +00:00
binary1248
66339bc09c Added support for coverage reporting. 2022-02-10 08:08:47 +01:00
Chris Thrasher
8f1955af17 Don't add SFML:: namespace to external targets
The SFML target export set includes a number of external targets
which are not owned by the project itself. This includes targets
like Freetype and OpenGL. By specifying a namespace for the export
set, a SFML:: namespace was prepended to all targets. This is not
a problem when using shared libraries but when building and using
static libraries caused a problem where CMake was attempting and
failing to find targets with names like SFML::Freetype or
SFML::OpenGL which did not exist.

Luckily CMake allows you put namespaces in the EXPORT_NAME target
property so now we can just add the SFML:: namespace in the macro
which creates SFML targets and remove the `NAMESPACE SFML::` line
which was adding namespaces to all targets.
2022-01-28 08:11:53 +01:00
Chris Thrasher
a322d18e63 Use built-in CMake project version functionality 2022-01-21 21:09:20 +01:00
Chris Thrasher
4586db91a9 Add SFML:: namespace to targets
This removes the sfml- prefixed targets from the export set. The sfml-
prefixed targets are still available within the build tree but not to
downstream users thus making this an API breaking change when compared
to the 2.x releases. To keep things consistent, usage of the sfml-
targets were replaced with their namespaced counterparts.

This has a number of benefits:

  1. It's more idiomatic. Modern CMake libraries are expected to
     have namespaced targets.

  2. Namespaced targets are less likely to collide with user-defined
     targets. No one will accidentally define a SFML:: target.

  3. If a namespaced target is not found by CMake, configuration
     will immediately stop.
2022-01-11 22:27:39 +01:00
Lukas Dürrenberger
3a402f241a Merge branch '2.6.x' into feature/back_merge 2022-01-08 12:28:34 +01:00
Chris Thrasher
ff4fc05b18 Stop configuration when GCC is detected on macOS 2022-01-02 23:15:05 +01:00
Chris Thrasher
dafdacfa20 Let tests and examples inherit language requirement from upstream targets
It's not necessary to re-specify cxx_std_17 since any example or test
which depends on a core target (which should be all of them) will pick
up this language requirement that should be a public property of those
targets. If that changes, these examples and tests will possibly fail
to compile and correctly catch the bug that was introduced in the core
library targets.
2021-12-28 15:53:08 +01:00
Vittorio Romeo
46639ed277 Manipulate library names on Windows + Clang 2021-12-22 08:53:03 +01:00
Vittorio Romeo
4a189d6602 Remove build logic for unsupported compilers 2021-12-19 21:51:53 +01:00
Vittorio Romeo
bd12438916 Enable and require C++17 support for all targets 2021-12-02 20:13:04 +01:00
Lukas Dürrenberger
01836ccea4 Fix conversion warnings for the Graphics module
- Fix conversion and shadowing warnings
- Add SYSTEM indicator for stb_*, FreeType and other headers
2021-11-30 11:25:58 +01:00
binary1248
a759ccd5db Enable compiler warnings. 2021-11-30 11:25:58 +01:00
Marty E. Plummer
6ad96cf9b7 windows: add resource.rc files to dll builds
Windows uses a mechanism known as 'resource files' which provides, among
other things, metadata to a given executable/dll/driver/etc, and add a
layer of polish to a project which it would otherwise lack.
2021-04-11 16:02:51 +02:00
Jonny
27a4c83ebc Use GnuInstallDirs module for cmake install paths 2019-09-01 21:48:10 +02:00
Lukas Dürrenberger
7e7216f598 Renamed test targets to test-sfml-module structure 2019-02-19 10:16:38 +01:00
=
53972ed5f2 Use sfml_add_test macro for unit tests and copy dlls to output directory if required 2019-02-19 10:16:38 +01:00
Jonny Paton
353c846c87 Update examples for iOS including touch support, proper handling of window resize, launch screens and icons 2019-01-19 01:34:30 +01:00
Ceylo
82c2f4c05e All mobile-compatible examples now successfully link 2019-01-19 01:29:12 +01:00
Elias Daler
b81de898bf Modify install rpath only if BUILD_SHARED_LIBS is ON 2018-12-03 19:39:19 +01:00
Elias Daler
fbc0f17198 Fix RPATH for installed examples on Linux 2018-12-03 19:39:19 +01:00
Ceylo
ff011dc51d Modernize iOS toolchain: remove BUILD_ARM64, drop support for Xcode <4.3 and don't pretend defining official CMake variables 2018-06-04 23:22:21 +02:00
James Cowgill
88bb3f89a5 Install CMake config files into lib${LIB_SIFFIX} 2018-05-18 22:05:48 +02:00
Marty E. Plummer
c828314d12 cmake/Macros.cmake: ex:->examples:
vim interprets the # ex: comments as a modeline, which causes editing
this file with vim to throw an error.

Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
2018-05-18 21:50:25 +02:00
Mario Liebisch
2cd4797557 Examples: Set startup folder for debugging in Visual Studio 2018-04-14 11:02:21 +02:00
Jonny Paton
7be2111d61 Add iOS demo 2018-03-26 18:42:19 -07:00