From e9e25d52bc35ce81b86692396090253faa2f32c4 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 22 Jun 2023 11:01:13 -0600 Subject: [PATCH 1/4] 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. --- cmake/Config.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 2ce5ac46d..48bf1d03d 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -131,6 +131,5 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) set(SFML_COMPILER_GCC_W64 1) endif() else() - message(FATAL_ERROR "Unsupported compiler") - return() + message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}. Use at your own risk.") endif() From 1f23f7818e697109c89b446680d3262aaf06861a Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 22 Jun 2023 14:33:41 -0600 Subject: [PATCH 2/4] Don't override `CMAKE_MODULE_PATH` The Conan package for SFML has to fix this so apparently it's a real world problem. --- cmake/Macros.cmake | 2 +- src/SFML/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index e0118eb68..77a7d11e4 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -384,7 +384,7 @@ function(sfml_find_package) message(FATAL_ERROR "Unknown arguments when calling sfml_import_library: ${THIS_UNPARSED_ARGUMENTS}") endif() - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") if (SFML_OS_IOS) find_host_package(${target} REQUIRED) else() diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt index 84a770593..c60bc4fc9 100644 --- a/src/SFML/CMakeLists.txt +++ b/src/SFML/CMakeLists.txt @@ -40,7 +40,7 @@ elseif(SFML_OS_ANDROID) endif() # define the path of our additional CMake modules -set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") # set the output directory for SFML libraries set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib") From a19f996a11681508aabdf552cab9c9f921839d14 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 27 Jun 2023 08:12:41 -0600 Subject: [PATCH 3/4] Remove C++11 header --- src/SFML/Audio/SoundFileReaderMp3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SFML/Audio/SoundFileReaderMp3.cpp b/src/SFML/Audio/SoundFileReaderMp3.cpp index 7d980a94a..817cb4ca4 100644 --- a/src/SFML/Audio/SoundFileReaderMp3.cpp +++ b/src/SFML/Audio/SoundFileReaderMp3.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include namespace @@ -66,7 +66,7 @@ std::size_t readCallback(void* ptr, std::size_t size, void* data) return static_cast(stream->read(ptr, static_cast(size))); } -int seekCallback(std::uint64_t offset, void* data) +int seekCallback(uint64_t offset, void* data) { sf::InputStream* stream = static_cast(data); sf::Int64 position = stream->seek(static_cast(offset)); From 25920bb6d70d8b52835129c65a75d4fb6ec939be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Tue, 4 Jul 2023 23:29:10 +0200 Subject: [PATCH 4/4] Ensure that the OpenGL extensions have been loaded --- src/SFML/Graphics/Texture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index ae1883e25..9ba6eeb57 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -806,6 +806,9 @@ unsigned int Texture::getMaximumSize() TransientContextLock transientLock; + // Make sure that extensions are initialized + sf::priv::ensureExtensionsInit(); + glCheck(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size)); }