2023-05-02 18:45:04 +00:00
# LibLZMA is a custom addition to the emscripten SDK, so it is possible
# someone patched their SDK. Test out if the SDK supports LibLZMA.
2020-12-05 20:57:47 +00:00
include ( CheckCXXSourceCompiles )
set ( CMAKE_REQUIRED_FLAGS "-sUSE_LIBLZMA=1" )
check_cxx_source_compiles ( "
#include <lzma.h>
i n t main ( ) { r e t u r n 0 ; } "
L I B L Z M A _ F O U N D
)
if ( LIBLZMA_FOUND )
add_library ( LibLZMA::LibLZMA INTERFACE IMPORTED )
set_target_properties ( LibLZMA::LibLZMA PROPERTIES
I N T E R F A C E _ C O M P I L E _ O P T I O N S " - s U S E _ L I B L Z M A = 1 "
I N T E R F A C E _ L I N K _ L I B R A R I E S " - s U S E _ L I B L Z M A = 1 "
)
else ( )
message ( WARNING "You are using an emscripten SDK without LibLZMA support. Many savegames won't be able to load in OpenTTD. Please apply 'emsdk-liblzma.patch' to your local emsdk installation." )
endif ( )