1 # LibLZMA is a custom addition to the emscripten SDK, so it is possible
2 # someone patched their SDK. Test out if the SDK supports LibLZMA.
3 include(CheckCXXSourceCompiles)
4 set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
5 set(CMAKE_REQUIRED_FLAGS "--use-port=contrib.liblzma")
7 check_cxx_source_compiles("
9 int main() { return 0; }"
14 add_library(LibLZMA::LibLZMA INTERFACE IMPORTED)
15 set_target_properties(LibLZMA::LibLZMA PROPERTIES
16 INTERFACE_COMPILE_OPTIONS "--use-port=contrib.liblzma"
17 INTERFACE_LINK_LIBRARIES "--use-port=contrib.liblzma"
20 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.")
23 set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})