From ffb9da14fb0d0653588324a4df925487b5ad37d0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 11 Jan 2013 11:23:48 +0400 Subject: [PATCH] TBB build defines for Linux added. --- 3rdparty/tbb/CMakeLists.txt | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt index f525168348..6c633e9b9c 100644 --- a/3rdparty/tbb/CMakeLists.txt +++ b/3rdparty/tbb/CMakeLists.txt @@ -115,16 +115,29 @@ file(GLOB lib_srcs "${tbb_src_dir}/src/tbb/*.cpp") file(GLOB lib_hdrs "${tbb_src_dir}/src/tbb/*.h") list(APPEND lib_srcs "${tbb_src_dir}/src/rml/client/rml_tbb.cpp") -add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required - -D__TBB_BUILD=1 #required - -D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk on Android ? - -DUSE_PTHREAD #required - -DTBB_USE_GCC_BUILTINS=1 #required - -DTBB_USE_DEBUG=0 #just to be sure - -DTBB_NO_LEGACY=1 #don't need backward compatibility - -DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications +if (ANDROID) + add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required + -D__TBB_BUILD=1 #required + -D__TBB_SURVIVE_THREAD_SWITCH=0 #no cilk on Android? + -DUSE_PTHREAD #required + -DTBB_USE_GCC_BUILTINS=1 #required + -DTBB_USE_DEBUG=0 #just to be sure + -DTBB_NO_LEGACY=1 #don't need backward compatibility + -DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications on Android + ) +else() + add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=1 #required + -D__TBB_BUILD=1 #required + -D__TBB_SURVIVE_THREAD_SWITCH=1 #cilk + -DUSE_PTHREAD #required + -DTBB_USE_GCC_BUILTINS=1 #required + -DTBB_USE_DEBUG=0 #just to be sure + -DTBB_NO_LEGACY=1 #don't need backward compatibility + -DDO_ITT_NOTIFY=0 #Required ) +endif() + if(ANDROID_COMPILER_IS_CLANG) add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-prototypes)