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

Fix clang detection on Mac OS #1038

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
6 changes: 4 additions & 2 deletions tesseract_common/cmake/tesseract_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ macro(tesseract_variables)
"unknown")
set(TESSERACT_COMPILE_OPTIONS_PUBLIC -mno-avx)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
set(TESSERACT_COMPILE_OPTIONS_PRIVATE
-Wall
-Wextra
-Wconversion
-Wsign-conversion)
set(TESSERACT_COMPILE_DEFINITIONS "BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED")
message(WARNING "Non-GNU compiler detected. If using AVX instructions, Eigen alignment issues may result.")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(TESSERACT_COMPILE_DEFINITIONS "_USE_MATH_DEFINES=ON")
Expand Down Expand Up @@ -132,12 +133,13 @@ macro(tesseract_variables)
"unknown")
set(TESSERACT_COMPILE_OPTIONS_PUBLIC -mno-avx)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
set(TESSERACT_COMPILE_OPTIONS_PRIVATE
-Werror=all
-Werror=extra
-Werror=conversion
-Werror=sign-conversion)
set(TESSERACT_COMPILE_DEFINITIONS "BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED")
message(WARNING "Non-GNU compiler detected. If using AVX instructions, Eigen alignment issues may result.")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(TESSERACT_COMPILE_DEFINITIONS "_USE_MATH_DEFINES=ON")
Expand Down
6 changes: 3 additions & 3 deletions tesseract_common/include/tesseract_common/yaml_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ struct convert<Eigen::VectorXd>
static Node encode(const Eigen::VectorXd& rhs)
{
Node node;
for (long i = 0; i < rhs.size(); ++i)
for (long i = 0; i < static_cast<long>(rhs.size()); ++i)
node.push_back(rhs(i));

return node;
Expand All @@ -343,8 +343,8 @@ struct convert<Eigen::VectorXd>
if (!node.IsSequence())
return false;

rhs.resize(static_cast<Eigen::Index>(node.size()));
for (long i = 0; i < node.size(); ++i)
rhs.resize(static_cast<long>(node.size()));
for (long i = 0; i < static_cast<long>(node.size()); ++i)
rhs(i) = node[i].as<double>();

return true;
Expand Down
2 changes: 1 addition & 1 deletion tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ bool Environment::Implementation::applyAddTrajectoryLinkCommand(const AddTraject
return false;
}

if (state.joint_names.size() != state.position.size())
if (static_cast<Eigen::Index>(state.joint_names.size()) != state.position.size())
{
CONSOLE_BRIDGE_logWarn("Tried to add trajectory link (%s) where joint names and position are different sizes.",
cmd->getLinkName().c_str());
Expand Down
Loading