From 9622dedd9f8843e37b23a99a6e84e4a448499497 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 17 Jul 2012 14:08:18 +0000 Subject: [PATCH] [CMAKE] * Make use of the TARGET_PDB variable to consistently group the separate debug files into a symbols folder. svn path=/trunk/; revision=56908 --- reactos/cmake/gcc.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 6bf004eab99..1f0eecc6353 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -115,26 +115,33 @@ endif() if(SEPARATE_DBG) # PDB style debug puts all dwarf debug info in a separate dbg file + message(STATUS "Building separate debug symbols") + file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/symbols) + if(CMAKE_GENERATOR MATCHES "Ninja") + set(SYMBOL_FILE ) + else() + set(SYMBOL_FILE .gdb) + endif() set(OBJCOPY ${CMAKE_OBJCOPY}) set(CMAKE_C_LINK_EXECUTABLE " -o " - "${OBJCOPY} --only-keep-debug .dbg" + "${OBJCOPY} --only-keep-debug ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}" "${OBJCOPY} --strip-debug ") set(CMAKE_CXX_LINK_EXECUTABLE " -o " - "${OBJCOPY} --only-keep-debug .dbg" + "${OBJCOPY} --only-keep-debug ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}" "${OBJCOPY} --strip-debug ") set(CMAKE_C_CREATE_SHARED_LIBRARY " -o " - "${OBJCOPY} --only-keep-debug .dbg" + "${OBJCOPY} --only-keep-debug ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}" "${OBJCOPY} --strip-debug ") set(CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " - "${OBJCOPY} --only-keep-debug .dbg" + "${OBJCOPY} --only-keep-debug ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}" "${OBJCOPY} --strip-debug ") set(CMAKE_RC_CREATE_SHARED_LIBRARY " -o " - "${OBJCOPY} --only-keep-debug .dbg" + "${OBJCOPY} --only-keep-debug ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}" "${OBJCOPY} --strip-debug ") else() # Normal rsym build