Skip to content

Commit

Permalink
Fix gh-2795, noreturn specific to newer compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
rengolin committed Jul 9, 2012
1 parent 24e01b7 commit a786084
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmake_modules/commonSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set (CMAKE_COMPILER_IS_CLANGXX 1)
endif()
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
set (CMAKE_COMPILER_IS_CLANG 1)
endif()
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
message ("${CMAKE_CXX_COMPILER_ID}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0 -Wformat -Wformat-security -Wformat-nonliteral -pthread")
Expand All @@ -175,6 +178,14 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
endif ()
endif ()

if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
endif ()

if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
endif ()

macro(HPCC_ADD_EXECUTABLE target)
add_executable(${target} ${ARGN})
endmacro(HPCC_ADD_EXECUTABLE target)
Expand Down
6 changes: 5 additions & 1 deletion tools/start-stop-daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

project(start-stop-daemon)

add_definitions( -Wno-noreturn )
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.1)
add_definitions( -Wno-noreturn )
endif ()
endif ()

set( SRC start-stop-daemon.c )
set( HEADER macros.h )
Expand Down

0 comments on commit a786084

Please sign in to comment.