[CMake] Properly test if compiler supports compiler flags
[WebKit-https.git] / Source / ThirdParty / brotli / CMakeLists.txt
1 set(BROTLI_DIR "${THIRDPARTY_DIR}/brotli")
2
3 set(BROTLI_INCLUDE_DIRECTORIES
4   "${BROTLI_DIR}/dec"
5 )
6
7 set(BROTLI_SOURCES
8     ${BROTLI_DIR}/dec/bit_reader.c
9     ${BROTLI_DIR}/dec/decode.c
10     ${BROTLI_DIR}/dec/dictionary.c
11     ${BROTLI_DIR}/dec/huffman.c
12     ${BROTLI_DIR}/dec/state.c
13 )
14
15 include_directories("${BROTLI_INCLUDE_DIRECTORIES}")
16 add_definitions(-DBROTLI_BUILD_PORTABLE)
17 add_library(brotli STATIC ${BROTLI_SOURCES})
18
19 if (COMPILER_IS_GCC_OR_CLANG)
20     WEBKIT_ADD_TARGET_C_FLAGS(brotli -Wno-cast-align
21                                      -Wno-implicit-fallthrough)
22 endif ()