diff options
author | Martin Storsjö <martin@martin.st> | 2018-03-30 23:01:50 +0300 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-03-31 00:40:15 +0000 |
commit | a694e339d122744549a9b76b9ee14b0ad296ff27 (patch) | |
tree | fbfcd1041a511f55f56becd4b8be9b39c310c58c /CMakeLists.txt | |
parent | d4cfc7bca1e6d66431b98b78dc2e29d9ec1bf904 (diff) | |
download | libyuv-a694e339d122744549a9b76b9ee14b0ad296ff27.tar.gz |
Make the gflags library optional in the CMake build
When detected, add the necessary defines to actually use it.
Change-Id: I540c3e11e480be8aaab154ad91ee08cdc52319de
Reviewed-on: https://chromium-review.googlesource.com/988432
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ef6af435..ed4948f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,11 @@ if(TEST) target_link_libraries(libyuv_unittest glibc-compat) endif() - target_link_libraries(libyuv_unittest gflags) + find_library(GFLAGS_LIBRARY gflags) + if(NOT GFLAGS_LIBRARY STREQUAL "GFLAGS_LIBRARY-NOTFOUND") + target_link_libraries(libyuv_unittest gflags) + add_definitions(-DLIBYUV_USE_GFLAGS) + endif() endif() |