From db37322eb63f7ed0fcdff0a40ea43043f63da2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Fri, 8 Oct 2010 18:04:16 +0000 Subject: [PATCH] [CMAKE] - 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 | 3 ++- gcc.cmake | 16 ++++++++-------- lib/3rdparty/mingw/CMakeLists.txt | 4 +--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/base/applications/charmap/CMakeLists.txt b/base/applications/charmap/CMakeLists.txt index b9501579c42..d0447f30a49 100644 --- a/base/applications/charmap/CMakeLists.txt +++ b/base/applications/charmap/CMakeLists.txt @@ -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) diff --git a/gcc.cmake b/gcc.cmake index 874af699187..5509e1859af 100644 --- 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) diff --git a/lib/3rdparty/mingw/CMakeLists.txt b/lib/3rdparty/mingw/CMakeLists.txt index 2dc9e035492..e6f4a9709f2 100644 --- a/lib/3rdparty/mingw/CMakeLists.txt +++ b/lib/3rdparty/mingw/CMakeLists.txt @@ -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)