From: Martin Quinson Date: Tue, 4 Feb 2020 13:08:09 +0000 (+0100) Subject: get my crude hack in MSG to compile on both gcc and clang X-Git-Tag: v3.26~1046 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/acd99fef229fa1fa16b20cbf83d288430623cbb2 get my crude hack in MSG to compile on both gcc and clang --- diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 38890f4d1c..134366727a 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -26,8 +26,13 @@ set_property(TARGET simgrid # Don't complain when we cast (int (*)(int,char**)) into (void(*)(int,char**)) # This will stop when MSG goes away -set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_legacy.cpp PROPERTY COMPILE_FLAGS -Wno-error=cast-function-type) -set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_process.cpp PROPERTY COMPILE_FLAGS -Wno-error=cast-function-type) +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_legacy.cpp PROPERTY COMPILE_FLAGS -Wno-error=bad-function-cast) + set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_process.cpp PROPERTY COMPILE_FLAGS -Wno-error=bad-function-cast) +elseif(CMAKE_COMPILER_IS_GNUCXX) + set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_legacy.cpp PROPERTY COMPILE_FLAGS -Wno-error=cast-function-type) + set_property(SOURCE ${CMAKE_HOME_DIRECTORY}/src/msg/msg_process.cpp PROPERTY COMPILE_FLAGS -Wno-error=cast-function-type) +endif() add_dependencies(simgrid maintainer_files)