[CMAKE]
authorJérôme Gardou <jerome.gardou@reactos.org>
Fri, 8 Oct 2010 18:04:16 +0000 (18:04 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Fri, 8 Oct 2010 18:04:16 +0000 (18:04 +0000)
  - link executables against gcc and mingw_common
  - remove link dependencies from mingw_common
This puts C executables into a good shape again.

svn path=/branches/cmake-bringup/; revision=49054

base/applications/charmap/CMakeLists.txt
gcc.cmake
lib/3rdparty/mingw/CMakeLists.txt

index b950157..d0447f3 100644 (file)
@@ -15,4 +15,5 @@ add_executable(charmap
 add_pch(charmap ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
 
 set_module_type(charmap win32gui)
-add_importlibs(charmap user32 gdi32 comctl32 msvcrt)
+
+add_importlibs(charmap user32 gdi32 comctl32 kernel32 msvcrt)
index 874af69..5509e18 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -37,12 +37,12 @@ add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-e
 add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)
 
 #linkage hell...
-add_library(gcc STATIC IMPORTED)
-set_target_properties(gcc PROPERTIES IMPORTED_LOCATION ${REACTOS_SOURCE_DIR}/importlibs/libgcc.a
-    IMPORTED_LINK_INTERFACE_LIBRARIES "mingw_common -lkernel32")
-add_library(supc++ STATIC IMPORTED)
-set_target_properties(supc++ PROPERTIES IMPORTED_LOCATION ${REACTOS_SOURCE_DIR}/importlibs/libsupc++.a
-    IMPORTED_LINK_INTERFACE_LIBRARIES "gcc -lmsvcrt")
+#add_library(gcc STATIC IMPORTED)
+#set_target_properties(gcc PROPERTIES IMPORTED_LOCATION ${REACTOS_SOURCE_DIR}/importlibs/libgcc.a
+#    IMPORTED_LINK_INTERFACE_LIBRARIES "mingw_common -lkernel32")
+#add_library(supc++ STATIC IMPORTED)
+#set_target_properties(supc++ PROPERTIES IMPORTED_LOCATION ${REACTOS_SOURCE_DIR}/importlibs/libsupc++.a
+#    IMPORTED_LINK_INTERFACE_LIBRARIES "gcc -lmsvcrt")
 
 # Macros
 macro(set_entrypoint MODULE ENTRYPOINT)
@@ -89,7 +89,7 @@ macro(set_module_type MODULE TYPE)
         else()
             target_link_libraries(${MODULE} mingw_wmain)
         endif(NOT IS_UNICODE)
-        target_link_libraries(${MODULE} mingw_common gcc)
+               target_link_libraries(${MODULE} -lgcc mingw_common)
     endif()
     if(${TYPE} MATCHES win32cui)
         set_subsystem(${MODULE} console)
@@ -99,7 +99,7 @@ macro(set_module_type MODULE TYPE)
         else()
             target_link_libraries(${MODULE} mingw_wmain)
         endif(NOT IS_UNICODE)
-        target_link_libraries(${MODULE} mingw_common gcc)
+               target_link_libraries(${MODULE} -lgcc mingw_common)
     endif()
     if(${TYPE} MATCHES win32dll)
         set_entrypoint(${MODULE} DllMain@12)
index 2dc9e03..e6f4a97 100644 (file)
@@ -41,9 +41,7 @@ list(APPEND MINGW_COMMON_SOURCE
 add_library(mingw_common ${MINGW_COMMON_SOURCE})
 
 if(NOT MSVC)
-  target_link_libraries(mingw_common)
-#  add_importlibs(mingw_common kernel32 ntdll oldnames)
-#  add_dependencies(mingw_common oldnames)
+  add_dependencies(mingw_common oldnames)
 endif(NOT MSVC)
 
 set_target_properties(mingw_common PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE)