[CMAKE] Introduce the atl_classes interface library
authorJérôme Gardou <jerome.gardou@reactos.org>
Fri, 18 Sep 2020 09:08:58 +0000 (11:08 +0200)
committerJérôme Gardou <zefklop@users.noreply.github.com>
Tue, 20 Oct 2020 19:44:54 +0000 (21:44 +0200)
This takes care of adding the relvant include directory and the _ATL_NO_EXCEPTIONS define, if needed

36 files changed:
base/applications/charmap_new/CMakeLists.txt
base/applications/drwtsn32/CMakeLists.txt
base/applications/fltmc/CMakeLists.txt
base/applications/msconfig_new/CMakeLists.txt
base/applications/mspaint/CMakeLists.txt
base/applications/rapps/CMakeLists.txt
base/shell/explorer/CMakeLists.txt
base/shell/rshell/CMakeLists.txt
dll/shellext/acppage/CMakeLists.txt
dll/shellext/fontext/CMakeLists.txt
dll/shellext/mydocs/CMakeLists.txt
dll/shellext/netshell/CMakeLists.txt
dll/shellext/ntobjshex/CMakeLists.txt
dll/shellext/sendmail/CMakeLists.txt
dll/shellext/stobject/CMakeLists.txt
dll/shellext/zipfldr/CMakeLists.txt
dll/win32/browseui/CMakeLists.txt
dll/win32/browseui/shellbars/CMakeLists.txt
dll/win32/browseui/shellfind/CMakeLists.txt
dll/win32/devmgr/CMakeLists.txt
dll/win32/msgina/CMakeLists.txt
dll/win32/shell32/CMakeLists.txt
dll/win32/shell32/shelldesktop/CMakeLists.txt
dll/win32/shell32/shellmenu/CMakeLists.txt
dll/win32/shell32/shellrecyclebin/CMakeLists.txt
dll/win32/shlwapi/CMakeLists.txt
modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
modules/rostests/apitests/apphelp/CMakeLists.txt
modules/rostests/apitests/atl/CMakeLists.txt
modules/rostests/apitests/browseui/CMakeLists.txt
modules/rostests/apitests/fontext/CMakeLists.txt
modules/rostests/apitests/msgina/CMakeLists.txt
modules/rostests/apitests/shell32/CMakeLists.txt
modules/rostests/apitests/zipfldr/CMakeLists.txt
sdk/lib/CMakeLists.txt
sdk/lib/atl/CMakeLists.txt [new file with mode: 0644]

