1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

Fix: [CMake] restore CMAKE_REQUIRED_FLAGS if you change it (#13393)

This commit is contained in:
Patric Stout
2025-01-27 20:41:51 +01:00
committed by GitHub
parent a7deb16e81
commit 119470f43e
3 changed files with 9 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
include(CheckCXXSourceCompiles)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "--use-port=contrib.liblzma")
check_cxx_source_compiles("
@@ -18,3 +19,5 @@ if (LIBLZMA_FOUND)
else()
message(WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please copy liblzma.py to your ports/contrib folder in your local emsdk installation.")
endif()
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})