mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-11 19:36:47 +02:00
cmake: add WEBP_USE_THREAD option
this controls the config.h define of the same name and matches the behavior of configure's --disable-threading Bug: webp:502 Change-Id: Id135bbf4e6b3c9900e2b4f4f7ab744b3457ce41c
This commit is contained in:
parent
926ce921f3
commit
759b9d5a06
@ -29,6 +29,7 @@ option(WEBP_BUILD_WEBPINFO "Build the webpinfo command line tool." ON)
|
||||
option(WEBP_BUILD_WEBPMUX "Build the webpmux command line tool." ON)
|
||||
option(WEBP_BUILD_EXTRAS "Build extras." ON)
|
||||
option(WEBP_BUILD_WEBP_JS "Emscripten build of webp.js." OFF)
|
||||
option(WEBP_USE_THREAD "Enable threading support" ON)
|
||||
option(WEBP_NEAR_LOSSLESS "Enable near-lossless encoding" ON)
|
||||
option(WEBP_ENABLE_SWAP_16BIT_CSP "Enable byte swap for 16 bit colorspaces."
|
||||
OFF)
|
||||
@ -50,6 +51,7 @@ if(WEBP_BUILD_WEBP_JS)
|
||||
set(WEBP_BUILD_WEBPINFO OFF)
|
||||
set(WEBP_BUILD_WEBPMUX OFF)
|
||||
set(WEBP_BUILD_EXTRAS OFF)
|
||||
set(WEBP_USE_THREAD OFF)
|
||||
|
||||
if(WEBP_ENABLE_SIMD)
|
||||
message("wasm2js does not support SIMD, disabling webp.js generation.")
|
||||
|
@ -22,10 +22,8 @@ check_c_source_compiles("
|
||||
" HAVE_BUILTIN_BSWAP64)
|
||||
|
||||
# Check for libraries.
|
||||
if(NOT WEBP_BUILD_WEBP_JS)
|
||||
# Disable pThreads for WASM.
|
||||
if(WEBP_USE_THREAD)
|
||||
find_package(Threads)
|
||||
endif()
|
||||
if(Threads_FOUND)
|
||||
# work around cmake bug on QNX (https://cmake.org/Bug/view.php?id=11333)
|
||||
if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
|
||||
@ -42,6 +40,7 @@ if(Threads_FOUND)
|
||||
list(APPEND WEBP_DEP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
set(WEBP_USE_THREAD ${Threads_FOUND})
|
||||
endif()
|
||||
|
||||
# TODO: this seems unused, check with autotools.
|
||||
set(LT_OBJDIR ".libs/")
|
||||
|
Loading…
x
Reference in New Issue
Block a user