Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade required language level to C++17 #4000

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ v4.6
sphere torques) to be consistent with the center of pressure GRF representation.
- Fixed an issue where a copy of an `OpenSim::Model` containing a `OpenSim::ExternalLoads` could not be
finalized (#3926)
- Updated all code examples to use c++14 (#3929)
- Updated all code examples to use C++17 (after a few months of compiling as C++14 : #3929).
- Added class `OpenSim::StateDocument` as a systematic means of serializing and deserializing a complete trajectory
(i.e., time history) of all states in the `SimTK::State` to and from a single `.ostates` file. Prior to `StatesDocument`,
only the trajectories of continuous states (e.g., joint angles, joint speeds, muscle forces, and the like) could be systematically
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ if (NOT OPENSIM_PYTHON_CONDA)
include(InstallRequiredSystemLibraries)
endif()

# C++14
# C++17
# -----
set(CMAKE_CXX_STANDARD 14)
# Using c++14 is not optional.
set(CMAKE_CXX_STANDARD 17)
# Using C++17 is not optional.
set(CMAKE_CXX_STANDARD_REQUIRED ON)


Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/BuildDynamicWalker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
cmake_minimum_required(VERSION 3.2)
project(BuildDynamicWalker)

# OpenSim requires a compiler that supports c++14.
set(CMAKE_CXX_STANDARD 14)
# OpenSim requires a compiler that supports C++17.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find the OpenSim libraries and header files.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/ControllerExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET exampleController CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/CustomActuatorExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET exampleCustomActuator CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Examples/ExampleCMakeListsToInstall.txt.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.2)
project(OpenSim_@_example_name@)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

find_package(OpenSim REQUIRED HINTS
"${CMAKE_SOURCE_DIR}/@_opensim_install_hint@")
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/ExampleLuxoMuscle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET exampleLuxoMuscle CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/ExampleMain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET exampleMain CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/MuscleExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET exampleMuscle CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/OptimizationExample_Arm26/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET optimizationExample CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Examples/PluginExampleCMakeListsToInstall.txt.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.2)
project(OpenSim_@_example_name@)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)

find_package(OpenSim REQUIRED HINTS
"${CMAKE_SOURCE_DIR}/@_opensim_install_hint@")
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/Plugins/AnalysisPluginExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ file(GLOB INCLUDE_FILES *.h)

set(PLUGIN_NAME "osimPlugin" CACHE STRING "Name of shared library to create")

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenSim REQUIRED PATHS "${OPENSIM_INSTALL_DIR}")
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/Plugins/BodyDragExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ file(GLOB INCLUDE_FILES *.h)

set(PLUGIN_NAME "BodyDragForce" CACHE STRING "Name of shared library to create")

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenSim REQUIRED PATHS "${OPENSIM_INSTALL_DIR}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ file(GLOB INCLUDE_FILES *.h)
set(PLUGIN_NAME "osimCoupledBushingForcePlugin"
CACHE STRING "Name of shared library to create")

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(OpenSim REQUIRED PATHS "${OPENSIM_INSTALL_DIR}")
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/SimpleOptimizationExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET simpleOptimizationExample CACHE TYPE STRING)

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/SymbolicExpressionReporter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ set(PLUGIN_NAME "osimExpressionReporter")

# Settings.
# ---------
# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses C++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Examples/checkEnvironment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.2)
# ---------
set(TARGET checkEnvironment CACHE STRING "Name of example to build")

# OpenSim uses c++14 language features.
set(CMAKE_CXX_STANDARD 14)
# OpenSim uses c++17 language features.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find and hook up to OpenSim.
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Sandbox/xsens/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if(NOT WIN32)
return()
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)

set(XSENS_SDK_DIR "" CACHE PATH "Directory containing XSENS SDK.")

Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Tools/ForwardTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ OpenSim_DECLARE_CONCRETE_OBJECT(ForwardTool, AbstractTool);
//--------------------------------------------------------------------------
bool run() override SWIG_DECLARE_EXCEPTION;
/// <b>(Deprecated)</b> Use setPrintResultFiles(true) and run() instead.
DEPRECATED_14("Use setPrintResultFiles(true) and run() instead.")
[[deprecated("Use setPrintResultFiles(true) and run() instead.")]]
void printResults();
private:
void printResultsInternal();
Expand Down
4 changes: 2 additions & 2 deletions Vendors/tropter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Compiler flags.
# ---------------
set(CMAKE_CXX_STANDARD 14)
# Using c++14 is not optional.
set(CMAKE_CXX_STANDARD 17)
# Using C++17 is not optional.
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Copy dependencies' libraries into tropter's installation?
Expand Down
2 changes: 1 addition & 1 deletion cmake/SampleCMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ project(myexe)
set(my_source_files myexe.cpp)
set(my_header_files myexe.h)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# This depends on OpenSimConfig.cmake being located somewhere predictable
Expand Down
Loading