aom_configure.cmake 5.1 KB
Newer Older
Tom Finegan's avatar
Tom Finegan committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
##
## Copyright (c) 2016, Alliance for Open Media. All rights reserved
##
## This source code is subject to the terms of the BSD 2 Clause License and
## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
## was not distributed with this source code in the LICENSE file, you can
## obtain it at www.aomedia.org/license/software. If the Alliance for Open
## Media Patent License 1.0 was not distributed with this source code in the
## PATENTS file, you can obtain it at www.aomedia.org/license/patent.
##
cmake_minimum_required(VERSION 3.2)

include("${AOM_ROOT}/build/cmake/compiler_flags.cmake")

include(FindGit)

# Defaults for every libaom configuration variable.
set(RESTRICT)
set(INLINE)
set(ARCH_ARM 0)
set(ARCH_MIPS 0)
set(ARCH_X86 0)
set(ARCH_X86_64 0)
set(HAVE_EDSP 0)
set(HAVE_MEDIA 0)
set(HAVE_NEON 0)
set(HAVE_NEON_ASM 0)
set(HAVE_MIPS32 0)
set(HAVE_DSPR2 0)
set(HAVE_MSA 0)
set(HAVE_MIPS64 0)
set(HAVE_MMX 0)
set(HAVE_SSE 0)
set(HAVE_SSE2 0)
set(HAVE_SSE3 0)
set(HAVE_SSSE3 0)
set(HAVE_SSE4_1 0)
set(HAVE_AVX 0)
set(HAVE_AVX2 0)
set(HAVE_AOM_PORTS 0)
set(HAVE_PTHREAD_H 0)
set(HAVE_UNISTD_H 0)
set(CONFIG_DEPENDENCY_TRACKING 1)
set(CONFIG_EXTERNAL_BUILD 0)
set(CONFIG_INSTALL_DOCS 0)
set(CONFIG_INSTALL_BINS 0)
set(CONFIG_INSTALL_LIBS 0)
set(CONFIG_INSTALL_SRCS 0)
set(CONFIG_USE_X86INC 0)
set(CONFIG_DEBUG 0)
set(CONFIG_GPROF 0)
set(CONFIG_GCOV 0)
set(CONFIG_RVCT 0)
set(CONFIG_GCC 0)
set(CONFIG_MSVS 0)
set(CONFIG_PIC 0)
set(CONFIG_BIG_ENDIAN 0)
set(CONFIG_CODEC_SRCS 0)
set(CONFIG_DEBUG_LIBS 0)
set(CONFIG_DEQUANT_TOKENS 0)
set(CONFIG_DC_RECON 0)
set(CONFIG_RUNTIME_CPU_DETECT 0)
set(CONFIG_MULTITHREAD 0)
set(CONFIG_INTERNAL_STATS 0)
set(CONFIG_AV1_ENCODER 1)
set(CONFIG_AV1_DECODER 1)
set(CONFIG_AV1 1)
set(CONFIG_ENCODERS 1)
set(CONFIG_DECODERS 1)
set(CONFIG_STATIC_MSVCRT 0)
set(CONFIG_SPATIAL_RESAMPLING 1)
set(CONFIG_REALTIME_ONLY 0)
set(CONFIG_ONTHEFLY_BITPACKING 0)
set(CONFIG_ERROR_CONCEALMENT 0)
set(CONFIG_SHARED 0)
set(CONFIG_STATIC 1)
set(CONFIG_SMALL 0)
set(CONFIG_OS_SUPPORT 0)
set(CONFIG_UNIT_TESTS 0)
set(CONFIG_WEBM_IO 0)
set(CONFIG_LIBYUV 0)
set(CONFIG_ACCOUNTING 0)
set(CONFIG_DECODE_PERF_TESTS 0)
set(CONFIG_ENCODE_PERF_TESTS 0)
set(CONFIG_MULTI_RES_ENCODING 0)
set(CONFIG_TEMPORAL_DENOISING 1)
set(CONFIG_COEFFICIENT_RANGE_CHECKING 0)
set(CONFIG_AOM_HIGHBITDEPTH 0)
set(CONFIG_EXPERIMENTAL 0)
set(CONFIG_SIZE_LIMIT 0)
set(CONFIG_AOM_QM 0)
set(CONFIG_SPATIAL_SVC 0)
set(CONFIG_FP_MB_STATS 0)
set(CONFIG_EMULATE_HARDWARE 0)
set(CONFIG_CLPF 0)
set(CONFIG_DERING 0)
set(CONFIG_REF_MV 0)
set(CONFIG_SUB8X8_MC 0)
set(CONFIG_EXT_INTRA 0)
set(CONFIG_EXT_INTERP 0)
set(CONFIG_EXT_TX 0)
set(CONFIG_MOTION_VAR 0)
set(CONFIG_EXT_REFS 0)
set(CONFIG_EXT_COMPOUND 0)
set(CONFIG_SUPERTX 0)
set(CONFIG_ANS 0)
set(CONFIG_EC_MULTISYMBOL 0)
set(CONFIG_DAALA_EC 0)
set(CONFIG_PARALLEL_DEBLOCKING 0)
set(CONFIG_CB4X4 0)
set(CONFIG_PALETTE 0)
set(CONFIG_FRAME_SIZE 0)
set(CONFIG_FILTER_7BIT 0)
set(CONFIG_DELTA_Q 0)
set(CONFIG_ADAPT_SCAN 0)
set(CONFIG_BITSTREAM_DEBUG 0)
set(CONFIG_TILE_GROUPS 0)
set(CONFIG_EC_ADAPT 0)

120
121
122
# TODO(tomfinegan): consume trailing whitespace after configure_file() when
# target platform check produces empty INLINE and RESTRICT values (aka empty
# values require special casing).
Tom Finegan's avatar
Tom Finegan committed
123
124
125
126
127
configure_file("${AOM_ROOT}/build/cmake/aom_config.h.cmake"
               "${CMAKE_CURRENT_BINARY_DIR}/aom_config.h")

# Read the current git hash.
find_package(Git)
128
129
set(AOM_GIT_DESCRIPTION)
set(AOM_GIT_HASH)
Tom Finegan's avatar
Tom Finegan committed
130
if (GIT_FOUND)
131
132
  # TODO(tomfinegan): Add build rule so users don't have to re-run cmake to
  # create accurately versioned cmake builds.
Tom Finegan's avatar
Tom Finegan committed
133
134
135
  execute_process(COMMAND ${GIT_EXECUTABLE}
                  --git-dir=${AOM_ROOT}/.git rev-parse HEAD
                  OUTPUT_VARIABLE AOM_GIT_HASH)
136
137
  execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${AOM_ROOT}/.git describe
                  OUTPUT_VARIABLE AOM_GIT_DESCRIPTION ERROR_QUIET)
Tom Finegan's avatar
Tom Finegan committed
138
  # Consume the newline at the end of the git output.
139
140
141
  string(STRIP "${AOM_GIT_HASH}" AOM_GIT_HASH)
  string(STRIP "${AOM_GIT_DESCRIPTION}" AOM_GIT_DESCRIPTION)
endif ()
Tom Finegan's avatar
Tom Finegan committed
142
143
144
145
146
147
148
149
150
151
152
153

# TODO(tomfinegan): An alternative to dumping the configure command line to
# aom_config.c is needed in cmake. Normal cmake generation runs do not make the
# command line available in the cmake script. For now, we just set the variable
# to the following. The configure_file() command will expand the message in
# aom_config.c.
# Note: This message isn't strictly true. When cmake is run in script mode (with
# the -P argument), CMAKE_ARGC and CMAKE_ARGVn are defined (n = 0 through
# n = CMAKE_ARGC become valid). Normal cmake generation runs do not make the
# information available.
set(AOM_CMAKE_CONFIG "cmake")
configure_file("${AOM_ROOT}/build/cmake/aom_config.c.cmake"
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
               "${AOM_CONFIG_DIR}/aom_config.c")

# Find Perl.
find_package(Perl)
if (NOT PERL_FOUND)
  message(FATAL_ERROR "Perl is required to build libaom.")
endif ()

# Generate aom_version.h.
if ("${AOM_GIT_DESCRIPTION}" STREQUAL "")
  set(AOM_GIT_DESCRIPTION "${AOM_ROOT}/CHANGELOG")
endif ()
execute_process(
  COMMAND ${PERL_EXECUTABLE} "${AOM_ROOT}/build/cmake/aom_version.pl"
  --version_data=${AOM_GIT_DESCRIPTION}
  --version_filename=${AOM_CONFIG_DIR}/aom_version.h)