Make warnings errors as we rely on the libbacktrace features.
authorMilian Wolff <mail@milianw.de>
Tue, 13 Jan 2015 15:48:56 +0000 (16:48 +0100)
committerMilian Wolff <mail@milianw.de>
Tue, 13 Jan 2015 15:48:56 +0000 (16:48 +0100)
3rdparty/libbacktrace/CMakeLists.txt

index 1ddfc4f..c765945 100644 (file)
@@ -53,9 +53,7 @@ endif()
 if (HAVE_BACKTRACE)
     set (BACKTRACE_FILE backtrace.c simple.c)
 else ()
-    message("WARNING: No unwind.h, setting BACKTRACE_SUPPORTED=0")
-    set (BACKTRACE_FILE nounwind.c)
-    set (BACKTRACE_SUPPORTED 0)
+    message(FATAL_ERROR "Could not find unwind.h, install the libunwind development package.")
 endif ()
 
 include (CheckCCompilerFlag)
@@ -118,9 +116,7 @@ if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
     set (FORMAT_FILE elf.c dwarf.c)
     math (EXPR BACKTRACE_ELF_SIZE 8*${CMAKE_C_SIZEOF_DATA_PTR})
 else ()
-    message("WARNING: Unknown executable format \"${CMAKE_EXECUTABLE_FORMAT}\", setting BACKTRACE_SUPPORTED=0")
-    set (FORMAT_FILE unknown.c)
-    set (BACKTRACE_SUPPORTED 0)
+    message(FATAL_ERROR "Unknown executable format \"${CMAKE_EXECUTABLE_FORMAT}\", currently only ELF is supported.")
 endif ()
 
 check_symbol_exists (mmap sys/mman.h HAVE_MMAP)
@@ -168,12 +164,9 @@ include (CheckIncludeFile)
 find_path(DWARF_INCLUDE_DIR dwarf.h
       PATH_SUFFIXES libdwarf)
 if (NOT DWARF_INCLUDE_DIR)
-    message("WARNING: No dwarf.h, setting BACKTRACE_SUPPORTED=0")
-    set (FORMAT_FILE unknown.c)
-    set (BACKTRACE_SUPPORTED 0)
- else()
-    include_directories(${DWARF_INCLUDE_DIR})
+    message(FATAL_ERROR "Could not find dwarf.h, try installing the elfutils development package.")
 endif ()
+include_directories(${DWARF_INCLUDE_DIR})
 
 configure_file (backtrace-supported.h.in backtrace-supported.h)