Added c++17 flags to build functions
parent
a4367e1578
commit
0cb0733e33
|
@ -6,8 +6,6 @@ if(NOT DEFINED CMAKE_MACOSX_RPATH)
|
|||
set(CMAKE_MACOSX_RPATH 0)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# Set the version number for the library
|
||||
set (GTSAM_VERSION_MAJOR 4)
|
||||
set (GTSAM_VERSION_MINOR 3)
|
||||
|
|
|
@ -138,16 +138,22 @@ else()
|
|||
set(GTSAM_COMPILE_OPTIONS_PRIVATE_TIMING -g -O3 CACHE STRING "(User editable) Private compiler flags for Timing configuration.")
|
||||
endif()
|
||||
|
||||
# Enable C++11:
|
||||
# Enable C++17:
|
||||
if (NOT CMAKE_VERSION VERSION_LESS 3.8)
|
||||
set(GTSAM_COMPILE_FEATURES_PUBLIC "cxx_std_11" CACHE STRING "CMake compile features property for all gtsam targets.")
|
||||
set(GTSAM_COMPILE_FEATURES_PUBLIC "cxx_std_17" CACHE STRING "CMake compile features property for all gtsam targets.")
|
||||
# See: https://cmake.org/cmake/help/latest/prop_tgt/CXX_EXTENSIONS.html
|
||||
# This is to enable -std=c++11 instead of -std=g++11
|
||||
# TODO(dellaert): is following line still needed or was that only for c++11?
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
if (MSVC)
|
||||
# NOTE(jlblanco): seems to be required in addition to the cxx_std_17 above?
|
||||
# TODO(dellaert): is this the right syntax below?
|
||||
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC /std:c++latest)
|
||||
endif()
|
||||
else()
|
||||
# Old cmake versions:
|
||||
if (NOT MSVC)
|
||||
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)
|
||||
# TODO(dellaert): I just changed 11 to 17 below, hopefully that works
|
||||
list_append_cache(GTSAM_COMPILE_OPTIONS_PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue