Skip to content

Commit fbd930d

Browse files
committed
Merge branch 'master' of https://github.com/sofa-framework/sofa
2 parents b6f8b01 + f3642d9 commit fbd930d

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ class StopperLagrangianConstraint : public core::behavior::LagrangianConstraint<
109109

110110

111111
public:
112-
void init() override;
113112
void buildConstraintMatrix(const core::ConstraintParams* cParams, DataMatrixDeriv &c_d, unsigned int &cIndex, const DataVecCoord &x) override;
114113
void getConstraintViolation(const core::ConstraintParams* cParams, linearalgebra::BaseVector *resV, const DataVecCoord &x, const DataVecDeriv &v) override;
115114

Sofa/Component/Constraint/Lagrangian/Model/src/sofa/component/constraint/lagrangian/model/StopperLagrangianConstraint.inl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,6 @@ StopperLagrangianConstraint<DataTypes>::StopperLagrangianConstraint(MechanicalSt
3737
{
3838
}
3939

40-
template<class DataTypes>
41-
void StopperLagrangianConstraint<DataTypes>::init()
42-
{
43-
this->mstate = dynamic_cast<MechanicalState*>(this->getContext()->getMechanicalState());
44-
45-
helper::WriteAccessor<Data<VecCoord> > xData = *this->mstate->write(core::vec_id::write_access::position);
46-
VecCoord& x = xData.wref();
47-
if (x[d_index.getValue()].x() < d_min.getValue())
48-
x[d_index.getValue()].x() = (Real) d_min.getValue();
49-
if (x[d_index.getValue()].x() > d_max.getValue())
50-
x[d_index.getValue()].x() = (Real) d_max.getValue();
51-
}
52-
5340
template<class DataTypes>
5441
void StopperLagrangianConstraint<DataTypes>::buildConstraintMatrix(const core::ConstraintParams* /*cParams*/, DataMatrixDeriv &c_d, unsigned int &cIndex, const DataVecCoord &/*x*/)
5542
{

Sofa/framework/Config/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ target_link_options(${PROJECT_NAME} PUBLIC "$<${is_c_cxx_release}:${SOFACONFIG_L
311311
target_link_options(${PROJECT_NAME} PUBLIC "$<${is_c_cxx_debug}:${SOFACONFIG_LINK_OPTIONS_DEBUG}>")
312312
target_link_options(${PROJECT_NAME} PUBLIC "$<${is_c_cxx}:${SOFACONFIG_LINK_OPTIONS}>")
313313

314+
sofa_treat_warnings_as_errors(${PROJECT_NAME})
315+
314316
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Sofa.Framework) # IDE folder
315317

316318
# Attach Sofa Version into properties

Sofa/framework/Config/cmake/SofaMacrosConfigure.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,13 @@ macro(sofa_set_targets_release_only)
515515
endmacro()
516516

517517

518+
function(sofa_treat_warnings_as_errors TARGET)
519+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
520+
set_property(TARGET ${TARGET} PROPERTY COMPILE_WARNING_AS_ERROR ON)
521+
else()
522+
target_compile_options(${TARGET} PRIVATE
523+
$<$<CXX_COMPILER_ID:MSVC>:/WX>
524+
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Werror>
525+
)
526+
endif()
527+
endfunction()

0 commit comments

Comments
 (0)