File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,20 @@ include_directories("${CATKIN_DEVEL_PREFIX}/include")
2323configure_file (urdfdom_compatibility.h.in "${generated_compat_header} " @ONLY)
2424
2525include (CheckCXXCompilerFlag)
26- check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
27- if (COMPILER_SUPPORTS_CXX11)
28- add_compile_options (-std=c++11)
26+ unset (COMPILER_SUPPORTS_CXX11 CACHE )
27+ if (MSVC )
28+ # https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version
29+ # MSVC will fail the following check since it does not have the c++11 switch
30+ # however, c++11 is always enabled (the newer /std:c++14 is enabled by default)
31+ check_cxx_compiler_flag(/std:c++11 COMPILER_SUPPORTS_CXX11)
32+ if (COMPILER_SUPPORTS_CXX11)
33+ add_compile_options (/std:c++11)
34+ endif ()
35+ else ()
36+ check_cxx_compiler_flag(-std=c++11 COMPILER_SUPPORTS_CXX11)
37+ if (COMPILER_SUPPORTS_CXX11)
38+ add_compile_options (-std=c++11)
39+ endif ()
2940endif ()
3041
3142catkin_package(
You can’t perform that action at this time.
0 commit comments