From 3987806087aaa4a4ef8b16152078035552a56e45 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 30 Jul 2013 21:44:10 +0000 Subject: [PATCH] Add capability for building with -gsplit-dwarf to the cmake build. In limited testing this seems to work. Caveat emptor. llvm-svn: 187452 --- llvm/CMakeLists.txt | 3 +++ llvm/cmake/modules/HandleLLVMOptions.cmake | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 7697a2b9c59f..687176ca5772 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -183,6 +183,9 @@ endif( LLVM_USE_OPROFILE ) set(LLVM_USE_SANITIZER "" CACHE STRING "Define the sanitizer used to build binaries and tests.") +option(LLVM_USE_SPLIT_DWARF + "Use -gsplit-dwarf when compiling llvm." OFF) + # Define an option controlling whether we should build for 32-bit on 64-bit # platforms, where supported. if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 931fcdc1133b..88a4730f6591 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -261,6 +261,11 @@ if(LLVM_USE_SANITIZER) endif() endif() +# Turn on -gsplit-dwarf if requested +if(LLVM_USE_SPLIT_DWARF) + add_flag_if_supported("-gsplit-dwarf") +endif() + add_llvm_definitions( -D__STDC_CONSTANT_MACROS ) add_llvm_definitions( -D__STDC_FORMAT_MACROS ) add_llvm_definitions( -D__STDC_LIMIT_MACROS )