index 0e26047..06616bf 100644 (file)
@@ -6,7 +6,6 @@ if(NOT MSVC)
 endif()
 
 include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     includes)
 
 list(APPEND SOURCE
@@ -19,7 +18,7 @@ add_library(charmap MODULE
     charmap.rc)
 
 set_module_type(charmap win32gui UNICODE)
-target_link_libraries(charmap uuid wine cpprt)
+target_link_libraries(charmap uuid wine cpprt atl_classes)
 set_target_cpp_properties(charmap WITH_EXCEPTIONS WITH_RTTI)
 add_importlibs(charmap advapi32 user32 gdi32 comctl32 version msvcrt kernel32 ole32 uxtheme ntdll)
 add_pch(charmap precomp.h SOURCE)
index 55d5f6c..9534850 100644 (file)
@@ -2,7 +2,6 @@
 PROJECT(drwtsn32)
 
 include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     ${REACTOS_SOURCE_DIR}/sdk/lib/udmihelp)
 
 list(APPEND CPP_SOURCE
@@ -16,7 +15,7 @@ list(APPEND CPP_SOURCE
 add_executable(drwtsn32 ${CPP_SOURCE} drwtsn32.rc)
 add_pch(drwtsn32 precomp.h CPP_SOURCE)
 set_module_type(drwtsn32 win32gui UNICODE)
-target_link_libraries(drwtsn32 udmihelp cppstl)
+target_link_libraries(drwtsn32 udmihelp cppstl atl_classes)
 set_target_cpp_properties(drwtsn32 WITH_EXCEPTIONS)
 add_importlibs(drwtsn32 dbghelp psapi advapi32 shell32 shlwapi msvcrt user32 kernel32 ntdll)
 add_cd_file(TARGET drwtsn32 DESTINATION reactos/system32 FOR all)
index 3e0aa70..41774c4 100644 (file)
@@ -2,10 +2,8 @@
 remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502)
 add_definitions(-D_WIN32_WINNT=0x601)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 add_executable(fltmc fltmc.cpp fltmc.rc)
-target_link_libraries(fltmc cpprt)
+target_link_libraries(fltmc cpprt atl_classes)
 set_target_cpp_properties(fltmc WITH_EXCEPTIONS)
 set_module_type(fltmc win32cui UNICODE)
 add_importlibs(fltmc fltlib msvcrt kernel32 advapi32)
index 5d8ebbe..a44f459 100644 (file)
@@ -4,8 +4,7 @@ PROJECT(msconfig_new)
 include_directories(
     .
     comctl32ex
-    ${REACTOS_SOURCE_DIR}/sdk/include/c++
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
+    ${REACTOS_SOURCE_DIR}/sdk/include/c++)
 
 list(APPEND C_SOURCE
     comctl32ex/comctl32supp.c
@@ -33,7 +32,7 @@ add_rc_deps(msconfig.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/msconfig.ico)
 add_executable(msconfig_new ${C_SOURCE} ${CPP_SOURCE} msconfig.rc)
 add_pch(msconfig_new precomp.h CPP_SOURCE)
 set_module_type(msconfig_new win32gui UNICODE)
-target_link_libraries(msconfig_new comsupp cpprt)
+target_link_libraries(msconfig_new comsupp cpprt atl_classes)
 set_target_cpp_properties(msconfig_new WITH_EXCEPTIONS)
 add_importlibs(msconfig_new user32 gdi32 comctl32 comdlg32 advapi32 version ole32 oleaut32 msxml3 shell32 shlwapi msvcrt kernel32)
 add_cd_file(TARGET msconfig_new DESTINATION reactos/system32 FOR all)
index c5ba106..fcf694a 100644 (file)
@@ -2,8 +2,6 @@ project(MSPAINT)
 
 add_definitions(-DINITGUID)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     dialogs.cpp
     dib.cpp
@@ -32,7 +30,7 @@ file(GLOB mspaint_rc_deps icons/*.*)
 add_rc_deps(rsrc.rc ${mspaint_rc_deps})
 add_executable(mspaint ${SOURCE} rsrc.rc)
 set_module_type(mspaint win32gui UNICODE)
-target_link_libraries(mspaint uuid cpprt)
+target_link_libraries(mspaint uuid cpprt atl_classes)
 set_target_cpp_properties(mspaint WITH_EXCEPTIONS)
 add_importlibs(mspaint hhctrl comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 rpcrt4 shlwapi)
 add_pch(mspaint precomp.h SOURCE)
index 0616ddd..cb559b5 100644 (file)
@@ -1,6 +1,5 @@
 project(rapps)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib)
 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
 include_directories(include)
@@ -37,14 +36,13 @@ list(APPEND SOURCE
 )
 
 add_definitions(
-    -DUSE_CERT_PINNING
-    -D_ATL_NO_EXCEPTIONS)
+    -DUSE_CERT_PINNING)
 
 file(GLOB_RECURSE rapps_rc_deps res/*.*)
 add_rc_deps(rapps.rc ${rapps_rc_deps})
 add_executable(rapps ${SOURCE} rapps.rc)
 set_module_type(rapps win32cui UNICODE)
-target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt)
+target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt atl_classes)
 add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi gdiplus msvcrt kernel32 ntdll)
 add_pch(rapps include/rapps.h SOURCE)
 add_dependencies(rapps rappsmsg)
index 33d9044..743c10d 100644 (file)
@@ -1,8 +1,5 @@
 PROJECT(SHELL)
 
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     appbar.cpp
     desktop.cpp
@@ -30,7 +27,7 @@ list(APPEND SOURCE
 file(GLOB explorer_rc_deps res/*.*)
 add_rc_deps(explorer.rc ${explorer_rc_deps})
 add_executable(explorer ${SOURCE} explorer.rc)
-target_link_libraries(explorer uuid wine cpprt)
+target_link_libraries(explorer uuid wine cpprt atl_classes)
 set_module_type(explorer win32gui UNICODE)
 add_importlibs(explorer advapi32 gdi32 user32 comctl32 ole32 oleaut32 shell32 browseui shlwapi shdocvw version uxtheme msvcrt kernel32 ntdll)
 add_pch(explorer precomp.h SOURCE)
index c47a121..8397a01 100644 (file)
@@ -1,11 +1,5 @@
 PROJECT(SHELL)
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 spec2def(rshell.dll rshell.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
@@ -23,7 +17,8 @@ target_link_libraries(rshell
     shelldesktop
     uuid
     wine
-    cpprt)
+    cpprt
+    atl_classes)
 
 add_importlibs(rshell
     browseui
index a8708a5..fe694f8 100644 (file)
@@ -6,11 +6,7 @@ if(NOT MSVC)
     add_compile_flags_language("-std=c++11" "CXX")
 endif()
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
 include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     ${REACTOS_SOURCE_DIR}/dll/appcompat/apphelp
     ${REACTOS_SOURCE_DIR})
 spec2def(acppage.dll acppage.spec ADD_IMPORTLIB)
@@ -31,7 +27,7 @@ add_library(acppage MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/acppage.def)
 
 set_module_type(acppage win32dll UNICODE)
-target_link_libraries(acppage wine uuid cpprt)
+target_link_libraries(acppage wine uuid cpprt atl_classes)
 add_delay_importlibs(acppage apphelp ole32 oleaut32 shlwapi comctl32 sfc_os)
 add_importlibs(acppage shell32 user32 advapi32 msvcrt kernel32)
 add_pch(acppage precomp.h SOURCE)
index 5ceac56..b0ddec8 100644 (file)
@@ -1,15 +1,9 @@
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
 remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502)
 add_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601)
 
-
 spec2def(fontext.dll fontext.spec)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     CDataObject.cpp
     CEnumFonts.cpp
@@ -31,7 +25,7 @@ add_library(fontext MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/fontext.def)
 
 set_module_type(fontext win32dll UNICODE)
-target_link_libraries(fontext uuid wine cpprt)
+target_link_libraries(fontext uuid wine cpprt atl_classes)
 add_delay_importlibs(fontext ole32 oleaut32 shlwapi gdi32)
 add_importlibs(fontext shell32 advapi32 user32 msvcrt kernel32 ntdll)
 add_pch(fontext precomp.h SOURCE)
index 4abbd64..b74998e 100644 (file)
@@ -1,18 +1,13 @@
 spec2def(mydocs.dll mydocs.spec)
 
 add_definitions(
-    -D_WINE
-    -D_ATL_NO_EXCEPTIONS)
+    -D_WINE)
 
 if(NOT MSVC)
     # HACK: this should be enabled globally!
     add_compile_flags_language("-std=c++11" "CXX")
 endif()
 
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR})
-
 file(GLOB_RECURSE mydocs_rc_deps res/*.*)
 add_rc_deps(mydocs.rc ${mydocs_rc_deps})
 
@@ -27,7 +22,7 @@ add_library(mydocs MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/mydocs.def)
 
 set_module_type(mydocs win32dll UNICODE)
-target_link_libraries(mydocs uuid wine cpprt)
+target_link_libraries(mydocs uuid wine cpprt atl_classes)
 add_delay_importlibs(mydocs ole32 oleaut32)
 add_importlibs(mydocs advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll)
 add_pch(mydocs precomp.hpp SOURCE)
index 4302187..48ce800 100644 (file)
@@ -10,11 +10,6 @@ endif()
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 add_definitions(-D_NETSHELL_)
 spec2def(netshell.dll netshell.spec)
 
@@ -40,7 +35,7 @@ add_library(netshell MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/netshell.def)
 
 set_module_type(netshell win32dll UNICODE)
-target_link_libraries(netshell uuid wine cpprt)
+target_link_libraries(netshell uuid wine cpprt atl_classes)
 add_delay_importlibs(netshell ole32 oleaut32 shlwapi shell32)
 add_importlibs(netshell version iphlpapi gdi32 user32 advapi32 setupapi ws2_32 comctl32 msvcrt kernel32 ntdll)
 add_pch(netshell precomp.h "${PCH_SKIP_SOURCE}")
index 91132a4..3ecdae1 100644 (file)
@@ -1,19 +1,11 @@
 
 project(SHELL)
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-
 if(NOT MSVC)
     # HACK: this should be enabled globally!
     add_compile_flags_language("-std=c++11" "CXX")
 endif()
 
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR})
-
 spec2def(ntobjshex.dll ntobjshex.spec)
 
 file(GLOB_RECURSE ntobjshex_rc_deps resources/*.*)
@@ -32,7 +24,7 @@ add_library(ntobjshex MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/ntobjshex.def)
 
 set_module_type(ntobjshex win32dll UNICODE)
-target_link_libraries(ntobjshex uuid wine cpprt)
+target_link_libraries(ntobjshex uuid wine cpprt atl_classes)
 
 add_importlibs(ntobjshex
     advapi32
index 52d0a39..5adbf3a 100644 (file)
@@ -1,18 +1,13 @@
 spec2def(sendmail.dll sendmail.spec)
 
 add_definitions(
-    -D_WINE
-    -D_ATL_NO_EXCEPTIONS)
+    -D_WINE)
 
 if(NOT MSVC)
     # HACK: this should be enabled globally!
     add_compile_flags_language("-std=c++11" "CXX")
 endif()
 
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR})
-
 file(GLOB_RECURSE sendmail_rc_deps res/*.*)
 add_rc_deps(sendmail.rc ${sendmail_rc_deps})
 
@@ -27,7 +22,7 @@ add_library(sendmail MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/sendmail.def)
 
 set_module_type(sendmail win32dll UNICODE)
-target_link_libraries(sendmail uuid wine cpprt)
+target_link_libraries(sendmail uuid wine cpprt atl_classes)
 add_delay_importlibs(sendmail ole32 oleaut32)
 add_importlibs(sendmail advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll)
 add_pch(sendmail precomp.hpp SOURCE)
index 15d9206..f5c67cc 100644 (file)
@@ -6,13 +6,6 @@ if(NOT MSVC)
     add_compile_flags_language("-std=c++11" "CXX")
 endif()
 
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR})
-
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
 spec2def(stobject.dll stobject.spec)
 
 file(GLOB_RECURSE stobject_rc_deps resources/*.*)
@@ -32,7 +25,7 @@ add_library(stobject MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/stobject.def)
 
 set_module_type(stobject win32dll UNICODE)
-target_link_libraries(stobject uuid wine cpprt)
+target_link_libraries(stobject uuid wine cpprt atl_classes)
 
 add_importlibs(stobject
     setupapi
index 4459b9d..106a886 100644 (file)
@@ -7,12 +7,8 @@ endif()
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
 include_directories(
     ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/zlib/contrib)
 
 spec2def(zipfldr.dll zipfldr.spec ADD_IMPORTLIB)
@@ -46,7 +42,7 @@ add_library(zipfldr MODULE
 
 
 set_module_type(zipfldr win32dll UNICODE)
-target_link_libraries(zipfldr minizip zlib uuid cpprt)
+target_link_libraries(zipfldr minizip zlib uuid cpprt atl_classes)
 set_target_cpp_properties(zipfldr WITH_EXCEPTIONS)
 add_importlibs(zipfldr oleaut32 ole32 shlwapi comctl32 shell32 user32 advapi32 msvcrt kernel32 ntdll)
 add_pch(zipfldr precomp.h SOURCE)
index 1aa48b8..8cb68cf 100644 (file)
@@ -3,10 +3,6 @@ PROJECT(SHELL)
 add_subdirectory(shellbars)
 add_subdirectory(shellfind)
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 spec2def(browseui.dll browseui.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
@@ -47,7 +43,7 @@ add_library(browseui MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/browseui.def)
 
 set_module_type(browseui win32dll UNICODE)
-target_link_libraries(browseui shellbars shellfind uuid wine cpprt)
+target_link_libraries(browseui shellbars shellfind uuid wine cpprt atl_classes)
 add_importlibs(browseui uxtheme shlwapi shell32 comctl32 gdi32 ole32 oleaut32 user32 advapi32 mpr msvcrt kernel32 ntdll)
 add_pch(browseui precomp.h "${PCH_SKIP_SOURCE}")
 add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all)
index 221de17..360c785 100644 (file)
@@ -2,9 +2,6 @@
 PROJECT(SHELL)
 
 add_definitions(-DUNICODE -D_UNICODE)
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 
 list(APPEND SOURCE
     CBandSite.cpp
@@ -14,7 +11,8 @@ list(APPEND SOURCE
     CSHEnumClassesOfCategories.cpp
     shellbars.h)
 
-add_library(shellbars ${SOURCE})
+add_library(shellbars OBJECT ${SOURCE})
+target_link_libraries(shellbars PRIVATE atl_classes)
 
 if(NOT MSVC)
     target_compile_options(shellbars PRIVATE "-Wno-unused-but-set-variable")
index 5900ed9..72f1542 100644 (file)
@@ -2,16 +2,14 @@
 PROJECT(SHELL)
 
 add_definitions(-DUNICODE -D_UNICODE)
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 
 list(APPEND SOURCE
     CSearchBar.cpp
     CFindFolder.cpp
     shellfind.h)
 
-add_library(shellfind ${SOURCE})
+add_library(shellfind OBJECT ${SOURCE})
+target_link_libraries(shellfind PRIVATE atl_classes)
 
 if(NOT MSVC)
     target_compile_options(shellfind PRIVATE "-Wno-unused-but-set-variable")
index f805b3f..e86615f 100644 (file)
@@ -9,7 +9,6 @@ endif()
 
 include_directories(
     ${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     includes)
 
 list(APPEND SOURCE
@@ -33,7 +32,7 @@ add_library(devmgr MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/devmgr.def)
 
 set_module_type(devmgr win32dll UNICODE)
-target_link_libraries(devmgr uuid wine cpprt)
+target_link_libraries(devmgr uuid wine cpprt atl_classes)
 set_target_cpp_properties(devmgr WITH_EXCEPTIONS WITH_RTTI)
 add_importlibs(devmgr setupapi advapi32 shell32 newdev user32 gdi32 comctl32 version msvcrt kernel32 ole32 oleaut32 uxtheme ntdll)
 add_pch(devmgr precomp.h SOURCE)
index 056b602..cbea4ed 100644 (file)
@@ -1,12 +1,4 @@
 
-
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine)
-
 spec2def(msgina.dll msgina.spec)
 
 list(APPEND SOURCE
@@ -28,7 +20,7 @@ add_library(msgina MODULE
     ${CMAKE_CURRENT_BINARY_DIR}/msgina.def)
 
 set_module_type(msgina win32dll UNICODE)
-target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt)
+target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt atl_classes)
 add_delay_importlibs(msgina secur32)
 add_importlibs(msgina advapi32 user32 gdi32 powrprof userenv msvcrt kernel32 ntdll)
 add_pch(msgina msgina.h "${PCH_SKIP_SOURCE}")
index a76c13a..88a11e0 100644 (file)
@@ -21,12 +21,7 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 add_definitions(
     -D_SHELL32_
-    -D_WINE
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
-    ${REACTOS_SOURCE_DIR})
+    -D_WINE)
 
 list(APPEND SOURCE
     CActiveDesktop.cpp
@@ -121,7 +116,7 @@ add_typelib(shell32_shldisp.idl)
 set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb)
 
 set_module_type(shell32 win32dll UNICODE)
-target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt)
+target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt atl_classes)
 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
index 7da3e7b..53fe4c4 100644 (file)
@@ -2,10 +2,8 @@ project(SHELL)
 
 add_definitions(
     -DUNICODE
-    -D_UNICODE
-    -D_ATL_NO_EXCEPTIONS)
+    -D_UNICODE)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 
 list(APPEND SOURCE
     CChangeNotifyServer.cpp
@@ -14,5 +12,6 @@ list(APPEND SOURCE
     CDirectoryList.cpp
     dde.cpp)
 
-add_library(shelldesktop ${SOURCE})
+add_library(shelldesktop OBJECT ${SOURCE})
+target_link_libraries(shelldesktop PRIVATE atl_classes)
 add_dependencies(shelldesktop xdk psdk)
index 94c04fc..01b813a 100644 (file)
@@ -2,10 +2,7 @@ project(SHELL)
 
 add_definitions(
     -DUNICODE
-    -D_UNICODE
-    -D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
+    -D_UNICODE)
 
 list(APPEND SOURCE
     CMenuBand.cpp
@@ -16,5 +13,6 @@ list(APPEND SOURCE
     CMergedFolder.cpp
     CStartMenu.cpp)
 
-add_library(shellmenu ${SOURCE})
+add_library(shellmenu OBJECT ${SOURCE})
+target_link_libraries(shellmenu PRIVATE atl_classes)
 add_dependencies(shellmenu xdk psdk)
index 5607bdb..627d4ae 100644 (file)
@@ -2,8 +2,7 @@ project(SHELL)
 
 add_definitions(
     -DUNICODE
-    -D_UNICODE
-    -D_ATL_NO_EXCEPTIONS)
+    -D_UNICODE)
 
 list(APPEND SOURCE
     recyclebin.c
index 0e166a3..076aaa4 100644 (file)
@@ -6,12 +6,8 @@ add_definitions(-D_WIN32_WINNT=0x600)
 
 add_definitions(
     -D__WINESRC__
-    -D_SHLWAPI_
-    -D_ATL_NO_EXCEPTIONS)
+    -D_SHLWAPI_)
 
-include_directories(BEFORE
-    ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
 spec2def(shlwapi.dll shlwapi.spec ADD_IMPORTLIB)
 
 list(APPEND SOURCE
@@ -41,8 +37,11 @@ add_library(shlwapi MODULE
     shlwapi.rc
     ${CMAKE_CURRENT_BINARY_DIR}/shlwapi.def)
 
+# our C++ atlbase.h conflicts with the one from wine, so only use wine includes for C
+target_include_directories(shlwapi BEFORE PRIVATE $<$<COMPILE_LANGUAGE:C>:${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine>)
+
 set_module_type(shlwapi win32dll UNICODE)
-target_link_libraries(shlwapi uuid wine)
+target_link_libraries(shlwapi uuid wine cpprt atl_classes)
 add_delay_importlibs(shlwapi userenv oleaut32 ole32 comdlg32 mpr mlang urlmon shell32 winmm version)
 add_importlibs(shlwapi user32 gdi32 advapi32 wininet msvcrt kernel32 ntdll)
 add_pch(shlwapi precomp.h "${PCH_SKIP_SOURCE}")
index 2f6541b..41686b7 100644 (file)
@@ -1,11 +1,7 @@
 
-add_definitions(-D_ATL_NO_EXCEPTIONS)
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 add_executable(shlextdbg shlextdbg.cpp shlextdbg.rc)
 
 set_module_type(shlextdbg win32cui UNICODE)
-target_link_libraries(shlextdbg uuid cpprt)
+target_link_libraries(shlextdbg uuid cpprt atl_classes)
 add_importlibs(shlextdbg ole32 comctl32 shell32 user32 msvcrt kernel32)
 add_cd_file(TARGET shlextdbg DESTINATION reactos/system32 FOR all)
index 6bf9ddc..11f81ad 100644 (file)
@@ -4,12 +4,7 @@ add_definitions(
     -D__ROS_LONG64__
     -DWINETEST_USE_DBGSTR_LONGLONG
     -DUNICODE
-    -D_UNICODE
-    -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl
-                    ${CMAKE_CURRENT_BINARY_DIR})
+    -D_UNICODE)
 
 list(APPEND SOURCE
     apphelp.c
@@ -29,6 +24,6 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb
 add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb)
 add_executable(apphelp_apitest ${SOURCE})
 set_module_type(apphelp_apitest win32cui)
-target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt)
+target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt atl_classes)
 add_importlibs(apphelp_apitest advapi32 userenv version shlwapi msvcrt kernel32 ntdll)
 add_rostests_file(TARGET apphelp_apitest)
index 11ca2fd..555529b 100644 (file)
@@ -1,8 +1,6 @@
 
 add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     atltypes.cpp
     CAtlFileMapping.cpp
@@ -28,7 +26,7 @@ add_executable(atl_apitest
     ${PCH_SKIP_SOURCE}
     atl_apitest.rc)
 
-target_link_libraries(atl_apitest wine uuid cpprt)
+target_link_libraries(atl_apitest wine uuid cpprt atl_classes)
 set_target_cpp_properties(atl_apitest WITH_EXCEPTIONS)
 set_module_type(atl_apitest win32cui)
 add_importlibs(atl_apitest rpcrt4 ole32 oleaut32 msimg32 gdi32 advapi32 user32 msvcrt kernel32 ntdll)
index 2ae9cc3..f1875d3 100644 (file)
@@ -5,7 +5,6 @@ if(NOT MSVC)
 endif()
 
 include_directories(
-    ${REACTOS_SOURCE_DIR}/sdk/lib/atl
     includes)
 
 list(APPEND SOURCE
@@ -16,8 +15,7 @@ list(APPEND SOURCE
     testlist.c)
 
 add_executable(browseui_apitest ${SOURCE})
-target_link_libraries(browseui_apitest uuid wine cpprt)
-
+target_link_libraries(browseui_apitest uuid wine cpprt atl_classes)
 set_target_cpp_properties(browseui_apitest WITH_EXCEPTIONS WITH_RTTI)
 set_module_type(browseui_apitest win32cui)
 add_importlibs(browseui_apitest advapi32 shell32 ole32 shlwapi msvcrt kernel32 ntdll)
index aca32f4..0cb5e6a 100644 (file)
@@ -3,12 +3,7 @@ add_definitions(
     -D__ROS_LONG64__
     -DWINETEST_USE_DBGSTR_LONGLONG
     -DUNICODE
-    -D_UNICODE
-    -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl
-                    ${CMAKE_CURRENT_BINARY_DIR})
+    -D_UNICODE)
 
 list(APPEND SOURCE
     shellext.cpp
@@ -16,6 +11,6 @@ list(APPEND SOURCE
 
 add_executable(fontext_apitest ${SOURCE})
 set_module_type(fontext_apitest win32cui)
-target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt)
+target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt atl_classes)
 add_importlibs(fontext_apitest oleaut32 ole32 shell32 user32 msvcrt kernel32 ntdll)
 add_rostests_file(TARGET fontext_apitest)
index 9b87377..a799fa5 100644 (file)
@@ -1,15 +1,9 @@
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
-
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 add_executable(msgina_apitest
     ShellDimScreen.cpp
     testlist.c)
 
-target_link_libraries(msgina_apitest wine uuid cpprt)
+target_link_libraries(msgina_apitest wine uuid cpprt atl_classes)
 set_module_type(msgina_apitest win32cui)
 add_importlibs(msgina_apitest msvcrt user32 kernel32)
 add_rostests_file(TARGET msgina_apitest)
index 39c81e5..81b4076 100644 (file)
@@ -1,11 +1,6 @@
 
-add_definitions(
-    -D_ATL_NO_EXCEPTIONS)
-
 spec2def(shell32_apitest.exe shell32_apitest.spec)
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     AddCommas.cpp
     CFSFolder.cpp
@@ -44,7 +39,7 @@ add_executable(shell32_apitest
     resource.rc
     ${CMAKE_CURRENT_BINARY_DIR}/shell32_apitest.def)
 
-target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt)
+target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt atl_classes)
 set_module_type(shell32_apitest win32cui)
 add_importlibs(shell32_apitest user32 gdi32 shell32 ole32 oleaut32 advapi32 shlwapi msvcrt kernel32 ntdll)
 add_pch(shell32_apitest shelltest.h "${PCH_SKIP_SOURCE}")
@@ -52,7 +47,7 @@ add_rostests_file(TARGET shell32_apitest)
 
 # shell-notify.exe
 add_executable(shell-notify shell-notify.cpp)
-target_link_libraries(shell-notify cpprt)
+target_link_libraries(shell-notify cpprt atl_classes)
 set_module_type(shell-notify win32gui UNICODE)
 add_importlibs(shell-notify msvcrt kernel32 user32 shell32 shlwapi ole32)
 add_rostests_file(TARGET shell-notify SUBDIR testdata)
index 9bda3bd..89e4608 100644 (file)
@@ -1,6 +1,4 @@
 
-include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-
 list(APPEND SOURCE
     EnumObjects.cpp
     EnumParentDir.cpp
@@ -14,7 +12,7 @@ add_executable(zipfldr_apitest
     ${PCH_SKIP_SOURCE}
     zipfldr_apitest.rc)
 
-target_link_libraries(zipfldr_apitest wine uuid cpprt)
+target_link_libraries(zipfldr_apitest wine uuid cpprt atl_classes)
 set_target_cpp_properties(zipfldr_apitest WITH_EXCEPTIONS)
 set_module_type(zipfldr_apitest win32cui)
 add_importlibs(zipfldr_apitest shlwapi ole32 shell32 user32 msvcrt kernel32 ntdll)
index 60b2844..0e75364 100644 (file)
@@ -1,4 +1,5 @@
 
+add_subdirectory(atl)
 add_subdirectory(cmlib)
 add_subdirectory(inflib)
 
diff --git a/sdk/lib/atl/CMakeLists.txt b/sdk/lib/atl/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6923a49
--- /dev/null
@@ -0,0 +1,8 @@
+
+add_library(atl_classes INTERFACE)
+
+target_include_directories(atl_classes INTERFACE
+    $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}>)
+
+target_compile_definitions(atl_classes INTERFACE
+    "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>>>:_ATL_NO_EXCEPTIONS>")