aboutsummaryrefslogtreecommitdiff
path: root/files/CMakeLists.txt
diff options
context:
space:
mode:
authorVignesh Venkatasubramanian <vigneshv@google.com>2023-06-12 23:55:07 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-06-12 23:55:07 +0000
commit1f9deebc6ecf78b637dff50d62772b48332ea5ea (patch)
tree303e8eabb435a80ebec36a19c23ca85744d58fb5 /files/CMakeLists.txt
parent435db9f11b09187e0d60683813a28d07cc13166b (diff)
parent8e521e2ea589b4cafb788330f83037a0413f200a (diff)
downloadlibyuv-1f9deebc6ecf78b637dff50d62772b48332ea5ea.tar.gz
Merge "libyuv: Update to r1871 (2a6cb743)" am: 8e521e2ea5
Original change: https://android-review.googlesource.com/c/platform/external/libyuv/+/2622518 Change-Id: I677290d9641c9a7a343f79cf385e88af70ec589d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'files/CMakeLists.txt')
-rw-r--r--files/CMakeLists.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/files/CMakeLists.txt b/files/CMakeLists.txt
index d190507b..7a4a1994 100644
--- a/files/CMakeLists.txt
+++ b/files/CMakeLists.txt
@@ -4,7 +4,7 @@
PROJECT ( YUV C CXX ) # "C" is required even for C++ projects
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
-OPTION( TEST "Built unit tests" OFF )
+OPTION( UNIT_TEST "Built unit tests" OFF )
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
SET ( ly_src_dir ${ly_base_dir}/source )
@@ -41,18 +41,24 @@ endif()
ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc )
TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} )
+# this creates the yuvconstants tool
+ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c )
+TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} )
-INCLUDE ( FindJPEG )
+find_package ( JPEG )
if (JPEG_FOUND)
include_directories( ${JPEG_INCLUDE_DIR} )
- target_link_libraries( yuvconvert ${JPEG_LIBRARY} )
+ target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} )
add_definitions( -DHAVE_JPEG )
endif()
-if(TEST)
+if(UNIT_TEST)
find_library(GTEST_LIBRARY gtest)
if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND")
set(GTEST_SRC_DIR /usr/src/gtest CACHE STRING "Location of gtest sources")
+ if (CMAKE_CROSSCOMPILING)
+ set(GTEST_SRC_DIR third_party/googletest/src/googletest)
+ endif()
if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)
message(STATUS "building gtest from sources in ${GTEST_SRC_DIR}")
set(gtest_sources ${GTEST_SRC_DIR}/src/gtest-all.cc)
@@ -61,7 +67,7 @@ if(TEST)
include_directories(${GTEST_SRC_DIR}/include)
set(GTEST_LIBRARY gtest)
else()
- message(FATAL_ERROR "TEST is set but unable to find gtest library")
+ message(FATAL_ERROR "UNIT_TEST is set but unable to find gtest library")
endif()
endif()
@@ -78,6 +84,12 @@ if(TEST)
if(NACL AND NACL_LIBC STREQUAL "newlib")
target_link_libraries(libyuv_unittest glibc-compat)
endif()
+
+ 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()