[3RDPARTY] Make some warnings non-fatal
[reactos.git] / dll / win32 / shell32 / CMakeLists.txt
index d542de5..60d0fc9 100644 (file)
+PROJECT(SHELL)
+
+add_subdirectory(shelldesktop)
+add_subdirectory(shellmenu)
+add_subdirectory(shellrecyclebin)
 
 set_cpp(WITH_RUNTIME)
+spec2def(shell32.dll shell32.spec ADD_IMPORTLIB)
+
+if(NOT MSVC)
+    # HACK: this should be enabled globally!
+    add_compile_flags_language("-std=c++11" "CXX")
+endif()
+
+if(MSVC)
+    # error C4311: 'type cast': pointer truncation from 'HANDLE' to 'INT'
+    replace_compile_flags("/we4311" " ")
+endif()
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
 add_definitions(
     -D_SHELL32_
-    -D_WINE)
+    -D_WINE
+    -D_ATL_NO_EXCEPTIONS)
 
 include_directories(
-    ${REACTOS_SOURCE_DIR}/lib/recyclebin
-    ${REACTOS_SOURCE_DIR}/lib/atl
+    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     ${REACTOS_SOURCE_DIR})
 
-spec2def(shell32.dll shell32.spec ADD_IMPORTLIB)
-
 list(APPEND SOURCE
-    authors.cpp
-    autocomplete.cpp
-    brsfolder.cpp
-    changenotify.cpp
-    classes.cpp
-    clipboard.cpp
-    control.cpp
-    CMenuBand.cpp
-    CMenuDeskBar.cpp
-    dataobject.cpp
-    dde.cpp
+    CActiveDesktop.cpp
+    CActiveDesktop.h
+    CIDLDataObj.cpp
+    CQueryAssociations.cpp
     debughlp.cpp
-    desktop.cpp
-    dialogs.cpp
-    dragdrophelper.cpp
-    enumidlist.cpp
-    extracticon.cpp
+    dialogs/dialogs.cpp
+    dialogs/drive.cpp
+    dialogs/drvdefext.cpp
+    dialogs/filedefext.cpp
+    dialogs/filetypes.cpp
+    dialogs/folder_options.cpp
+    dialogs/fprop.cpp
+    dialogs/general.cpp
+    dialogs/recycler_prop.cpp
+    dialogs/view.cpp
+    CDropTargetHelper.cpp
+    CEnumIDListBase.cpp
+    CExtractIcon.cpp
     folders.cpp
     iconcache.cpp
-    pidl.cpp
-    shell32_main.cpp
-    shellitem.cpp
-    shelllink.cpp
-    shellole.cpp
-    shellord.cpp
-    shellpath.cpp
-    shellreg.cpp
-    shellstring.cpp
-    folders/desktop.cpp
-    folders/fs.cpp
-    folders/mycomp.cpp
-    folders/mydocuments.cpp
-    folders/printers.cpp
-    folders/admintools.cpp
-    folders/netplaces.cpp
-    folders/fonts.cpp
-    folders/cpanel.cpp
-    folders/recyclebin.cpp
+    shell32.cpp
+    CShellItem.cpp
+    CShellLink.cpp
+    CFolderOptions.cpp
+    folders/CDesktopFolder.cpp
+    folders/CFSFolder.cpp
+    folders/CDrivesFolder.cpp
+    folders/CMyDocsFolder.cpp
+    folders/CPrinterFolder.cpp
+    folders/CAdminToolsFolder.cpp
+    folders/CNetFolder.cpp
+    folders/CFontsFolder.cpp
+    folders/CControlPanelFolder.cpp
+    folders/CRecycleBin.cpp
+    folders/CRegFolder.cpp
+    droptargets/CexeDropHandler.cpp
+    droptargets/CFSDropTarget.cpp
+    droptargets/CRecyclerDropTarget.cpp
     shlexec.cpp
     shlfileop.cpp
     shlfolder.cpp
-    shlfsbind.cpp
-    shlmenu.cpp
-    shlview.cpp
-    shpolicy.cpp
+    CFileSysBindData.cpp
+    CDefView.cpp
+    CDefViewDual.cpp
+    CDefViewBckgrndMenu.cpp
     stubs.cpp
     systray.cpp
-    fprop.cpp
-    drive.cpp
-    defcontextmenu.cpp
-    openwithmenu.cpp
-    newmenu.cpp
-    startmenu.cpp
-    folder_options.cpp
-    filedefext.cpp
-    drvdefext.cpp
-    ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c
-    ${CMAKE_CURRENT_BINARY_DIR}/shell32.def)
+    CUserNotification.cpp
+    CDefaultContextMenu.cpp
+    COpenWithMenu.cpp
+    CNewMenu.cpp
+    CShellDispatch.cpp
+    CFolder.cpp
+    CFolderItems.cpp
+    CFolderItemVerbs.cpp
+    precomp.h)
 
-add_library(shell32 SHARED
-    ${SOURCE}
-    shell32.rc)
-
-set_module_type(shell32 win32dll UNICODE)
+file(GLOB_RECURSE shell32_rc_deps res/*.*)
+list(APPEND shell32_rc_deps ${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb)
+add_rc_deps(shell32.rc ${shell32_rc_deps})
 
-target_link_libraries(shell32
-    atlnew
-    wine
-    uuid
-    recyclebin)
+add_library(shell32 MODULE
+    ${SOURCE}
+    wine/brsfolder.c
+    wine/changenotify.c
+    wine/classes.c
+    wine/clipboard.c
+    wine/control.c
+    wine/pidl.c
+    wine/shell32_main.c
+    wine/shellole.c
+    wine/shellord.c
+    wine/shellpath.c
+    wine/shellreg.c
+    wine/shellstring.c
+    wine/shlmenu.c
+    wine/shpolicy.c
+    vista.c
+    shell32.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/shell32.def)
 
-add_delay_importlibs(shell32 ole32 version fmifs)
 
-add_importlibs(shell32
-    advapi32
-    browseui
-    gdi32
-    user32
-    comctl32
-    comdlg32
-    shdocvw
-    shlwapi
-    devmgr
-    winspool
-    winmm
-    msvcrt
-    kernel32
-    ntdll)
+add_typelib(shell32_shldisp.idl)
+set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb)
 
-add_dependencies(shell32 shdocvw_v1)
-add_pch(shell32 precomp.h)
+set_module_type(shell32 win32dll UNICODE)
+target_link_libraries(shell32 shellmenu shelldesktop atlnew wine uuid recyclebin)
+add_delay_importlibs(shell32 powrprof shdocvw devmgr winspool.drv winmm mpr uxtheme ole32 oleaut32 userenv browseui version fmifs)
+add_importlibs(shell32 advapi32 gdi32 user32 comctl32 comdlg32 shlwapi msvcrt kernel32 ntdll)
+add_dependencies(shell32 stdole2) # shell32_shldisp.tlb needs stdole2.tlb
+add_pch(shell32 precomp.h SOURCE)
 add_cd_file(TARGET shell32 DESTINATION reactos/system32 FOR all)