aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorqinxialei <xialeiqin@gmail.com>2021-04-22 11:20:15 +0800
committerqinxialei <xialeiqin@gmail.com>2021-04-22 11:20:15 +0800
commit2381d803c76105f44717d75f089ec37f51e5cfe4 (patch)
tree33f40fb4dfd1039ac262d5f1c1065d298578ddc1 /CMakeLists.txt
parente8d277081293b6fb2a5d469616baaa7a06f52496 (diff)
downloadlibgav1-2381d803c76105f44717d75f089ec37f51e5cfe4.tar.gz
libgav1-2381d803c76105f44717d75f089ec37f51e5cfe4.tar.bz2
libgav1-2381d803c76105f44717d75f089ec37f51e5cfe4.zip
New upstream version 0.16.3
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt55
1 files changed, 36 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d00ae6..5e9e17a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,31 +36,17 @@ endif()
set(libgav1_examples "${libgav1_root}/examples")
set(libgav1_source "${libgav1_root}/src")
-include(FindThreads)
-
-include("${libgav1_examples}/libgav1_examples.cmake")
-include("${libgav1_root}/cmake/libgav1_build_definitions.cmake")
-include("${libgav1_root}/cmake/libgav1_cpu_detection.cmake")
-include("${libgav1_root}/cmake/libgav1_flags.cmake")
-include("${libgav1_root}/cmake/libgav1_helpers.cmake")
-include("${libgav1_root}/cmake/libgav1_install.cmake")
-include("${libgav1_root}/cmake/libgav1_intrinsics.cmake")
include("${libgav1_root}/cmake/libgav1_options.cmake")
-include("${libgav1_root}/cmake/libgav1_sanitizer.cmake")
-include("${libgav1_root}/cmake/libgav1_targets.cmake")
-include("${libgav1_root}/cmake/libgav1_variables.cmake")
-include("${libgav1_source}/dsp/libgav1_dsp.cmake")
-include("${libgav1_source}/libgav1_decoder.cmake")
-include("${libgav1_source}/utils/libgav1_utils.cmake")
libgav1_option(NAME LIBGAV1_ENABLE_OPTIMIZATIONS HELPSTRING
"Enables optimized code." VALUE ON)
-libgav1_option(NAME LIBGAV1_ENABLE_AVX2 HELPSTRING
- "Enables avx2 optimizations." VALUE ON)
+libgav1_option(NAME LIBGAV1_ENABLE_AVX2 HELPSTRING "Enables avx2 optimizations."
+ VALUE ON)
libgav1_option(NAME LIBGAV1_ENABLE_NEON HELPSTRING "Enables neon optimizations."
VALUE ON)
libgav1_option(NAME LIBGAV1_ENABLE_SSE4_1 HELPSTRING
"Enables sse4.1 optimizations." VALUE ON)
+libgav1_option(NAME LIBGAV1_ENABLE_TESTS HELPSTRING "Enables tests." VALUE ON)
libgav1_option(
NAME LIBGAV1_VERBOSE HELPSTRING
"Enables verbose build system output. Higher numbers are more verbose." VALUE
@@ -70,6 +56,23 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
+include(FindThreads)
+
+include("${libgav1_examples}/libgav1_examples.cmake")
+include("${libgav1_root}/cmake/libgav1_build_definitions.cmake")
+include("${libgav1_root}/cmake/libgav1_cpu_detection.cmake")
+include("${libgav1_root}/cmake/libgav1_flags.cmake")
+include("${libgav1_root}/cmake/libgav1_helpers.cmake")
+include("${libgav1_root}/cmake/libgav1_install.cmake")
+include("${libgav1_root}/cmake/libgav1_intrinsics.cmake")
+include("${libgav1_root}/cmake/libgav1_sanitizer.cmake")
+include("${libgav1_root}/cmake/libgav1_targets.cmake")
+include("${libgav1_root}/cmake/libgav1_variables.cmake")
+include("${libgav1_root}/tests/libgav1_tests.cmake")
+include("${libgav1_source}/dsp/libgav1_dsp.cmake")
+include("${libgav1_source}/libgav1_decoder.cmake")
+include("${libgav1_source}/utils/libgav1_utils.cmake")
+
libgav1_optimization_detect()
libgav1_set_build_definitions()
libgav1_set_cxx_flags()
@@ -109,13 +112,27 @@ if(NOT "${LIBGAV1_EXE_LINKER_FLAGS}" STREQUAL "")
separate_arguments(LIBGAV1_EXE_LINKER_FLAGS)
endif()
-add_subdirectory("${libgav1_root}/third_party/abseil-cpp"
- "${libgav1_abseil_build}" EXCLUDE_FROM_ALL)
+# Set test-only flags based on LIBGAV1_CXX_FLAGS.
+libgav1_set_test_flags()
+
+set(libgav1_abseil "${libgav1_root}/third_party/abseil-cpp")
+if(NOT EXISTS "${libgav1_abseil}")
+ message(
+ FATAL_ERROR
+ "Abseil not found. This dependency is required by the"
+ " examples & tests and libgav1 when LIBGAV1_THREADPOOL_USE_STD_MUTEX is"
+ " not defined. To continue, download the Abseil repository to"
+ " third_party/abseil-cpp:\n git \\\n -C ${libgav1_root} \\\n"
+ " clone \\\n"
+ " https://github.com/abseil/abseil-cpp.git third_party/abseil-cpp")
+endif()
+add_subdirectory("${libgav1_abseil}" "${libgav1_abseil_build}" EXCLUDE_FROM_ALL)
libgav1_reset_target_lists()
libgav1_add_dsp_targets()
libgav1_add_decoder_targets()
libgav1_add_examples_targets()
+libgav1_add_tests_targets()
libgav1_add_utils_targets()
libgav1_setup_install_target()