Merge dd137ba520
into 3eefa464ee
This commit is contained in:
commit
24c16f2d5a
2 changed files with 27 additions and 4 deletions
|
@ -17,16 +17,22 @@ asm(".const_data\n"
|
|||
asm(".section .data, \"\",@\n"
|
||||
".global brotli_dictionary_data\n"
|
||||
"brotli_dictionary_data:\n");
|
||||
#else
|
||||
#elif !defined AK_OS_WINDOWS
|
||||
asm(".section .rodata\n"
|
||||
".global brotli_dictionary_data\n"
|
||||
"brotli_dictionary_data:\n");
|
||||
#endif
|
||||
asm(".incbin \"" __FILE__ ".dict.bin\"\n"
|
||||
#if (!defined(AK_OS_WINDOWS) && !defined(AK_OS_EMSCRIPTEN))
|
||||
".previous\n");
|
||||
#ifdef AK_OS_WINDOWS
|
||||
const
|
||||
# include <LibCompress/BrotliDictionary.dict.h>
|
||||
; // for clang-format
|
||||
#else
|
||||
asm(".incbin \"" __FILE__ ".dict.bin\"\n"
|
||||
# if (!defined(AK_OS_WINDOWS) && !defined(AK_OS_EMSCRIPTEN))
|
||||
".previous\n");
|
||||
# else
|
||||
);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
namespace Compress {
|
||||
|
|
|
@ -12,3 +12,20 @@ set(SOURCES
|
|||
|
||||
serenity_lib(LibCompress compress)
|
||||
target_link_libraries(LibCompress PRIVATE LibCore LibCrypto)
|
||||
|
||||
# FIXME: Get rid of this when #embed becomes available.
|
||||
# Assuming xxd is available because it is part of the official git distro for Windows.
|
||||
if (WIN32)
|
||||
set(BINARY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/BrotliDictionary.cpp.dict.bin)
|
||||
set(HEADER_FILE ${CMAKE_CURRENT_BINARY_DIR}/BrotliDictionary.dict.h)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${HEADER_FILE}
|
||||
COMMAND xxd -i -n brotli_dictionary_data ${BINARY_FILE} ${HEADER_FILE}
|
||||
DEPENDS ${BINARY_FILE}
|
||||
COMMENT "Generating ${HEADER_FILE} from ${BINARY_FILE}"
|
||||
)
|
||||
|
||||
add_custom_target(GenerateHeader ALL DEPENDS ${HEADER_FILE})
|
||||
add_dependencies(LibCompress GenerateHeader)
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue