Fix 'xxx.cc has no symbols' warnings. - As OPENMP, TBB & CXX11_THREADS are mutually exclusive, and their implementations are wholly contained within enclosing #ifdefs if the requisite option is not enabled then the source file is 'empty'. - This triggers 'xxx.cc has no symbol' warnings when compiling Ceres statically, as such we now only include these files if they are not going to be empty. Change-Id: I5390251b44c5770bbdd4ccb1bc916dbe3b1814a9
diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt index eb18eb0..a22b734 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt
@@ -28,7 +28,18 @@ # # Author: keir@google.com (Keir Mierle) +# Avoid 'xxx.cc has no symbols' warnings from source files which are 'empty' +# when their enclosing #ifdefs are disabled. +if (CXX11_THREADS) + set(CERES_PARALLEL_FOR_SRC parallel_for_cxx.cc thread_pool.cc) +elseif (OPENMP) + set(CERES_PARALLEL_FOR_SRC parallel_for_openmp.cc) +elseif (TBB) + set(CERES_PARALLEL_FOR_SRC parallel_for_tbb.cc) +endif() + set(CERES_INTERNAL_SRC + ${CERES_PARALLEL_FOR_SRC} array_utils.cc blas.cc block_evaluate_preparer.cc @@ -93,9 +104,6 @@ low_rank_inverse_hessian.cc minimizer.cc normal_prior.cc - parallel_for_openmp.cc - parallel_for_cxx.cc - parallel_for_tbb.cc parallel_utils.cc parameter_block_ordering.cc partitioned_matrix_view.cc @@ -123,7 +131,6 @@ split.cc stringprintf.cc suitesparse.cc - thread_pool.cc thread_token_provider.cc triplet_sparse_matrix.cc trust_region_preprocessor.cc