Skip to content

Commit

Permalink
Revert #1629 - revive DART_TREAT_WARNINGS_AS_ERRORS (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 authored Dec 22, 2021
1 parent bcf32fe commit 3ad6719
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 34 deletions.
1 change: 1 addition & 0 deletions .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ fi
cmake .. \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DDART_VERBOSE=ON \
-DDART_TREAT_WARNINGS_AS_ERRORS=ON \
-DDART_BUILD_EXTRAS=ON \
-DDART_CODECOV=$CODECOV \
${install_prefix_option}
Expand Down
9 changes: 5 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[Remove this line and describe this pull request. Link to relevant GitHub issues, if any.]
> Remove this line and describe this pull request. Link to relevant GitHub issues, if any.
***

**Before creating a pull request**
#### Before creating a pull request

- [ ] Document new methods and classes
- [ ] Format new code files using `clang-format`
- [ ] Format new code files using ClangFormat by running `make format`
- [ ] Build with `-DDART_TREAT_WARNINGS_AS_ERRORS=ON` and resolve build warnings

**Before merging a pull request**
#### Before merging a pull request

- [ ] Set version target by selecting a milestone on the right side
- [ ] Summarize this change in `CHANGELOG.md`
Expand Down
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
* Fixed grouping of constraints: [#1624](https://github.com/dartsim/dart/pull/1624), [#1628](https://github.com/dartsim/dart/pull/1628)
* Fixed issue with removing skeletons without shapes: [#1625](https://github.com/dartsim/dart/pull/1625)

* Build

* Removed DART_TREAT_WARNINGS_AS_ERRORS option and made it default on release build: [#1629](https://github.com/dartsim/dart/pull/1629)

### [DART 6.12.1 (2021-11-04)](https://github.com/dartsim/dart/milestone/71?closed=1)

* Build
Expand Down
27 changes: 12 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ option(DART_ENABLE_SIMD
option(DART_BUILD_GUI_OSG "Build osgDart library" ON)
option(DART_BUILD_EXTRAS "Build extra projects" OFF)
option(DART_CODECOV "Turn on codecov support" OFF)
option(DART_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
option(DART_FAST_DEBUG "Add -O1 option for DEBUG mode build" OFF)
# GCC and Clang add ANSI-formatted colors when they detect the output medium is a
# terminal. However, this doesn't work in some cases such as when the makefile is
Expand Down Expand Up @@ -182,9 +183,9 @@ if(MSVC)
)
endif()

add_compile_options(
$<$<NOT:$<CONFIG:DEBUG>>:/WX>
)
if(DART_TREAT_WARNINGS_AS_ERRORS)
add_compile_options(/WX)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /permissive- /Zc:twoPhase-")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO")
if(NOT DART_MSVC_DEFAULT_OPTIONS)
Expand All @@ -206,12 +207,10 @@ if(MSVC)

elseif(CMAKE_COMPILER_IS_GNUCXX)

add_compile_options(
-Wall
-Wextra
$<$<NOT:$<CONFIG:DEBUG>>:-Werror>
-fPIC
)
add_compile_options(-Wall -Wextra -fPIC)
if(DART_TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpfullversion -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_LESS 7.3.0)
Expand All @@ -233,12 +232,10 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)

elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

add_compile_options(
-Wall
-Wextra
$<$<NOT:$<CONFIG:DEBUG>>:-Werror>
-fPIC
)
add_compile_options(-Wall -Wextra -fPIC)
if(DART_TREAT_WARNINGS_AS_ERRORS)
add_compile_options(-Werror)
endif()
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
if(CLANG_VERSION VERSION_LESS 6.0)
Expand Down
20 changes: 13 additions & 7 deletions tutorials/tutorial_collisions/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,17 @@
[[maybe_unused]] const double maximum_start_v = 4.0; // m/s
[[maybe_unused]] const double default_start_v = 3.5; // m/s

[[maybe_unused]] const double minimum_launch_angle = dart::math::toRadian(30.0); // rad
[[maybe_unused]] const double maximum_launch_angle = dart::math::toRadian(70.0); // rad
[[maybe_unused]] const double default_launch_angle = dart::math::toRadian(45.0); // rad

[[maybe_unused]] const double maximum_start_w = 6 * dart::math::constantsd::pi(); // rad/s
[[maybe_unused]] const double default_start_w = 3 * dart::math::constantsd::pi(); // rad/s
[[maybe_unused]] const double minimum_launch_angle
= dart::math::toRadian(30.0); // rad
[[maybe_unused]] const double maximum_launch_angle
= dart::math::toRadian(70.0); // rad
[[maybe_unused]] const double default_launch_angle
= dart::math::toRadian(45.0); // rad

[[maybe_unused]] const double maximum_start_w
= 6 * dart::math::constantsd::pi(); // rad/s
[[maybe_unused]] const double default_start_w
= 3 * dart::math::constantsd::pi(); // rad/s

[[maybe_unused]] const double ring_spring_stiffness = 0.5;
[[maybe_unused]] const double ring_damping_coefficient = 0.05;
Expand All @@ -60,7 +65,8 @@
const double default_ground_width = 2;
const double default_wall_thickness = 0.1;
const double default_wall_height = 1;
[[maybe_unused]] const double default_spawn_range = 0.9 * default_ground_width / 2;
[[maybe_unused]] const double default_spawn_range
= 0.9 * default_ground_width / 2;

[[maybe_unused]] const double default_restitution = 0.6;

Expand Down
6 changes: 3 additions & 3 deletions tutorials/tutorial_dominoes/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ const double default_domino_mass
= default_domino_density * default_domino_height * default_domino_width
* default_domino_depth;

[[maybe_unused]] const double default_push_force = 8.0; // N
const int default_force_duration = 200; // # iterations
const int default_push_duration = 1000; // # iterations
[[maybe_unused]] const double default_push_force = 8.0; // N
const int default_force_duration = 200; // # iterations
const int default_push_duration = 1000; // # iterations

[[maybe_unused]] const double defaultmEndEffectormOffset = 0.05;

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial_multi_pendulum/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const double default_depth = 0.2; // m

[[maybe_unused]] const double default_torque = 15.0; // N-m
[[maybe_unused]] const double default_force = 15.0; // N
const int default_countdown = 200; // Number of timesteps for applying force
const int default_countdown = 200; // Number of timesteps for applying force

const double default_rest_position = 0.0;
const double delta_rest_position = dart::math::toRadian(10.0);
Expand Down

0 comments on commit 3ad6719

Please sign in to comment.