[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 3 Oct 2014 09:56:36 +0000 (09:56 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 3 Oct 2014 09:56:36 +0000 (09:56 +0000)
* Introduce an option to compile ReactOS with dwarf symbols instead of rossym. Use NO_ROSSYM to control it.
* Dedicated to V.
CORE-8594 #resolve

svn path=/trunk/; revision=64483

reactos/cmake/gcc.cmake

index 9b92c7f..bcfb0c7 100644 (file)
@@ -9,6 +9,11 @@ if(NOT DEFINED SEPARATE_DBG)
     set(SEPARATE_DBG FALSE)
 endif()
 
+# Dwarf based builds (no rsym)
+if(NOT DEFINED NO_ROSSYM)
+    set(NO_ROSSYM FALSE)
+endif()
+
 if(NOT DEFINED USE_PSEH3)
     set(USE_PSEH3 1)
 endif()
@@ -194,6 +199,14 @@ if(SEPARATE_DBG)
         "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
         "${OBJCOPY} --only-keep-debug <TARGET> ${REACTOS_BINARY_DIR}/symbols/${SYMBOL_FILE}"
         "${OBJCOPY} --strip-debug <TARGET>")
+elseif(NO_ROSSYM)
+    # Dwarf-based build
+    message(STATUS "Generating a dwarf-based build (no rsym)")
+    set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+    set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+    set(CMAKE_CXX_CREATE_SHARED_LIBRARY "<CMAKE_CXX_COMPILER> ${CMAKE_CXX_FLAGS} <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+    set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
 else()
     # Normal rsym build
     get_target_property(RSYM native-rsym IMPORTED_LOCATION_NOCONFIG)