Skip to content

Commit

Permalink
Add retrocompatibility with gcc < 5.5.
Browse files Browse the repository at this point in the history
Fix #3
  • Loading branch information
Vincent Samy committed Oct 11, 2019
1 parent b40509c commit e3b89a5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(PROJECT_DEBUG_POSTFIX "_d")
set(INSTALL_GENERATED_HEADERS OFF CACHE BOOL "Generate and install standard headers")

set(DOXYGEN_USE_MATHJAX "YES")
set(CMAKE_CXX_STANDARD 11)

option(BUILD_TESTING "Disable unit tests." ON)
option(BUILD_EXAMPLES "Build examples." OFF)
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ set(HEADERS

add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-Dwcl_EXPORTS")
target_compile_definitions(${PROJECT_NAME} PUBLIC _USE_MATH_DEFINES)
if (MSVC)
target_compile_definitions(${PROJECT_NAME} PUBLIC _USE_MATH_DEFINES)
endif()
if(${PLUCKER_NOTATION})
target_compile_definitions(${PROJECT_NAME} PUBLIC PLUCKER_NOTATION)
endif()
Expand Down
16 changes: 10 additions & 6 deletions src/ContactSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ namespace wcl {
wcl::ContactSurface rectangularSurface(double xHalfLength, double yHalfLength, const Eigen::Vector3d& position,
const Eigen::Matrix3d& rotation, double mu, unsigned int nrGenerators)
{
std::vector<Eigen::Vector3d> p;
p.emplace_back(xHalfLength, yHalfLength, 0);
p.emplace_back(xHalfLength, -yHalfLength, 0);
p.emplace_back(-xHalfLength, -yHalfLength, 0);
p.emplace_back(-xHalfLength, yHalfLength, 0);
return wcl::ContactSurface({position, rotation, p, mu, nrGenerators});
wcl::ContactSurface cs;
cs.points.emplace_back(xHalfLength, yHalfLength, 0);
cs.points.emplace_back(xHalfLength, -yHalfLength, 0);
cs.points.emplace_back(-xHalfLength, -yHalfLength, 0);
cs.points.emplace_back(-xHalfLength, yHalfLength, 0);
cs.position = position;
cs.rotation = rotation;
cs.mu = mu;
cs.nrGenerators = nrGenerators;
return cs;
}

} // namespace wcl
4 changes: 1 addition & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ if(${BUILD_TEST_STATIC_BOOST})
set(Boost_USE_STATIC_LIBS ON)
set(BUILD_SHARED_LIBS OFF)
set(BOOST_DEFS "")
set(BUILD_TYPE STATIC)
else()
set(Boost_USE_STATIC_LIBS OFF)
set(BUILD_SHARED_LIBS ON)
set(BOOST_DEFS Boost::dynamic_linking)
set(BUILD_TYPE SHARED)
endif()
find_package(Boost REQUIRED COMPONENTS unit_test_framework)

add_executable(wclTest TestWrenchConeLib.cpp)
target_link_libraries(wclTest PRIVATE ${PROJECT_NAME} Boost::unit_test_framework)
target_link_libraries(wclTest PRIVATE Boost::unit_test_framework Boost::disable_autolinking ${BOOST_DEFS} ${PROJECT_NAME})
add_test(wclTestUnit wclTest)
# Adding a project configuration file (for MSVC only)
generate_msvc_dot_user_file(wclTest)
Expand Down

0 comments on commit e3b89a5

Please sign in to comment.