aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2022-08-03 15:44:24 -0700
committerHarish Mahendrakar <harish.mahendrakar@ittiam.com>2022-08-04 20:40:33 -0700
commit28794b1bb5f75a6c500004dfbdcf5edf046a36fb (patch)
treef5fbaccf854c4ebcbc38b0efcfb973ce99d34e28
parent104da7c893d1d9eb5ccddbbcdba5943718f1602b (diff)
downloadlibhevc-28794b1bb5f75a6c500004dfbdcf5edf046a36fb.tar.gz
cmake: Move hevcdec specific macros to its cmake file
Also in encoder define PROFILE_ENABLE only when not defined This is need to fix multiple definitions error when building libhevc using cmake. Bug: 241484499 Test: Build with cmake Change-Id: I122b3db8f57604df3a8655ad1b75562fd71cd909
-rw-r--r--cmake/utils.cmake2
-rw-r--r--encoder/ihevce_profile.h2
-rw-r--r--test/decoder/hevcdec.cmake2
3 files changed, 4 insertions, 2 deletions
diff --git a/cmake/utils.cmake b/cmake/utils.cmake
index 57b939f..1476f19 100644
--- a/cmake/utils.cmake
+++ b/cmake/utils.cmake
@@ -32,8 +32,6 @@ endfunction()
# Adds defintions for all targets
function(libhevc_add_definitions)
- add_definitions(-DPROFILE_ENABLE -DMD5_DISABLE)
-
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
add_definitions(-DARMV8 -DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC)
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch32")
diff --git a/encoder/ihevce_profile.h b/encoder/ihevce_profile.h
index b9282a9..5b836d9 100644
--- a/encoder/ihevce_profile.h
+++ b/encoder/ihevce_profile.h
@@ -36,7 +36,9 @@
/*****************************************************************************/
/* Constant Macros */
/*****************************************************************************/
+#ifndef PROFILE_ENABLE
#define PROFILE_ENABLE 0
+#endif
typedef struct
{
diff --git a/test/decoder/hevcdec.cmake b/test/decoder/hevcdec.cmake
index 7eccf9d..bc38001 100644
--- a/test/decoder/hevcdec.cmake
+++ b/test/decoder/hevcdec.cmake
@@ -1,2 +1,4 @@
libhevc_add_executable(hevcdec libhevcdec SOURCES
${HEVC_ROOT}/test/decoder/main.c)
+target_compile_definitions(hevcdec
+ PRIVATE PROFILE_ENABLE MD5_DISABLE)