mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Update minimum required C++ version for Ceres to C++14
- Removes all workarounds for pre-C++14 versions - Removes '11' qualifier from C++ threading option and associated defines. - Fix missing inclusion of 'Multithreading' in reported Ceres components when C++ threading model is enabled. - Update Sphinx documentation to specify C++14 as minimum requirement. Change-Id: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438
This commit is contained in:
@@ -84,6 +84,8 @@ function(ceres_compile_options_to_components CURRENT_CERES_COMPILE_OPTIONS CERES
|
||||
CERES_RESTRICT_SCHUR_SPECIALIZATION "SchurSpecializations")
|
||||
add_to_output_if_found(CURRENT_CERES_COMPILE_OPTIONS ${CERES_COMPONENTS_VAR}
|
||||
CERES_USE_OPENMP "OpenMP;Multithreading")
|
||||
add_to_output_if_found(CURRENT_CERES_COMPILE_OPTIONS ${CERES_COMPONENTS_VAR}
|
||||
CERES_USE_CXX_THREADS "Multithreading")
|
||||
# Remove duplicates of SparseLinearAlgebraLibrary if multiple sparse backends
|
||||
# are present.
|
||||
list(REMOVE_DUPLICATES ${CERES_COMPONENTS_VAR})
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
# Author: alexs.mac@gmail.com (Alex Stewart)
|
||||
|
||||
# Ordered by expected preference.
|
||||
set(CERES_THREADING_MODELS "CXX11_THREADS;OPENMP;NO_THREADS")
|
||||
set(CERES_THREADING_MODELS "CXX_THREADS;OPENMP;NO_THREADS")
|
||||
|
||||
function(find_available_ceres_threading_models CERES_THREADING_MODELS_AVAILABLE_VAR)
|
||||
set(CERES_THREADING_MODELS_AVAILABLE ${CERES_THREADING_MODELS})
|
||||
@@ -48,7 +48,7 @@ function(find_available_ceres_threading_models CERES_THREADING_MODELS_AVAILABLE_
|
||||
endfunction()
|
||||
|
||||
macro(set_ceres_threading_model_to_cxx11_threads)
|
||||
list(APPEND CERES_COMPILE_OPTIONS CERES_USE_CXX11_THREADS)
|
||||
list(APPEND CERES_COMPILE_OPTIONS CERES_USE_CXX_THREADS)
|
||||
endmacro()
|
||||
|
||||
macro(set_ceres_threading_model_to_openmp)
|
||||
@@ -63,7 +63,7 @@ macro(set_ceres_threading_model_to_no_threads)
|
||||
endmacro()
|
||||
|
||||
macro(set_ceres_threading_model CERES_THREADING_MODEL_TO_SET)
|
||||
if ("${CERES_THREADING_MODEL_TO_SET}" STREQUAL "CXX11_THREADS")
|
||||
if ("${CERES_THREADING_MODEL_TO_SET}" STREQUAL "CXX_THREADS")
|
||||
set_ceres_threading_model_to_cxx11_threads()
|
||||
elseif ("${CERES_THREADING_MODEL_TO_SET}" STREQUAL "OPENMP")
|
||||
set_ceres_threading_model_to_openmp()
|
||||
|
||||
+3
-3
@@ -73,10 +73,10 @@
|
||||
|
||||
// If defined, Ceres was compiled without multithreading support.
|
||||
@CERES_NO_THREADS@
|
||||
// If defined Ceres was compiled with OpenMP multithreading support.
|
||||
// If defined Ceres was compiled with OpenMP multithreading.
|
||||
@CERES_USE_OPENMP@
|
||||
// If defined Ceres was compiled with C++11 thread support.
|
||||
@CERES_USE_CXX11_THREADS@
|
||||
// If defined Ceres was compiled with modern C++ multithreading.
|
||||
@CERES_USE_CXX_THREADS@
|
||||
|
||||
// If defined, Ceres was built as a shared library.
|
||||
@CERES_USING_SHARED_LIBRARY@
|
||||
|
||||
Reference in New Issue
Block a user