Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/SFML/SFML into feature/pc…
Browse files Browse the repository at this point in the history
…h_improvements_and_catch2_support
  • Loading branch information
vittorioromeo committed May 4, 2024
2 parents ba39ec3 + 2386653 commit fe735e9
Show file tree
Hide file tree
Showing 280 changed files with 99,052 additions and 5,733 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ IncludeCategories:
- Priority: 8
Regex: '^<SFML\/System'
- Priority: 9
Regex: '^<(glad|gl|X11|jni|android|stb_|GLES2|vorbis|catch2)'
Regex: '^<(glad|gl|X11|jni|android|stb_|GLES2|vorbis|miniaudio|catch2)'
- Priority: 10
Regex: '^<([^c](.+)|coroutine|charconv|chrono|complex|concepts|condition_variable)>$'
- Priority: 11
Expand Down
10 changes: 7 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Checks: >
readability-*,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-implicit-widening-of-multiplication-result,
Expand All @@ -18,10 +19,10 @@ Checks: >
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-string-integer-assignment,
-bugprone-suspicious-include,
-bugprone-switch-missing-default-case,
-bugprone-unchecked-optional-access,
-clang-analyzer-nullability.NullablePassedToNonnull,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-optin.cplusplus.VirtualCall,
-clang-analyzer-optin.osx.*,
-clang-analyzer-osx.*,
Expand All @@ -31,10 +32,9 @@ Checks: >
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
Expand All @@ -57,8 +57,10 @@ Checks: >
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-avoid-endl,
-performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-int-to-ptr,
-readability-avoid-nested-conditional-operator,
-readability-braces-around-statements,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
Expand All @@ -68,6 +70,8 @@ Checks: >
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
-readability-redundant-casting,
-readability-redundant-member-init,
-readability-uppercase-literal-suffix,
CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
Expand Down
40 changes: 0 additions & 40 deletions .github/.codecov.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ body:
while (window.isOpen())
{
for (sf::Event event; window.pollEvent(event);)
while (const auto event = window.pollEvent())
{
if (event.type == sf::Event::Closed)
if (event.is<sf::Event::Closed>())
window.close();
}
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ body:
while (window.isOpen())
{
for (sf::Event event; window.pollEvent(event);)
while (const auto event = window.pollEvent())
{
if (event.type == sf::Event::Closed)
if (event.is<sf::Event::Closed>())
window.close();
}
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ int main()

while (window.isOpen())
{
for (sf::Event event; window.pollEvent(event);)
while (const auto event = window.pollEvent())
{
if (event.type == sf::Event::Closed)
if (event.is<sf::Event::Closed>())
window.close();
}

Expand Down
199 changes: 142 additions & 57 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

12 changes: 2 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ endif()

option(SFML_ENABLE_SANITIZERS "Enable sanitizers" OFF)
if(SFML_ENABLE_SANITIZERS)
list(APPEND CMAKE_CXX_FLAGS "-fno-omit-frame-pointer -fno-sanitize-recover=all -fsanitize=undefined")
string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -fno-sanitize-recover=all -fsanitize=undefined")
endif()

# set the output directory for SFML DLLs and executables
Expand Down Expand Up @@ -384,14 +384,12 @@ if(SFML_OS_WINDOWS)
if(NOT SFML_USE_SYSTEM_DEPS)
# install the binaries of SFML dependencies
if(ARCH_32BITS)
install(DIRECTORY extlibs/bin/x86/ DESTINATION ${CMAKE_INSTALL_BINDIR})
if(SFML_COMPILER_MSVC OR (SFML_COMPILER_CLANG AND NOT MINGW))
install(DIRECTORY extlibs/libs-msvc-universal/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
elseif(ARCH_64BITS)
install(DIRECTORY extlibs/bin/x64/ DESTINATION ${CMAKE_INSTALL_BINDIR})
if(SFML_COMPILER_MSVC OR (SFML_COMPILER_CLANG AND NOT MINGW))
install(DIRECTORY extlibs/libs-msvc-universal/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
else()
Expand Down Expand Up @@ -428,10 +426,6 @@ elseif(SFML_OS_MACOS)
if(VORBISFILE_LIBRARY STREQUAL "${PROJECT_SOURCE_DIR}/extlibs/libs-macos/Frameworks/vorbisfile.framework")
install(DIRECTORY extlibs/libs-macos/Frameworks/vorbisfile.framework DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()

if(OPENAL_LIBRARY STREQUAL "${PROJECT_SOURCE_DIR}/extlibs/libs-macos/Frameworks/OpenAL.framework")
install(DIRECTORY "${OPENAL_LIBRARY}" DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()

# install the Xcode templates if requested
Expand Down Expand Up @@ -523,9 +517,7 @@ sfml_set_option(SFML_BUILD_TEST_SUITE FALSE BOOL "TRUE to build the SFML test su
sfml_set_option(SFML_ENABLE_COVERAGE FALSE BOOL "TRUE to enable coverage reporting, FALSE to ignore it")

if(SFML_BUILD_TEST_SUITE)
if(SFML_OS_IOS)
message(WARNING "Unit testing not supported on iOS")
elseif(SFML_BUILD_WINDOW AND SFML_BUILD_GRAPHICS AND SFML_BUILD_NETWORK AND SFML_BUILD_AUDIO)
if(SFML_BUILD_WINDOW AND SFML_BUILD_GRAPHICS AND SFML_BUILD_NETWORK AND SFML_BUILD_AUDIO)
enable_testing()
add_subdirectory(test)
else()
Expand Down
10 changes: 10 additions & 0 deletions cmake/Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ function(sfml_add_test target SOURCES DEPENDS)
add_dependencies(${target} "install-mesa3d")
endif()

# Delay test registration when cross compiling to avoid running crosscompiled app on host OS
if(CMAKE_CROSSCOMPILING)
set(CMAKE_CATCH_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST)

# When running tests on Android, use a custom shell script to invoke commands using adb shell
if(SFML_OS_ANDROID)
set_target_properties(${target} PROPERTIES CROSSCOMPILING_EMULATOR "${PROJECT_BINARY_DIR}/run-in-adb-shell.sh")
endif()
endif()

# Add the test
catch_discover_tests(${target} WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endfunction()
Expand Down
120 changes: 0 additions & 120 deletions cmake/Modules/FindOpenAL.cmake

This file was deleted.

1 change: 0 additions & 1 deletion cmake/SFMLConfigDependencies.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ if(SFML_STATIC_LIBRARIES)
# SFML::Audio
list(FIND SFML_FIND_COMPONENTS "Audio" FIND_SFML_AUDIO_COMPONENT_INDEX)
if(FIND_SFML_AUDIO_COMPONENT_INDEX GREATER -1)
find_package(OpenAL)
find_package(Vorbis)
find_package(FLAC)
endif()
Expand Down
4 changes: 2 additions & 2 deletions doc/mainpage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
/// while (window.isOpen())
/// {
/// // Process events
/// for (sf::Event event; window.pollEvent(event);)
/// while (const auto event = window.pollEvent())
/// {
/// // Close window: exit
/// if (event.type == sf::Event::Closed)
/// if (event.is<sf::Event::Closed>())
/// window.close();
/// }
///
Expand Down
6 changes: 5 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ if(SFML_BUILD_GRAPHICS)
if(NOT SFML_USE_DRM)
add_subdirectory(X11)
endif()
elseif(SFML_OS_MACOS AND ${CMAKE_GENERATOR} MATCHES "Xcode")
elseif(SFML_OS_MACOS)
add_subdirectory(cocoa)
endif()
endif()
if(SFML_BUILD_GRAPHICS AND SFML_BUILD_AUDIO)
add_subdirectory(tennis)

if(NOT SFML_OPENGL_ES)
add_subdirectory(sound_effects)
endif()
endif()

0 comments on commit fe735e9

Please sign in to comment.