[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 2 Oct 2010 22:19:59 +0000 (22:19 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 2 Oct 2010 22:19:59 +0000 (22:19 +0000)
- Improve some dlls.

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

38 files changed:
dll/win32/cfgmgr32/CMakeLists.txt
dll/win32/clusapi/CMakeLists.txt
dll/win32/compstui/CMakeLists.txt
dll/win32/credui/CMakeLists.txt
dll/win32/crtdll/CMakeLists.txt
dll/win32/crypt32/CMakeLists.txt
dll/win32/cryptdll/CMakeLists.txt
dll/win32/dbghelp/CMakeLists.txt
dll/win32/dciman32/CMakeLists.txt
dll/win32/dhcpcsvc/CMakeLists.txt
dll/win32/dnsapi/CMakeLists.txt
dll/win32/dwmapi/CMakeLists.txt
dll/win32/faultrep/CMakeLists.txt
dll/win32/fmifs/CMakeLists.txt
dll/win32/fusion/CMakeLists.txt
dll/win32/gdi32/CMakeLists.txt
dll/win32/getuname/CMakeLists.txt
dll/win32/hid/CMakeLists.txt
dll/win32/httpapi/CMakeLists.txt
dll/win32/iccvid/CMakeLists.txt
dll/win32/icmp/CMakeLists.txt
dll/win32/imaadp32.acm/CMakeLists.txt
dll/win32/imagehlp/CMakeLists.txt
dll/win32/imm32/CMakeLists.txt
dll/win32/initpki/CMakeLists.txt
dll/win32/iphlpapi/CMakeLists.txt
dll/win32/itircl/CMakeLists.txt
dll/win32/kernel32/CMakeLists.txt
dll/win32/loadperf/CMakeLists.txt
dll/win32/lpk/CMakeLists.txt
dll/win32/lz32/CMakeLists.txt
dll/win32/mapi32/CMakeLists.txt
dll/win32/mciavi32/CMakeLists.txt
dll/win32/mcicda/CMakeLists.txt
dll/win32/mciqtz32/CMakeLists.txt
dll/win32/mciseq/CMakeLists.txt
gcc.cmake
msc.cmake

index 96a3273..f179dab 100644 (file)
@@ -1,12 +1,10 @@
 
-set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
-
 spec2def(cfgmgr32 ${CMAKE_CURRENT_SOURCE_DIR}/cfgmgr32.spec ${CMAKE_CURRENT_BINARY_DIR}/cfgmgr32.def)
 
 add_library(cfgmgr32 SHARED cfgmgr32.rc)
 
-set_target_properties(cfgmgr32 PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(cfgmgr32 0)
 
 target_link_libraries(cfgmgr32 ${CMAKE_CURRENT_BINARY_DIR}/cfgmgr32.def)
 
-add_dependencies(cfgmgr32 cfgmgr32_def psdk)
+add_dependencies(cfgmgr32 cfgmgr32_def psdk buildno_header)
index 17a54c3..cf78730 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(clusapi ${CMAKE_CURRENT_SOURCE_DIR}/clusapi.spec ${CMAKE_CURRENT_BINARY
 
 add_library(clusapi SHARED clusapi.c)
 
-set_target_properties(clusapi PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(clusapi win32dll)
 
 target_link_libraries(clusapi
     ${CMAKE_CURRENT_BINARY_DIR}/clusapi.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(clusapi clusapi_def psdk)
+add_importlibs(clusapi kernel32 ntdll)
+add_dependencies(clusapi clusapi_def)
index c2d1779..6d2b561 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(compstui ${CMAKE_CURRENT_SOURCE_DIR}/compstui.spec ${CMAKE_CURRENT_BINA
 
 add_library(compstui SHARED compstui_main.c)
 
-set_target_properties(compstui PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(compstui win32dll)
 
 target_link_libraries(compstui
     ${CMAKE_CURRENT_BINARY_DIR}/compstui.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(compstui compstui_def psdk)
+add_importlibs(compstui kernel32 ntdll)
+add_dependencies(compstui compstui_def)
index 93e90e7..2cca55f 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,14 +7,11 @@ spec2def(credui ${CMAKE_CURRENT_SOURCE_DIR}/credui.spec ${CMAKE_CURRENT_BINARY_D
 
 add_library(credui SHARED credui_main.c credui.rc)
 
-set_target_properties(credui PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(credui win32dll)
 
 target_link_libraries(credui
     ${CMAKE_CURRENT_BINARY_DIR}/credui.def
-    wine
-    mingw_common
-    -ladvapi32
-    -luser32
-    -lcomctl32)
+    wine)
 
-add_dependencies(credui credui_def psdk)
+add_importlibs(credui advapi32 user32 comctl32 kernel32 ntdll)
+add_dependencies(credui credui_def)
index 85074ca..6119e82 100644 (file)
@@ -1,13 +1,12 @@
 
-
-
-add_definitions(-DUSE_MSVCRT_PREFIX)
-add_definitions(-D_MSVCRT_LIB_)
-add_definitions(-D_MSVCRT_)
-add_definitions(-DCRTDLL)
-add_definitions(-D_CTYPE_DISABLE_MACROS)
-add_definitions(-D_NO_INLINING)
-add_definitions(-D__MINGW_IMPORT="")
+add_definitions(
+    -DUSE_MSVCRT_PREFIX
+    -D_MSVCRT_LIB_
+    -D_MSVCRT_
+    -DCRTDLL
+    -D_CTYPE_DISABLE_MACROS
+    -D_NO_INLINING
+    -D__MINGW_IMPORT="")
 
 include_directories(${REACTOS_SOURCE_DIR}/lib/sdk/crt/include)
 
@@ -19,14 +18,13 @@ add_library(crtdll SHARED
     ${CMAKE_CURRENT_BINARY_DIR}/crtdll_precomp.h.gch
     ${SOURCE})
 
-set_target_properties(crtdll PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(crtdll win32dll)
 
 target_link_libraries(crtdll
     ${CMAKE_CURRENT_BINARY_DIR}/crtdll.def
     wine
-    crt
-    -lkernel32
-    -lntdll)
+    crt)
 
+add_importlibs(crtdll kernel32 ntdll)
 add_pch(crtdll ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(crtdll crtdll_def psdk)
+add_dependencies(crtdll crtdll_def)
index b5d3462..1b05521 100644 (file)
@@ -1,14 +1,13 @@
 
-
-
-add_definitions(-D__WINESRC__)
-add_definitions(-D_DLL -D__USE_CRTIMP)
-add_definitions(-D_WINE)
+add_definitions(
+    -D__WINESRC__
+    -D_DLL
+    -D__USE_CRTIMP
+    -D_WINE)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(crypt32 ${CMAKE_CURRENT_SOURCE_DIR}/crypt32.spec ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def)
@@ -41,15 +40,13 @@ add_library(crypt32 SHARED
     crypt32.rc
     version.rc)
 
-set_target_properties(crypt32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(crypt32 win32dll)
 
 target_link_libraries(crypt32
     ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def
     wine
     pseh
-    mingw_common
-    -luser32
-    -ladvapi32
-    -lmsvcrt)
+    mingw_common)
 
-add_dependencies(crypt32 crypt32_def psdk)
+add_importlibs(crypt32 user32 advapi32 msvcrt)
+add_dependencies(crypt32 crypt32_def)
index 840fb04..03c9c21 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(cryptdll ${CMAKE_CURRENT_SOURCE_DIR}/cryptdll.spec ${CMAKE_CURRENT_BINA
 
 add_library(cryptdll SHARED cryptdll.c)
 
-set_target_properties(cryptdll PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(cryptdll win32dll)
 
 target_link_libraries(cryptdll
     ${CMAKE_CURRENT_BINARY_DIR}/cryptdll.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(cryptdll cryptdll_def psdk)
+add_importlibs(cryptdll kernel32 ntdll)
+add_dependencies(cryptdll cryptdll_def)
index deec12c..8cf02ca 100644 (file)
@@ -1,12 +1,11 @@
 
-
-
-add_definitions(-D__WINESRC__)
-add_definitions(-D_DLL -D__USE_CRTIMP)
-add_definitions(-D_WINE)
-
-add_definitions(-DHAVE_REGEX_H)
-add_definitions(-D_IMAGEHLP_SOURCE_)
+add_definitions(
+    -D__WINESRC__
+    -D_DLL
+    -D__USE_CRTIMP
+    -D_WINE
+    -DHAVE_REGEX_H
+    -D_IMAGEHLP_SOURCE_)
 
 if(ARCH MATCHES amd64)
 add_definitions(-DUNW_FLAG_NHANDLER=0 -DUNW_FLAG_EHANDLER=1 -DUNW_FLAG_UHANDLER=2 -DUNW_FLAG_CHAININFO=3)
@@ -42,15 +41,13 @@ add_library(dbghelp SHARED
     type.c
     version.rc)
 
-set_target_properties(dbghelp PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(dbghelp win32dll)
 
 target_link_libraries(dbghelp
     ${CMAKE_CURRENT_BINARY_DIR}/dbghelp.def
     wine
     mingw_common
-    -lpsapi
-    -lversion
-    pseh
-    -lmsvcrt)
+    pseh)
 
-add_dependencies(dbghelp dbghelp_def psdk)
+add_importlibs(dbghelp psapi version msvcrt)
+add_dependencies(dbghelp dbghelp_def)
index f80999d..97d1481 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(dciman32 ${CMAKE_CURRENT_SOURCE_DIR}/dciman32.spec ${CMAKE_CURRENT_BINA
 
 add_library(dciman32 SHARED dciman_main.c)
 
-set_target_properties(dciman32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(dciman32 win32dll)
 
 target_link_libraries(dciman32
     ${CMAKE_CURRENT_BINARY_DIR}/dciman32.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(dciman32 dciman32_def psdk)
+add_importlibs(dciman32 kernel32 ntdll)
+add_dependencies(dciman32 dciman32_def)
index fbae360..5e7920d 100644 (file)
@@ -1,5 +1,5 @@
 
-
+add_definitions(-Dtzset=_tzset)
 
 include_directories(include)
 
@@ -25,17 +25,10 @@ add_library(dhcpcsvc SHARED
     ${CMAKE_CURRENT_BINARY_DIR}/dhcpcsvc_rosdhcp.h.gch
     ${SOURCE})
 
-set_target_properties(dhcpcsvc PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(dhcpcsvc win32dll)
 
-target_link_libraries(dhcpcsvc
-    ${CMAKE_CURRENT_BINARY_DIR}/dhcpcsvc.def
-    -lmsvcrt
-    -lws2_32
-    -liphlpapi
-    -ladvapi32
-    oldnames
-    -lkernel32
-    -lntdll)
+target_link_libraries(dhcpcsvc ${CMAKE_CURRENT_BINARY_DIR}/dhcpcsvc.def)
 
+add_importlibs(dhcpcsvc ws2_32 iphlpapi advapi32 msvcrt kernel32 ntdll)
 add_pch(dhcpcsvc ${CMAKE_CURRENT_SOURCE_DIR}/include/rosdhcp.h ${SOURCE})
-add_dependencies(dhcpcsvc dhcpcsvc_def psdk)
+add_dependencies(dhcpcsvc dhcpcsvc_def)
index 1339303..fa42c86 100644 (file)
@@ -1,9 +1,8 @@
 
-
-
-include_directories(include)
-include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/src)
-include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/adns_win32)
+include_directories(
+    include
+    ${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/src
+    ${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/adns_win32)
 
 add_definitions(-D_DLL -D__USE_CRTIMP)
 add_definitions(-DADNS_JGAA_WIN32)
@@ -24,17 +23,12 @@ add_library(dnsapi SHARED
     ${CMAKE_CURRENT_BINARY_DIR}/dnsapi_precomp.h.gch
     ${SOURCE})
 
-set_target_properties(dnsapi PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(dnsapi 0)
 
 target_link_libraries(dnsapi
     ${CMAKE_CURRENT_BINARY_DIR}/dnsapi.def
-    adns
-    -luser32
-    -lws2_32
-    -lmsvcrt
-    -liphlpapi
-    -lkernel32
-    -lntdll)
+    adns)
 
+add_importlibs(dnsapi user32 ws2_32 iphlpapi msvcrt kernel32 ntdll)
 add_pch(dnsapi ${CMAKE_CURRENT_SOURCE_DIR}/dnsapi/precomp.h ${SOURCE})
-add_dependencies(dnsapi dnsapi_def psdk)
+add_dependencies(dnsapi dnsapi_def psdk buildno_header)
index c9ec4b2..51c0d79 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(dwmapi ${CMAKE_CURRENT_SOURCE_DIR}/dwmapi.spec ${CMAKE_CURRENT_BINARY_D
 
 add_library(dwmapi SHARED dwmapi_main.c version.rc)
 
-set_target_properties(dwmapi PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(dwmapi win32dll)
 
 target_link_libraries(dwmapi
     ${CMAKE_CURRENT_BINARY_DIR}/dwmapi.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(dwmapi dwmapi_def psdk)
+add_importlibs(dwmapi kernel32 ntdll)
+add_dependencies(dwmapi dwmapi_def)
index f5657fc..d5352a2 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,12 +7,11 @@ spec2def(faultrep ${CMAKE_CURRENT_SOURCE_DIR}/faultrep.spec ${CMAKE_CURRENT_BINA
 
 add_library(faultrep SHARED faultrep.c)
 
-set_target_properties(faultrep PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(faultrep win32dll)
 
 target_link_libraries(faultrep
     ${CMAKE_CURRENT_BINARY_DIR}/faultrep.def
-    wine
-    mingw_common
-    -ladvapi32)
+    wine)
 
-add_dependencies(faultrep faultrep_def psdk)
+add_importlibs(faultrep advapi32 kernel32 ntdll)
+add_dependencies(faultrep faultrep_def)
index 7eb2faf..e2829b1 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 spec2def(fmifs ${CMAKE_CURRENT_SOURCE_DIR}/fmifs.spec ${CMAKE_CURRENT_BINARY_DIR}/fmifs.def)
 
 list(APPEND SOURCE
@@ -16,12 +14,10 @@ list(APPEND SOURCE
 
 add_library(fmifs SHARED ${SOURCE})
 
-set_target_properties(fmifs PROPERTIES LINK_FLAGS "-Wl,-entry,_InitializeFmIfs@12")
+set_entrypoint(fmifs InitializeFmIfs@12)
 
-target_link_libraries(fmifs
-    ${CMAKE_CURRENT_BINARY_DIR}/fmifs.def
-    -lkernel32
-    -lntdll)
+target_link_libraries(fmifs ${CMAKE_CURRENT_BINARY_DIR}/fmifs.def)
 
+add_importlibs(fmifs kernel32 ntdll)
 add_pch(fmifs ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(fmifs fmifs_def psdk)
+add_dependencies(fmifs fmifs_def psdk buildno_header)
index a4f1aa3..fc78ba6 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -15,15 +13,11 @@ add_library(fusion SHARED
     fusion.c
     fusion_main.c)
 
-set_target_properties(fusion PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(fusion win32dll)
 
 target_link_libraries(fusion
     ${CMAKE_CURRENT_BINARY_DIR}/fusion.def
-    wine
-    mingw_common
-    -lshlwapi
-    -ladvapi32
-    -ldbghelp
-    -luser32)
+    wine)
 
-add_dependencies(fusion fusion_def psdk)
+add_importlibs(fusion shlwapi advapi32 dbghelp user32 kernel32 ntdll)
+add_dependencies(fusion fusion_def)
index af5ef37..e0ad13d 100644 (file)
@@ -1,30 +1,54 @@
 
+set_unicode()
 
-
-add_definitions(-DUNICODE -D_UNICODE)
 add_definitions(-D_DLL -D__USE_CRTIMP)
 add_definitions(-DLANGPACK)
 
 include_directories(include)
 
-file(GLOB_RECURSE SOURCE *.c)
+list(APPEND SOURCE
+    main/dllmain.c
+    misc/heap.c
+    misc/gdientry.c
+    misc/hacks.c
+    misc/historic.c
+    misc/misc.c
+    misc/stubs.c
+    misc/stubsa.c
+    misc/stubsw.c
+    misc/wingl.c
+    objects/arc.c
+    objects/bitmap.c
+    objects/brush.c
+    objects/coord.c
+    objects/dc.c
+    objects/eng.c
+    objects/enhmfile.c
+    objects/font.c
+    objects/icm.c
+    objects/linedda.c
+    objects/metafile.c
+    objects/painting.c
+    objects/printdrv.c
+    objects/palette.c
+    objects/pen.c
+    objects/region.c
+    objects/text.c
+    objects/utils.c
+    objects/path.c
+    gdi32.rc)
 
 add_library(gdi32 SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_SOURCE_DIR}/gdi32.rc
-    ${CMAKE_CURRENT_BINARY_DIR}/gdi32_precomp.h.gch)
+    ${CMAKE_CURRENT_BINARY_DIR}/gdi32_precomp.h.gch
+    ${SOURCE})
 
-set_target_properties(gdi32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(gdi32 win32dll)
 
 target_link_libraries(gdi32
     ${CMAKE_CURRENT_SOURCE_DIR}/gdi32.def
-    -luser32
-    -ladvapi32
     win32ksys
     dxguid
-    pseh
-    -lkernel32
-    -lntdll)
-                      
+    pseh)
+
+add_importlibs(gdi32 user32 advapi32 kernel32 ntdll)
 add_pch(gdi32 ${CMAKE_CURRENT_SOURCE_DIR}/include/precomp.h ${SOURCE})
-add_dependencies(gdi32 psdk)
index 99af5b0..24864b9 100644 (file)
@@ -1,7 +1,5 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
@@ -9,11 +7,9 @@ spec2def(getuname ${CMAKE_CURRENT_SOURCE_DIR}/getuname.spec ${CMAKE_CURRENT_BINA
 
 add_library(getuname SHARED getuname.c getuname.rc)
 
-set_target_properties(getuname PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(getuname win32dll)
 
-target_link_libraries(getuname
-    ${CMAKE_CURRENT_BINARY_DIR}/getuname.def
-    -lkernel32
-    -lntdll)
+target_link_libraries(getuname ${CMAKE_CURRENT_BINARY_DIR}/getuname.def)
 
-add_dependencies(getuname getuname_def psdk)
+add_importlibs(getuname kernel32 ntdll)
+add_dependencies(getuname getuname_def)
index a235299..3183ee0 100644 (file)
@@ -1,22 +1,18 @@
 
-
-
-add_definitions(-DUNICODE -D_UNICODE)
+set_unicode()
 
 list(APPEND SOURCE hid.c stubs.c hid.rc)
 
 spec2def(hid ${CMAKE_CURRENT_SOURCE_DIR}/hid.spec ${CMAKE_CURRENT_BINARY_DIR}/hid.def)
 
 add_library(hid SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_BINARY_DIR}/hid_precomp.h.gch)
+    ${CMAKE_CURRENT_BINARY_DIR}/hid_precomp.h.gch
+    ${SOURCE})
 
-set_target_properties(hid PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(hid win32dll)
 
-target_link_libraries(hid
-    ${CMAKE_CURRENT_BINARY_DIR}/hid.def
-    -lkernel32
-    -lntdll)
+target_link_libraries(hid ${CMAKE_CURRENT_BINARY_DIR}/hid.def)
 
+add_importlibs(hid kernel32 ntdll)
 add_pch(hid ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(hid hid_def psdk)
+add_dependencies(hid hid_def)
index d22228d..623d1b8 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,11 +7,11 @@ spec2def(httpapi ${CMAKE_CURRENT_SOURCE_DIR}/httpapi.spec ${CMAKE_CURRENT_BINARY
 
 add_library(httpapi SHARED httpapi_main.c)
 
-set_target_properties(httpapi PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(httpapi win32dll)
 
 target_link_libraries(httpapi
     ${CMAKE_CURRENT_BINARY_DIR}/httpapi.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(httpapi httpapi_def psdk)
+add_importlibs(httpapi kernel32 ntdll)
+add_dependencies(httpapi httpapi_def)
index 95de98c..29a67d1 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -9,12 +7,11 @@ spec2def(iccvid ${CMAKE_CURRENT_SOURCE_DIR}/iccvid.spec ${CMAKE_CURRENT_BINARY_D
 
 add_library(iccvid SHARED iccvid.c rsrc.rc)
 
-set_target_properties(iccvid PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(iccvid win32dll)
 
 target_link_libraries(iccvid
     ${CMAKE_CURRENT_BINARY_DIR}/iccvid.def
-    wine
-    -luser32
-    mingw_common)
+    wine)
 
-add_dependencies(iccvid iccvid_def psdk)
+add_importlibs(iccvid user32 kernel32 ntdll)
+add_dependencies(iccvid iccvid_def)
index 0b3f0c2..d146560 100644 (file)
@@ -1,18 +1,15 @@
 
-
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(icmp ${CMAKE_CURRENT_SOURCE_DIR}/icmp.spec ${CMAKE_CURRENT_BINARY_DIR}/icmp.def)
 
 add_library(icmp SHARED icmp_main.c icmp.rc)
 
-set_target_properties(icmp PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(icmp win32dll)
 
 target_link_libraries(icmp
     ${CMAKE_CURRENT_BINARY_DIR}/icmp.def
-    wine
-    -lws2_32
-    mingw_common)
+    wine)
 
+add_importlibs(icmp ws2_32 kernel32 ntdll)
 add_dependencies(icmp icmp_def psdk)
index f94bd7d..258b363 100644 (file)
@@ -1,8 +1,5 @@
 
-
-
 add_definitions(-D_DLL -D__USE_CRTIMP)
-
 add_definitions(-D__WINESRC__)
 
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
@@ -16,14 +13,12 @@ add_custom_target(imaadp32.acm_def ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/imaad
 
 add_library(imaadp32.acm SHARED imaadp32.c)
 
-set_target_properties(imaadp32.acm PROPERTIES LINK_FLAGS "-Wl,-entry,0" SUFFIX "")
+set_entrypoint(imaadp32.acm 0)
+set_target_properties(imaadp32.acm PROPERTIES SUFFIX "")
 
 target_link_libraries(imaadp32.acm
     ${CMAKE_CURRENT_BINARY_DIR}/imaadp32.acm.def
-    wine
-    -lwinmm
-    -luser32
-    mingw_common
-    -lmsvcrt)
+    wine)
 
-add_dependencies(imaadp32.acm imaadp32.acm_def psdk)
+add_importlibs(imaadp32.acm winmm user32 msvcrt kernel32 ntdll)
+add_dependencies(imaadp32.acm imaadp32.acm_def psdk buildno_header)
index a4cc996..4929c67 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D_DLL -D__USE_CRTIMP)
 add_definitions(-D_IMAGEHLP_SOURCE_)
 
@@ -19,14 +17,12 @@ add_library(imagehlp SHARED
     ${CMAKE_CURRENT_BINARY_DIR}/imagehlp_precomp.h.gch
     ${SOURCE})
 
-set_target_properties(imagehlp PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(imagehlp win32dll)
 
 target_link_libraries(imagehlp
     ${CMAKE_CURRENT_BINARY_DIR}/imagehlp.def
-    wine
-    -ldbghelp
-    mingw_common
-    -lmsvcrt)
+    wine)
 
+add_importlibs(imagehlp dbghelp kernel32 ntdll)
 add_pch(imagehlp ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE})
-add_dependencies(imagehlp imagehlp_def psdk)
+add_dependencies(imagehlp imagehlp_def)
index e3824fc..d3db4c7 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D__WINESRC__)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
@@ -12,13 +10,11 @@ spec2def(imm32 ${CMAKE_CURRENT_SOURCE_DIR}/imm32.spec ${CMAKE_CURRENT_BINARY_DIR
 
 add_library(imm32 SHARED imm.c version.rc)
 
-set_target_properties(imm32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(imm32 win32dll)
 
 target_link_libraries(imm32
     ${CMAKE_CURRENT_BINARY_DIR}/imm32.def
-    wine
-    -ladvapi32
-    -luser32
-    mingw_common)
+    wine)
 
-add_dependencies(imm32 imm32_def psdk)
+add_importlibs(imm32 advapi32 user32 kernel32 ntdll)
+add_dependencies(imm32 imm32_def)
index aa9c10f..bdf573b 100644 (file)
@@ -1,19 +1,16 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(initpki ${CMAKE_CURRENT_SOURCE_DIR}/initpki.spec ${CMAKE_CURRENT_BINARY_DIR}/initpki.def)
 
 add_library(initpki SHARED main.c)
 
-set_target_properties(initpki PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(initpki win32dll)
 
 target_link_libraries(initpki
     ${CMAKE_CURRENT_BINARY_DIR}/initpki.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(initpki initpki_def psdk)
+add_importlibs(initpki kernel32 ntdll)
+add_dependencies(initpki initpki_def)
index 14b9533..f9aba7a 100644 (file)
@@ -1,12 +1,12 @@
 
-
+set_unicode()
 
 add_definitions(-D_DLL -D__USE_CRTIMP)
-add_definitions(-DUNICODE -D_UNICODE)
 
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
-include_directories(${REACTOS_SOURCE_DIR}/dll/win32/dhcpcsvc/include)
-include_directories(${REACTOS_SOURCE_DIR}/lib/tdilib)
+include_directories(
+    ${REACTOS_SOURCE_DIR}/include/reactos/wine
+    ${REACTOS_SOURCE_DIR}/dll/win32/dhcpcsvc/include
+    ${REACTOS_SOURCE_DIR}/lib/tdilib)
 
 spec2def(iphlpapi ${CMAKE_CURRENT_SOURCE_DIR}/iphlpapi.spec ${CMAKE_CURRENT_BINARY_DIR}/iphlpapi.def)
 
@@ -21,16 +21,12 @@ add_library(iphlpapi SHARED
     route_reactos.c
     iphlpapi.rc)
 
-set_target_properties(iphlpapi PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(iphlpapi win32dll)
 
 target_link_libraries(iphlpapi
     ${CMAKE_CURRENT_BINARY_DIR}/iphlpapi.def
     wine
-    tdilib
-    -ldhcpcsvc
-    -ladvapi32
-    -lws2_32
-    mingw_common
-    -lmsvcrt)
-
-add_dependencies(iphlpapi iphlpapi_def psdk)
+    tdilib)
+
+add_importlibs(iphlpapi dhcpcsvc advapi32 ws2_32 msvcrt kernel32 ntdll)
+add_dependencies(iphlpapi iphlpapi_def)
index 8118c30..12e2b6e 100644 (file)
@@ -1,19 +1,16 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(itircl ${CMAKE_CURRENT_SOURCE_DIR}/itircl.spec ${CMAKE_CURRENT_BINARY_DIR}/itircl.def)
 
 add_library(itircl SHARED itircl_main.c)
 
-set_target_properties(itircl PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(itircl win32dll)
 
 target_link_libraries(itircl
     ${CMAKE_CURRENT_BINARY_DIR}/itircl.def
-    wine
-    mingw_common)
+    wine)
 
+add_importlibs(itircl kernel32 ntdll)
 add_dependencies(itircl itircl_def psdk)
index 9205bfd..ddcff4e 100644 (file)
@@ -1,6 +1,4 @@
 
-
-
 add_definitions(-D_KERNEL32_)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
@@ -94,20 +92,28 @@ list(APPEND SOURCE
     thread/fls.c
     thread/thread.c
     thread/tls.c
-    thread/${ARCH}/fiber.S
-    thread/${ARCH}/thread.S
     kernel32.rc
     kernel32_stubs.c)
 
+if(ARCH MATCHES i386)
+list(APPEND SOURCE
+    thread/i386/fiber.S
+    thread/i386/thread.S)
+elseif(ARCH MATCHES amd64)
+list(APPEND SOURCE
+    thread/amd64/fiber.S
+    thread/amd64/thread.S)
+endif(ARCH MATCHES i386)
+
 add_library(kernel32 SHARED
-    ${SOURCE}
-    ${CMAKE_CURRENT_BINARY_DIR}/kernel32_k32.h.gch)
+    ${CMAKE_CURRENT_BINARY_DIR}/kernel32_k32.h.gch
+    ${SOURCE})
 
-set_target_properties(kernel32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(kernel32 win32dll)
 
 target_link_libraries(kernel32 ${CMAKE_CURRENT_SOURCE_DIR}/kernel32.def
-    pseh
-    -lntdll)
+    pseh)
 
+add_importlibs(kernel32 ntdll)
 add_pch(kernel32 ${CMAKE_CURRENT_SOURCE_DIR}/k32.h ${SOURCE})
-add_dependencies(kernel32 errcodes version)
+add_dependencies(kernel32 errcodes)
index e4dc985..1e266a6 100644 (file)
@@ -1,19 +1,16 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(loadperf ${CMAKE_CURRENT_SOURCE_DIR}/loadperf.spec ${CMAKE_CURRENT_BINARY_DIR}/loadperf.def)
 
 add_library(loadperf SHARED loadperf_main.c)
 
-set_target_properties(loadperf PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(loadperf win32dll)
 
 target_link_libraries(loadperf
     ${CMAKE_CURRENT_BINARY_DIR}/loadperf.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(loadperf loadperf_def psdk)
+add_importlibs(loadperf kernel32 ntdll)
+add_dependencies(loadperf loadperf_def)
index 0441047..90f44a9 100644 (file)
@@ -1,22 +1,16 @@
 
-
+set_unicode()
 
 add_definitions(-DLANGPACK)
-add_definitions(-DUNICODE -D_UNICODE)
-
 include_directories(include)
 
 spec2def(lpk ${CMAKE_CURRENT_SOURCE_DIR}/lpk.spec ${CMAKE_CURRENT_BINARY_DIR}/lpk.def)
 
 add_library(lpk SHARED dllmain.c stub.c lpk.rc)
 
-set_target_properties(lpk PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(lpk win32dll)
 
-target_link_libraries(lpk
-    ${CMAKE_CURRENT_BINARY_DIR}/lpk.def
-    -luser32
-    -lusp10
-    -lkernel32
-    -lntdll)
+target_link_libraries(lpk ${CMAKE_CURRENT_BINARY_DIR}/lpk.def)
 
-add_dependencies(lpk lpk_def psdk)
+add_importlibs(lpk user32 usp10 kernel32 ntdll)
+add_dependencies(lpk lpk_def)
index 2708d43..4417a3d 100644 (file)
@@ -1,19 +1,16 @@
 
-set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> -L${REACTOS_BINARY_DIR}/lib/3rdparty/mingw")
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(lz32 ${CMAKE_CURRENT_SOURCE_DIR}/lz32.spec ${CMAKE_CURRENT_BINARY_DIR}/lz32.def)
 
 add_library(lz32 SHARED version.rc)
 
-set_target_properties(lz32 PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(lz32 0)
 
 target_link_libraries(lz32
     ${CMAKE_CURRENT_BINARY_DIR}/lz32.def
-    wine
-    mingw_common)
+    wine)
 
-add_dependencies(lz32 lz32_def psdk)
+add_importlibs(lz32 kernel32 ntdll)
+add_dependencies(lz32 lz32_def psdk buildno_header)
index 73613c3..3748378 100644 (file)
@@ -1,8 +1,5 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(mapi32 ${CMAKE_CURRENT_SOURCE_DIR}/mapi32.spec ${CMAKE_CURRENT_BINARY_DIR}/mapi32.def)
@@ -15,16 +12,12 @@ add_library(mapi32 SHARED
     util.c
     version.rc)
 
-set_target_properties(mapi32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(mapi32 win32dll)
 
 target_link_libraries(mapi32
     ${CMAKE_CURRENT_BINARY_DIR}/mapi32.def
     wine
-    -lshlwapi
-    -lshell32
-    -luuid
-    mingw_common
-    -luser32
-    -ladvapi32)
+    uuid)
 
-add_dependencies(mapi32 mapi32_def psdk)
+add_importlibs(mapi32 shlwapi shell32 user32 advapi32 kernel32 ntdll)
+add_dependencies(mapi32 mapi32_def)
index 77d850a..0afa7bd 100644 (file)
@@ -1,8 +1,5 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(mciavi32 ${CMAKE_CURRENT_SOURCE_DIR}/mciavi32.spec ${CMAKE_CURRENT_BINARY_DIR}/mciavi32.def)
@@ -14,15 +11,11 @@ add_library(mciavi32 SHARED
     wnd.c
     mciavi_res.rc)
 
-set_target_properties(mciavi32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(mciavi32 win32dll)
 
 target_link_libraries(mciavi32
     ${CMAKE_CURRENT_BINARY_DIR}/mciavi32.def
-    wine
-    -lmsvfw32
-    -lwinmm
-    mingw_common
-    -luser32
-    -lgdi32)
+    wine)
 
-add_dependencies(mciavi32 mciavi32_def psdk)
+add_importlibs(mciavi32 msvfw32 winmm user32 gdi32 kernel32 ntdll)
+add_dependencies(mciavi32 mciavi32_def)
index 7ebda7b..bfb28b4 100644 (file)
@@ -1,21 +1,16 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(mcicda ${CMAKE_CURRENT_SOURCE_DIR}/mcicda.spec ${CMAKE_CURRENT_BINARY_DIR}/mcicda.def)
 
 add_library(mcicda SHARED mcicda.c)
 
-set_target_properties(mcicda PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(mcicda 0)
 
 target_link_libraries(mcicda
     ${CMAKE_CURRENT_BINARY_DIR}/mcicda.def
-    wine
-    -lwinmm
-    mingw_common
-    -luser32)
+    wine)
 
-add_dependencies(mcicda mcicda_def psdk)
+add_importlibs(mcicda winmm user32 kernel32 ntdll)
+add_dependencies(mcicda mcicda_def psdk buildno_header)
index 009a324..d82756e 100644 (file)
@@ -1,25 +1,17 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(mciqtz32 ${CMAKE_CURRENT_SOURCE_DIR}/mciqtz32.spec ${CMAKE_CURRENT_BINARY_DIR}/mciqtz32.def)
 
 add_library(mciqtz32 SHARED mciqtz.c version.rc)
 
-set_target_properties(mciqtz32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+set_module_type(mciqtz32 win32dll)
 
 target_link_libraries(mciqtz32
     ${CMAKE_CURRENT_BINARY_DIR}/mciqtz32.def
     wine
-    -lwinmm
-    -loleaut32
-    -lole32
-    strmiids
-    mingw_common
-    -luser32
-    -lgdi32)
+    strmiids)
 
-add_dependencies(mciqtz32 mciqtz32_def psdk)
+add_importlibs(mciqtz32 winmm oleaut32 ole32 user32 gdi32 kernel32 ntdll)
+add_dependencies(mciqtz32 mciqtz32_def)
index 749a385..87a7986 100644 (file)
@@ -1,21 +1,16 @@
 
-
-
 add_definitions(-D__WINESRC__)
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
 spec2def(mciseq ${CMAKE_CURRENT_SOURCE_DIR}/mciseq.spec ${CMAKE_CURRENT_BINARY_DIR}/mciseq.def)
 
 add_library(mciseq SHARED mcimidi.c)
 
-set_target_properties(mciseq PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(mciseq 0)
 
 target_link_libraries(mciseq
     ${CMAKE_CURRENT_BINARY_DIR}/mciseq.def
-    wine
-    -lwinmm
-    mingw_common
-    -luser32)
+    wine)
 
-add_dependencies(mciseq mciseq_def psdk)
+add_importlibs(mciseq winmm user32 kernel32 ntdll)
+add_dependencies(mciseq mciseq_def psdk buildno_header)
index cca492f..a559af7 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -18,6 +18,8 @@ add_definitions(-pipe -fms-extensions)
 \r
 set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")\r
 \r
+set(CMAKE_RC_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")\r
+\r
 # Debugging (Note: DWARF-4 on 4.5.1 when we ship)\r
 add_definitions(-gdwarf-2 -g2 -femit-struct-debug-detailed=none -feliminate-unused-debug-types)\r
 \r
@@ -30,15 +32,12 @@ add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-e
 # Optimizations\r
 add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-set-stack-executable -fno-optimize-sibling-calls)\r
 \r
-# C++ Flags\r
-#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")\r
-\r
 # Macros\r
 macro(set_entrypoint MODULE ENTRYPOINT)\r
     if(${ENTRYPOINT} STREQUAL "0")\r
-    set(NEW_LINKER_FLAGS "-Wl,-entry,0")\r
+        set(NEW_LINKER_FLAGS "-Wl,-entry,0")\r
     else()\r
-    set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}")\r
+        set(NEW_LINKER_FLAGS "-Wl,-entry,_${ENTRYPOINT}")\r
     endif()\r
     get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)\r
     if(LINKER_FLAGS)\r
index 42754e4..b07ac24 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -16,9 +16,9 @@ add_definitions(-Dinline=__inline -D__STDC__=1)
 \r
 macro(set_entrypoint MODULE ENTRYPOINT)\r
     if(${ENTRYPOINT} STREQUAL "0")\r
-    set(NEW_LINKER_FLAGS "/ENTRY:0")\r
+        set(NEW_LINKER_FLAGS "/ENTRY:0")\r
     else()\r
-    set(NEW_LINKER_FLAGS "/ENTRY:${ENTRYPOINT}")\r
+        set(NEW_LINKER_FLAGS "/ENTRY:${ENTRYPOINT}")\r
     endif()\r
     get_target_property(LINKER_FLAGS ${MODULE} LINK_FLAGS)\r
     if(LINKER_FLAGS)\r