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 )
2024-04-18 17:37:33 +00:00
set ( CMAKE_REQUIRED_FLAGS "--use-port=contrib.liblzma" )
2020-12-05 20:57:47 +00:00
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
2024-04-18 17:37:33 +00:00
I N T E R F A C E _ C O M P I L E _ O P T I O N S " - - u s e - p o r t = c o n t r i b . l i b l z m a "
I N T E R F A C E _ L I N K _ L I B R A R I E S " - - u s e - p o r t = c o n t r i b . l i b l z m a "
2020-12-05 20:57:47 +00:00
)
else ( )
2024-04-18 17:37:33 +00:00
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." )
2020-12-05 20:57:47 +00:00
endif ( )