Reactos

[CMAKE] Get rid of the set_cpp macro

Instead of messing with global variables and the like, we introduce two target properties:
- WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
- WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
- cpprt: for C++ runtime routines
- cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module

authored by

Jérôme Gardou and committed by
Jérôme Gardou
d6ea8659 980ce773

+193 -259
+14
CMakeLists.txt
··· 111 111 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) 112 112 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) 113 113 114 + # Add our own target properties 115 + # C++ 116 + define_property(TARGET PROPERTY WITH_CXX_EXCEPTIONS 117 + BRIEF_DOCS "Enable C++ exceptions on this target" 118 + FULL_DOCS [[ 119 + Enables C++ exception handling. 120 + Enable this if the module uses try/catch or throw. You might also need this if you use a standard operator new (the one without nothrow).]]) 121 + define_property(TARGET PROPERTY WITH_CXX_RTTI 122 + BRIEF_DOCS "Enable C++ RTTI on this target" 123 + FULL_DOCS [[ 124 + Enables run-time type information. 125 + Enable this if the module uses typeid or dynamic_cast. You will probably need to link yith cpprt as well, if you are not already using STL.]]) 126 + 127 + 114 128 if(DBG) 115 129 add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE) 116 130 else()
-1
base/applications/atactl/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 add_definitions(-DUSER_MODE) 4 3 include_directories(${REACTOS_SOURCE_DIR}/drivers/storage/ide/uniata) 5 4 add_executable(atactl atactl.cpp atactl.rc)
+3 -4
base/applications/charmap_new/CMakeLists.txt
··· 1 1 PROJECT(CHARMAP) 2 2 3 - set_cpp(WITH_RTTI WITH_RUNTIME WITH_EXCEPTIONS) 4 - 5 3 if(NOT MSVC) 6 4 # HACK: this should be enabled globally! 7 5 add_compile_flags_language("-std=c++11" "CXX") 8 6 endif() 9 7 10 8 include_directories( 11 - ${REACTOS_SOURCE_DIR}/sdk/lib/atl 9 + ${REACTOS_SOURCE_DIR}/sdk/lib/atl 12 10 includes) 13 11 14 12 list(APPEND SOURCE ··· 21 19 charmap.rc) 22 20 23 21 set_module_type(charmap win32gui UNICODE) 24 - target_link_libraries(charmap uuid wine) 22 + target_link_libraries(charmap uuid wine cpprt) 23 + set_target_cpp_properties(charmap WITH_EXCEPTIONS WITH_RTTI) 25 24 add_importlibs(charmap advapi32 user32 gdi32 comctl32 version msvcrt kernel32 ole32 uxtheme ntdll) 26 25 add_pch(charmap precomp.h SOURCE) 27 26 add_cd_file(TARGET charmap DESTINATION reactos/system32 FOR all)
+2 -2
base/applications/drwtsn32/CMakeLists.txt
··· 1 1 2 2 PROJECT(drwtsn32) 3 3 4 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) 5 4 include_directories( 6 5 ${REACTOS_SOURCE_DIR}/sdk/lib/atl 7 6 ${REACTOS_SOURCE_DIR}/sdk/lib/udmihelp) ··· 17 16 add_executable(drwtsn32 ${CPP_SOURCE} drwtsn32.rc) 18 17 add_pch(drwtsn32 precomp.h CPP_SOURCE) 19 18 set_module_type(drwtsn32 win32gui UNICODE) 20 - target_link_libraries(drwtsn32 udmihelp) 19 + target_link_libraries(drwtsn32 udmihelp cppstl) 20 + set_target_cpp_properties(drwtsn32 WITH_EXCEPTIONS) 21 21 add_importlibs(drwtsn32 dbghelp psapi advapi32 shell32 shlwapi msvcrt user32 kernel32 ntdll) 22 22 add_cd_file(TARGET drwtsn32 DESTINATION reactos/system32 FOR all)
+2 -2
base/applications/fltmc/CMakeLists.txt
··· 2 2 remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) 3 3 add_definitions(-D_WIN32_WINNT=0x601) 4 4 5 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 6 - 7 5 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 8 6 9 7 add_executable(fltmc fltmc.cpp fltmc.rc) 8 + target_link_libraries(fltmc cpprt) 9 + set_target_cpp_properties(fltmc WITH_EXCEPTIONS) 10 10 set_module_type(fltmc win32cui UNICODE) 11 11 add_importlibs(fltmc fltlib msvcrt kernel32 advapi32) 12 12 add_cd_file(TARGET fltmc DESTINATION reactos/system32 FOR all)
-3
base/applications/games/solitaire/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME) 3 - include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/cardlib) 4 1 5 2 list(APPEND SOURCE 6 3 solcreate.cpp
+1 -6
base/applications/games/spider/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME) 3 - 4 - include_directories( 5 - ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/cardlib 6 - ${CMAKE_CURRENT_SOURCE_DIR}) 7 1 8 2 list(APPEND SOURCE 9 3 spider.cpp ··· 13 7 add_rc_deps(rsrc.rc ${CMAKE_CURRENT_SOURCE_DIR}/spider.ico) 14 8 add_executable(spider ${SOURCE} rsrc.rc) 15 9 target_link_libraries(spider cardlib) 10 + target_include_directories(spider PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) 16 11 add_pch(spider spider.h SOURCE) 17 12 set_module_type(spider win32gui UNICODE) 18 13 add_importlibs(spider advapi32 comctl32 user32 gdi32 msvcrt kernel32)
+2 -3
base/applications/msconfig_new/CMakeLists.txt
··· 1 1 2 2 PROJECT(msconfig_new) 3 3 4 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 5 - 6 4 include_directories( 7 5 . 8 6 comctl32ex ··· 35 33 add_executable(msconfig_new ${C_SOURCE} ${CPP_SOURCE} msconfig.rc) 36 34 add_pch(msconfig_new precomp.h CPP_SOURCE) 37 35 set_module_type(msconfig_new win32gui UNICODE) 38 - target_link_libraries(msconfig_new comsupp) 36 + target_link_libraries(msconfig_new comsupp cpprt) 37 + set_target_cpp_properties(msconfig_new WITH_EXCEPTIONS) 39 38 add_importlibs(msconfig_new user32 gdi32 comctl32 comdlg32 advapi32 version ole32 oleaut32 msxml3 shell32 shlwapi msvcrt kernel32) 40 39 add_cd_file(TARGET msconfig_new DESTINATION reactos/system32 FOR all)
+2 -2
base/applications/mspaint/CMakeLists.txt
··· 1 1 project(MSPAINT) 2 2 3 3 add_definitions(-DINITGUID) 4 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 5 4 6 5 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 7 6 ··· 33 32 add_rc_deps(rsrc.rc ${mspaint_rc_deps}) 34 33 add_executable(mspaint ${SOURCE} rsrc.rc) 35 34 set_module_type(mspaint win32gui UNICODE) 36 - target_link_libraries(mspaint uuid) 35 + target_link_libraries(mspaint uuid cpprt) 36 + set_target_cpp_properties(mspaint WITH_EXCEPTIONS) 37 37 add_importlibs(mspaint hhctrl comdlg32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 rpcrt4 shlwapi) 38 38 add_pch(mspaint precomp.h SOURCE) 39 39 add_cd_file(TARGET mspaint DESTINATION reactos/system32 FOR all)
+2 -2
base/applications/network/telnet/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_EXCEPTIONS WITH_STL) 3 1 4 2 add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) 5 3 ··· 34 32 endif() 35 33 36 34 add_executable(telnet ${SOURCE} telnet.rc) 35 + target_link_libraries(telnet cppstl) 36 + set_target_cpp_properties(telnet WITH_EXCEPTIONS) 37 37 set_module_type(telnet win32cui) 38 38 add_importlibs(telnet ws2_32 user32 msvcrt kernel32 ntdll) 39 39 add_pch(telnet precomp.h SOURCE)
+1 -3
base/applications/rapps/CMakeLists.txt
··· 1 1 project(rapps) 2 2 3 - set_cpp(WITH_RUNTIME) 4 - 5 3 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 6 4 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib) 7 5 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) ··· 46 44 add_rc_deps(rapps.rc ${rapps_rc_deps}) 47 45 add_executable(rapps ${SOURCE} rapps.rc) 48 46 set_module_type(rapps win32cui UNICODE) 49 - target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine) 47 + target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt) 50 48 add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi gdiplus msvcrt kernel32 ntdll) 51 49 add_pch(rapps include/rapps.h SOURCE) 52 50 add_dependencies(rapps rappsmsg)
+1 -2
base/applications/sndrec32/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME) 3 1 4 2 list(APPEND SOURCE 5 3 audio_format.cpp ··· 15 13 file(GLOB sndrec32_rc_deps resources/*.*) 16 14 add_rc_deps(rsrc.rc ${sndrec32_rc_deps}) 17 15 add_executable(sndrec32 ${SOURCE} rsrc.rc) 16 + target_link_libraries(sndrec32 cpprt) 18 17 set_module_type(sndrec32 win32gui UNICODE) 19 18 add_importlibs(sndrec32 winmm user32 msacm32 comctl32 comdlg32 gdi32 shell32 msvcrt kernel32) 20 19 add_pch(sndrec32 stdafx.h SOURCE)
+1 -2
base/shell/explorer/CMakeLists.txt
··· 1 1 PROJECT(SHELL) 2 2 3 - set_cpp(WITH_RUNTIME) 4 3 add_definitions(-D_ATL_NO_EXCEPTIONS) 5 4 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 6 5 ··· 31 30 file(GLOB explorer_rc_deps res/*.*) 32 31 add_rc_deps(explorer.rc ${explorer_rc_deps}) 33 32 add_executable(explorer ${SOURCE} explorer.rc) 34 - target_link_libraries(explorer uuid wine) 33 + target_link_libraries(explorer uuid wine cpprt) 35 34 set_module_type(explorer win32gui UNICODE) 36 35 add_importlibs(explorer advapi32 gdi32 user32 comctl32 ole32 oleaut32 shell32 browseui shlwapi shdocvw version uxtheme msvcrt kernel32 ntdll) 37 36 add_pch(explorer precomp.h SOURCE)
+8 -9
base/shell/rshell/CMakeLists.txt
··· 3 3 add_definitions( 4 4 -D_ATL_NO_EXCEPTIONS) 5 5 6 - set_cpp(WITH_RUNTIME) 7 - 8 6 include_directories( 9 7 ${REACTOS_SOURCE_DIR}/sdk/lib/atl) 10 8 ··· 24 22 shellmenu 25 23 shelldesktop 26 24 uuid 27 - wine) 25 + wine 26 + cpprt) 28 27 29 28 add_importlibs(rshell 30 29 browseui ··· 40 39 kernel32 41 40 ntdll) 42 41 43 - add_custom_command(TARGET rshell POST_BUILD 44 - COMMAND "${CMAKE_COMMAND}" -E copy 42 + add_custom_command(TARGET rshell POST_BUILD 43 + COMMAND "${CMAKE_COMMAND}" -E copy 45 44 "$<TARGET_FILE:rshell>" 46 - "$<TARGET_FILE_DIR:explorer>/$<TARGET_FILE_NAME:rshell>" 45 + "$<TARGET_FILE_DIR:explorer>/$<TARGET_FILE_NAME:rshell>" 47 46 COMMENT "Copying to output directory") 48 47 49 - add_custom_command(TARGET rshell POST_BUILD 50 - COMMAND "${CMAKE_COMMAND}" -E copy 48 + add_custom_command(TARGET rshell POST_BUILD 49 + COMMAND "${CMAKE_COMMAND}" -E copy 51 50 "$<TARGET_FILE:rshell>" 52 - "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>" 51 + "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>" 53 52 COMMENT "Copying to output directory")
+1 -2
dll/directx/ksproxy/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_STL) 3 2 spec2def(ksproxy.ax ksproxy.spec) 4 3 5 4 list(APPEND SOURCE ··· 25 24 add_library(ksproxy MODULE ${SOURCE} ksproxy.rc) 26 25 set_module_type(ksproxy win32dll) 27 26 set_target_properties(ksproxy PROPERTIES SUFFIX ".ax") 28 - target_link_libraries(ksproxy strmiids) 27 + target_link_libraries(ksproxy strmiids cppstl) 29 28 add_importlibs(ksproxy advapi32 ole32 setupapi ksuser msvcrt kernel32 ntdll) 30 29 add_dependencies(ksproxy dxsdk) 31 30 add_cd_file(TARGET ksproxy DESTINATION reactos/system32 FOR all)
+1 -2
dll/opengl/glu32/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME) 3 1 4 2 include_directories(BEFORE 5 3 include ··· 118 116 ${PCH_SKIP_SOURCE} 119 117 glu32.rc 120 118 ${CMAKE_CURRENT_BINARY_DIR}/glu32.def) 119 + target_link_libraries(glu32 cpprt) 121 120 122 121 set_module_type(glu32 win32dll) 123 122
+1 -2
dll/shellext/acppage/CMakeLists.txt
··· 1 1 2 2 project(appcompat) 3 3 4 - set_cpp(WITH_RUNTIME) 5 4 if(NOT MSVC) 6 5 # HACK: this should be enabled globally! 7 6 add_compile_flags_language("-std=c++11" "CXX") ··· 32 31 ${CMAKE_CURRENT_BINARY_DIR}/acppage.def) 33 32 34 33 set_module_type(acppage win32dll UNICODE) 35 - target_link_libraries(acppage wine uuid) 34 + target_link_libraries(acppage wine uuid cpprt) 36 35 add_delay_importlibs(acppage apphelp ole32 oleaut32 shlwapi comctl32 sfc_os) 37 36 add_importlibs(acppage shell32 user32 advapi32 msvcrt kernel32) 38 37 add_pch(acppage precomp.h SOURCE)
+1 -2
dll/shellext/fontext/CMakeLists.txt
··· 5 5 remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) 6 6 add_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601) 7 7 8 - set_cpp(WITH_RUNTIME) 9 8 10 9 spec2def(fontext.dll fontext.spec) 11 10 ··· 32 31 ${CMAKE_CURRENT_BINARY_DIR}/fontext.def) 33 32 34 33 set_module_type(fontext win32dll UNICODE) 35 - target_link_libraries(fontext uuid wine) 34 + target_link_libraries(fontext uuid wine cpprt) 36 35 add_delay_importlibs(fontext ole32 oleaut32 shlwapi gdi32) 37 36 add_importlibs(fontext shell32 advapi32 user32 msvcrt kernel32 ntdll) 38 37 add_pch(fontext precomp.h SOURCE)
+1 -2
dll/shellext/mydocs/CMakeLists.txt
··· 1 - set_cpp(WITH_RUNTIME) 2 1 spec2def(mydocs.dll mydocs.spec) 3 2 4 3 add_definitions( ··· 28 27 ${CMAKE_CURRENT_BINARY_DIR}/mydocs.def) 29 28 30 29 set_module_type(mydocs win32dll UNICODE) 31 - target_link_libraries(mydocs uuid wine) 30 + target_link_libraries(mydocs uuid wine cpprt) 32 31 add_delay_importlibs(mydocs ole32 oleaut32) 33 32 add_importlibs(mydocs advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll) 34 33 add_pch(mydocs precomp.hpp SOURCE)
+1 -2
dll/shellext/netshell/CMakeLists.txt
··· 1 1 2 2 project(SHELL) 3 3 4 - set_cpp(WITH_RUNTIME) 5 4 6 5 if(NOT MSVC) 7 6 # HACK: this should be enabled globally! ··· 41 40 ${CMAKE_CURRENT_BINARY_DIR}/netshell.def) 42 41 43 42 set_module_type(netshell win32dll UNICODE) 44 - target_link_libraries(netshell uuid wine) 43 + target_link_libraries(netshell uuid wine cpprt) 45 44 add_delay_importlibs(netshell ole32 oleaut32 shlwapi shell32) 46 45 add_importlibs(netshell version iphlpapi gdi32 user32 advapi32 setupapi ws2_32 comctl32 msvcrt kernel32 ntdll) 47 46 add_pch(netshell precomp.h "${PCH_SKIP_SOURCE}")
+1 -2
dll/shellext/ntobjshex/CMakeLists.txt
··· 4 4 add_definitions( 5 5 -D_ATL_NO_EXCEPTIONS) 6 6 7 - set_cpp(WITH_RUNTIME) 8 7 9 8 if(NOT MSVC) 10 9 # HACK: this should be enabled globally! ··· 33 32 ${CMAKE_CURRENT_BINARY_DIR}/ntobjshex.def) 34 33 35 34 set_module_type(ntobjshex win32dll UNICODE) 36 - target_link_libraries(ntobjshex uuid wine) 35 + target_link_libraries(ntobjshex uuid wine cpprt) 37 36 38 37 add_importlibs(ntobjshex 39 38 advapi32
+1 -2
dll/shellext/sendmail/CMakeLists.txt
··· 1 - set_cpp(WITH_RUNTIME) 2 1 spec2def(sendmail.dll sendmail.spec) 3 2 4 3 add_definitions( ··· 28 27 ${CMAKE_CURRENT_BINARY_DIR}/sendmail.def) 29 28 30 29 set_module_type(sendmail win32dll UNICODE) 31 - target_link_libraries(sendmail uuid wine) 30 + target_link_libraries(sendmail uuid wine cpprt) 32 31 add_delay_importlibs(sendmail ole32 oleaut32) 33 32 add_importlibs(sendmail advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll) 34 33 add_pch(sendmail precomp.hpp SOURCE)
+2 -2
dll/shellext/shellbtrfs/CMakeLists.txt
··· 1 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) 2 1 3 2 remove_definitions(-D_WIN32_WINNT=0x502) 4 3 add_definitions(-D_WIN32_WINNT=0x603) ··· 39 38 add_rc_deps(shellbtrfs.rc ${shellbtrfs_rc_deps}) 40 39 41 40 set_module_type(shellbtrfs win32dll UNICODE) 42 - target_link_libraries(shellbtrfs uuid) 41 + target_link_libraries(shellbtrfs uuid cppstl) 42 + set_target_cpp_properties(shellbtrfs WITH_EXCEPTIONS) 43 43 add_importlibs(shellbtrfs advapi32 advapi32_vista ole32 shell32 shlwapi user32 comctl32 uxtheme setupapi comdlg32 gdi32 msvcrt kernel32_vista kernel32 ntdll) 44 44 add_pch(shellbtrfs precomp.h "${PCH_SKIP_SOURCE}") 45 45 add_cd_file(TARGET shellbtrfs DESTINATION reactos/system32 FOR all)
+1 -3
dll/shellext/stobject/CMakeLists.txt
··· 1 1 2 2 project(SHELL) 3 3 4 - set_cpp(WITH_RUNTIME) 5 - 6 4 if(NOT MSVC) 7 5 # HACK: this should be enabled globally! 8 6 add_compile_flags_language("-std=c++11" "CXX") ··· 34 32 ${CMAKE_CURRENT_BINARY_DIR}/stobject.def) 35 33 36 34 set_module_type(stobject win32dll UNICODE) 37 - target_link_libraries(stobject uuid wine) 35 + target_link_libraries(stobject uuid wine cpprt) 38 36 39 37 add_importlibs(stobject 40 38 setupapi
+2 -2
dll/shellext/zipfldr/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 3 2 if(NOT MSVC) 4 3 # HACK: this should be enabled globally! 5 4 add_compile_flags_language("-std=c++11" "CXX") ··· 47 46 48 47 49 48 set_module_type(zipfldr win32dll UNICODE) 50 - target_link_libraries(zipfldr minizip zlib uuid) 49 + target_link_libraries(zipfldr minizip zlib uuid cpprt) 50 + set_target_cpp_properties(zipfldr WITH_EXCEPTIONS) 51 51 add_importlibs(zipfldr oleaut32 ole32 shlwapi comctl32 shell32 user32 advapi32 msvcrt kernel32 ntdll) 52 52 add_pch(zipfldr precomp.h SOURCE) 53 53 add_cd_file(TARGET zipfldr DESTINATION reactos/system32 FOR all)
+4 -6
dll/win32/browseui/CMakeLists.txt
··· 3 3 add_subdirectory(shellbars) 4 4 add_subdirectory(shellfind) 5 5 6 - set_cpp(WITH_RUNTIME) 7 - 8 6 add_definitions( 9 7 -D_ATL_NO_EXCEPTIONS) 10 8 ··· 49 47 ${CMAKE_CURRENT_BINARY_DIR}/browseui.def) 50 48 51 49 set_module_type(browseui win32dll UNICODE) 52 - target_link_libraries(browseui shellbars shellfind uuid wine) 50 + target_link_libraries(browseui shellbars shellfind uuid wine cpprt) 53 51 add_importlibs(browseui uxtheme shlwapi shell32 comctl32 gdi32 ole32 oleaut32 user32 advapi32 mpr msvcrt kernel32 ntdll) 54 52 add_pch(browseui precomp.h "${PCH_SKIP_SOURCE}") 55 53 add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all) ··· 62 60 endif() 63 61 endif() 64 62 65 - add_custom_command(TARGET browseui POST_BUILD 66 - COMMAND "${CMAKE_COMMAND}" -E copy 63 + add_custom_command(TARGET browseui POST_BUILD 64 + COMMAND "${CMAKE_COMMAND}" -E copy 67 65 "$<TARGET_FILE:browseui>" 68 - "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>" 66 + "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>" 69 67 COMMENT "Copying to output directory")
-2
dll/win32/browseui/shellbars/CMakeLists.txt
··· 1 1 2 2 PROJECT(SHELL) 3 3 4 - set_cpp(WITH_RUNTIME) 5 - 6 4 add_definitions(-DUNICODE -D_UNICODE) 7 5 add_definitions(-D_ATL_NO_EXCEPTIONS) 8 6
-2
dll/win32/browseui/shellfind/CMakeLists.txt
··· 1 1 2 2 PROJECT(SHELL) 3 3 4 - set_cpp(WITH_RUNTIME) 5 - 6 4 add_definitions(-DUNICODE -D_UNICODE) 7 5 add_definitions(-D_ATL_NO_EXCEPTIONS) 8 6
+3 -4
dll/win32/devmgr/CMakeLists.txt
··· 2 2 3 3 spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB) 4 4 5 - set_cpp(WITH_RTTI WITH_RUNTIME WITH_EXCEPTIONS) 6 - 7 5 if(NOT MSVC) 8 6 # HACK: this should be enabled globally! 9 7 add_compile_flags_language("-std=c++11" "CXX") ··· 11 9 12 10 include_directories( 13 11 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll 14 - ${REACTOS_SOURCE_DIR}/sdk/lib/atl 12 + ${REACTOS_SOURCE_DIR}/sdk/lib/atl 15 13 includes) 16 14 17 15 list(APPEND SOURCE ··· 35 33 ${CMAKE_CURRENT_BINARY_DIR}/devmgr.def) 36 34 37 35 set_module_type(devmgr win32dll UNICODE) 38 - target_link_libraries(devmgr uuid wine) 36 + target_link_libraries(devmgr uuid wine cpprt) 37 + set_target_cpp_properties(devmgr WITH_EXCEPTIONS WITH_RTTI) 39 38 add_importlibs(devmgr setupapi advapi32 shell32 newdev user32 gdi32 comctl32 version msvcrt kernel32 ole32 oleaut32 uxtheme ntdll) 40 39 add_pch(devmgr precomp.h SOURCE) 41 40 add_cd_file(TARGET devmgr DESTINATION reactos/system32 FOR all)
+2 -1
dll/win32/framedyn/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 3 2 spec2def(framedyn.dll framedyn.spec ADD_IMPORTLIB) 4 3 5 4 list(APPEND SOURCE ··· 13 12 endif() 14 13 15 14 add_library(framedyn MODULE ${SOURCE}) 15 + target_link_libraries(framedyn cpprt) 16 + set_target_cpp_properties(framedyn WITH_EXCEPTIONS) 16 17 set_module_type(framedyn win32dll UNICODE) 17 18 add_importlibs(framedyn oleaut32 msvcrt kernel32 ntdll) 18 19 add_cd_file(TARGET framedyn DESTINATION reactos/system32/wbem FOR all)
+1 -2
dll/win32/msgina/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME) 3 2 4 3 add_definitions( 5 4 -D_ATL_NO_EXCEPTIONS) ··· 29 28 ${CMAKE_CURRENT_BINARY_DIR}/msgina.def) 30 29 31 30 set_module_type(msgina win32dll UNICODE) 32 - target_link_libraries(msgina wine uuid ${PSEH_LIB}) 31 + target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt) 33 32 add_delay_importlibs(msgina secur32) 34 33 add_importlibs(msgina advapi32 user32 gdi32 powrprof userenv msvcrt kernel32 ntdll) 35 34 add_pch(msgina msgina.h "${PCH_SKIP_SOURCE}")
+1 -2
dll/win32/shell32/CMakeLists.txt
··· 4 4 add_subdirectory(shellmenu) 5 5 add_subdirectory(shellrecyclebin) 6 6 7 - set_cpp(WITH_RUNTIME) 8 7 spec2def(shell32.dll shell32.spec ADD_IMPORTLIB) 9 8 10 9 if(NOT MSVC) ··· 122 121 set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb) 123 122 124 123 set_module_type(shell32 win32dll UNICODE) 125 - target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin) 124 + target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt) 126 125 add_delay_importlibs(shell32 powrprof shdocvw devmgr winspool.drv winmm mpr uxtheme ole32 oleaut32 userenv browseui version fmifs) 127 126 add_importlibs(shell32 advapi32 gdi32 user32 comctl32 comdlg32 shlwapi msvcrt kernel32 ntdll) 128 127 add_dependencies(shell32 stdole2) # shell32_shldisp.tlb needs stdole2.tlb
-2
dll/win32/shell32/shelldesktop/CMakeLists.txt
··· 1 1 project(SHELL) 2 2 3 - set_cpp(WITH_RUNTIME) 4 - 5 3 add_definitions( 6 4 -DUNICODE 7 5 -D_UNICODE
-2
dll/win32/shell32/shellmenu/CMakeLists.txt
··· 1 1 project(SHELL) 2 2 3 - set_cpp(WITH_RUNTIME) 4 - 5 3 add_definitions( 6 4 -DUNICODE 7 5 -D_UNICODE
-1
dll/win32/shlwapi/CMakeLists.txt
··· 9 9 -D_SHLWAPI_ 10 10 -D_ATL_NO_EXCEPTIONS) 11 11 12 - set_cpp(WITH_RUNTIME) 13 12 include_directories(BEFORE 14 13 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine 15 14 ${REACTOS_SOURCE_DIR}/sdk/lib/atl)
-2
drivers/filesystems/udfs/CMakeLists.txt
··· 1 1 2 2 include_directories(Include) 3 3 4 - set_cpp(WITH_RUNTIME) 5 - 6 4 list(APPEND SOURCE 7 5 udf_info/alloc.cpp 8 6 udf_info/dirtree.cpp
-1
drivers/storage/ide/uniata/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 include_directories( 5 4 BEFORE ${CMAKE_CURRENT_SOURCE_DIR}
-1
drivers/usb/usbaudio/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 remove_definitions(-D_WIN32_WINNT=0x502) 5 4 add_definitions(-D_WIN32_WINNT=0x600)
-1
drivers/wdm/audio/backpln/portcls/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 remove_definitions(-D_WIN32_WINNT=0x502) 5 4 add_definitions(-D_WIN32_WINNT=0x600)
-1
drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
··· 2 2 add_subdirectory(cmicontrol) 3 3 add_subdirectory(cpl) 4 4 5 - set_cpp() 6 5 7 6 # for WaveRT support 8 7 remove_definitions(-D_WIN32_WINNT=0x502)
-1
drivers/wdm/audio/drivers/CMIDriver/cmicontrol/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 include_directories(..) 4 3 5 4 add_executable(cmicontrol main.cpp window.rc)
-1
drivers/wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 add_library(cmicpl MODULE 5 4 cmicpl.cpp
-1
drivers/wdm/audio/hdaudbus/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 remove_definitions(-D_WIN32_WINNT=0x502) 5 4 add_definitions(-D_WIN32_WINNT=0x600)
+1 -1
modules/rosapps/applications/devutils/gdb2/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME) 3 2 add_executable(gdb2 gdb2.cpp) 3 + target_link_libraries(gdb2 cpprt) 4 4 set_module_type(gdb2 win32cui) 5 5 add_importlibs(gdb2 user32 msvcrt kernel32) 6 6 add_cd_file(TARGET gdb2 DESTINATION reactos/system32 FOR all)
+1 -2
modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME) 3 2 add_definitions(-D_ATL_NO_EXCEPTIONS) 4 3 5 4 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) ··· 7 6 add_executable(shlextdbg shlextdbg.cpp shlextdbg.rc) 8 7 9 8 set_module_type(shlextdbg win32cui UNICODE) 10 - target_link_libraries(shlextdbg uuid) 9 + target_link_libraries(shlextdbg uuid cpprt) 11 10 add_importlibs(shlextdbg ole32 comctl32 shell32 user32 msvcrt kernel32) 12 11 add_cd_file(TARGET shlextdbg DESTINATION reactos/system32 FOR all)
+2 -3
modules/rosapps/applications/explorer-old/CMakeLists.txt
··· 1 1 2 2 add_subdirectory(notifyhook) 3 3 4 - set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) 5 - 6 4 add_definitions( 7 5 -DWIN32 8 6 -D__WINDRES__) ··· 53 51 ${PCH_SKIP_SOURCE} 54 52 explorer.rc) 55 53 56 - target_link_libraries(explorer_old comsupp wine uuid) 54 + target_link_libraries(explorer_old comsupp wine uuid cppstl) 55 + set_target_cpp_properties(explorer_old WITH_EXCEPTIONS WITH_RTTI) 57 56 set_module_type(explorer_old win32gui UNICODE) 58 57 add_importlibs(explorer_old advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32 shell32 shlwapi notifyhook msvcrt kernel32 ntdll) 59 58 add_pch(explorer_old precomp.h "${PCH_SKIP_SOURCE}")
+5 -3
modules/rosapps/applications/fraginator/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) 3 1 4 2 list(APPEND SOURCE 5 3 Fraginator.cpp ··· 12 10 DriveVolume.cpp) 13 11 14 12 add_executable(frag ${SOURCE} ${UNFRAG_SOURCE} Fraginator.rc) 13 + target_link_libraries(frag cppstl) 14 + set_target_cpp_properties(frag WITH_EXCEPTIONS) 15 15 set_module_type(frag win32gui UNICODE) 16 16 add_importlibs(frag user32 advapi32 shell32 comctl32 msvcrt kernel32 ntdll) 17 17 add_cd_file(TARGET frag DESTINATION reactos/system32 FOR all) 18 18 19 19 add_executable(unfrag ${UNFRAG_SOURCE}) 20 + target_link_libraries(unfrag cppstl) 21 + set_target_cpp_properties(unfrag WITH_EXCEPTIONS) 20 22 target_compile_definitions(unfrag PRIVATE "_CUI_") 21 23 set_module_type(unfrag win32cui UNICODE) 22 24 add_importlibs(unfrag advapi32 msvcrt kernel32 ntdll) 23 - add_cd_file(TARGET unfrag DESTINATION reactos/system32 FOR all) 25 + add_cd_file(TARGET unfrag DESTINATION reactos/system32 FOR all)
+2 -1
modules/rosapps/applications/net/netreg/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) 3 2 add_executable(netreg netreg.cpp netreg.rc) 3 + target_link_libraries(netreg cppstl) 4 + set_target_cpp_properties(netreg WITH_EXCEPTIONS) 4 5 set_module_type(netreg win32cui) 5 6 add_importlibs(netreg advapi32 user32 ws2_32 msvcrt kernel32 ntdll) 6 7 add_cd_file(TARGET netreg DESTINATION reactos/system32 FOR all)
+2 -1
modules/rosapps/applications/net/roshttpd/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) 3 2 include_directories(BEFORE include) 4 3 add_compile_flags("-D__USE_W32_SOCKETS") 5 4 ··· 14 13 common/thread.cpp) 15 14 16 15 add_executable(roshttpd ${SOURCE} common/roshttpd.rc) 16 + target_link_libraries(roshttpd cppstl) 17 + set_target_cpp_properties(roshttpd WITH_EXCEPTIONS) 17 18 set_module_type(roshttpd win32cui) 18 19 add_importlibs(roshttpd user32 ws2_32 msvcrt kernel32) 19 20 add_cd_file(TARGET roshttpd DESTINATION reactos/system32 FOR all)
+6 -5
modules/rosapps/applications/sysutils/fontsub/CMakeLists.txt
··· 1 1 # FontSub by Katayama Hirofumi MZ 2 - # 2 + # 3 3 # To the extent possible under law, the person who associated CC0 with 4 4 # FontSub has waived all copyright and related or neighboring rights 5 5 # to FontSub. 6 - # 6 + # 7 7 # You should have received a copy of the CC0 legalcode along with this 8 8 # work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. 9 - 10 - set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) 11 9 12 10 add_executable(fontsubedit fontsub.cpp fontsub_res.rc) 11 + target_link_libraries(fontsubedit cppstl) 13 12 set_module_type(fontsubedit win32gui UNICODE) 14 13 add_importlibs(fontsubedit advapi32 comctl32 comdlg32 shell32 gdi32 user32 msvcrt kernel32) 15 - set_target_properties(fontsubedit PROPERTIES OUTPUT_NAME "fontsub") 14 + set_target_cpp_properties(fontsubedit WITH_EXCEPTIONS) 15 + set_target_properties(fontsubedit PROPERTIES 16 + OUTPUT_NAME "fontsub") 16 17 add_cd_file(TARGET fontsubedit DESTINATION reactos/system32 FOR all)
+2 -2
modules/rosapps/applications/sysutils/regexpl/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) 3 1 4 2 list(APPEND SOURCE 5 3 ArgumentParser.cpp ··· 31 29 Prompt.cpp) 32 30 33 31 add_executable(regexpl ${SOURCE} regexpl.rc) 32 + target_link_libraries(regexpl cppstl) 33 + set_target_cpp_properties(regexpl WITH_EXCEPTIONS) 34 34 set_module_type(regexpl win32cui) 35 35 add_importlibs(regexpl user32 advapi32 msvcrt kernel32 ntdll) 36 36 add_cd_file(TARGET regexpl DESTINATION reactos/system32 FOR all)
+2 -2
modules/rosapps/lib/vfdlib/CMakeLists.txt
··· 1 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) 2 1 3 2 spec2def(vfd.dll vfdlib.spec ADD_IMPORTLIB) 4 3 ··· 31 30 include_directories(${REACTOS_SOURCE_DIR}/modules/rosapps/include/vfd 32 31 ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) 33 32 set_module_type(vfd win32dll ENTRYPOINT DllMain 12) 34 - target_link_libraries(vfd zlib_solo uuid) 33 + target_link_libraries(vfd zlib_solo uuid cppstl) 34 + set_target_cpp_properties(vfd WITH_EXCEPTIONS) 35 35 add_importlibs(vfd advapi32 user32 gdi32 shell32 comdlg32 comctl32 ole32 version psapi msvcrt kernel32 ntdll) 36 36 add_dependencies(vfd vfdmsg_lib) 37 37 add_cd_file(TARGET vfd DESTINATION reactos/system32 FOR all)
+2 -3
modules/rostests/apitests/apphelp/CMakeLists.txt
··· 7 7 -D_UNICODE 8 8 -D_ATL_NO_EXCEPTIONS) 9 9 10 - set_cpp(WITH_RUNTIME) 11 10 12 11 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl 13 12 ${CMAKE_CURRENT_BINARY_DIR}) ··· 26 25 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb 27 26 COMMAND native-xml2sdb -i ${CMAKE_CURRENT_SOURCE_DIR}/testdb.xml -o ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb 28 27 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/testdb.xml native-xml2sdb) 29 - 28 + 30 29 add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb) 31 30 add_executable(apphelp_apitest ${SOURCE}) 32 31 set_module_type(apphelp_apitest win32cui) 33 - target_link_libraries(apphelp_apitest ${PSEH_LIB}) 32 + target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt) 34 33 add_importlibs(apphelp_apitest advapi32 userenv version shlwapi msvcrt kernel32 ntdll) 35 34 add_rostests_file(TARGET apphelp_apitest)
+2 -2
modules/rostests/apitests/atl/CMakeLists.txt
··· 1 1 2 2 add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG) 3 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 4 3 5 4 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 6 5 ··· 29 28 ${PCH_SKIP_SOURCE} 30 29 atl_apitest.rc) 31 30 32 - target_link_libraries(atl_apitest wine uuid) 31 + target_link_libraries(atl_apitest wine uuid cpprt) 32 + set_target_cpp_properties(atl_apitest WITH_EXCEPTIONS) 33 33 set_module_type(atl_apitest win32cui) 34 34 add_importlibs(atl_apitest rpcrt4 ole32 oleaut32 msimg32 gdi32 advapi32 user32 msvcrt kernel32 ntdll) 35 35 add_pch(atl_apitest precomp.h "${PCH_SKIP_SOURCE}")
+4 -3
modules/rostests/apitests/browseui/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RTTI WITH_RUNTIME WITH_EXCEPTIONS) 3 2 if(NOT MSVC) 4 3 # HACK: this should be enabled globally! 5 4 add_compile_flags_language("-std=c++11" "CXX") 6 5 endif() 7 6 8 7 include_directories( 9 - ${REACTOS_SOURCE_DIR}/sdk/lib/atl 8 + ${REACTOS_SOURCE_DIR}/sdk/lib/atl 10 9 includes) 11 10 12 11 list(APPEND SOURCE ··· 17 16 testlist.c) 18 17 19 18 add_executable(browseui_apitest ${SOURCE}) 20 - target_link_libraries(browseui_apitest uuid wine) 19 + target_link_libraries(browseui_apitest uuid wine cpprt) 20 + 21 + set_target_cpp_properties(browseui_apitest WITH_EXCEPTIONS WITH_RTTI) 21 22 set_module_type(browseui_apitest win32cui) 22 23 add_importlibs(browseui_apitest advapi32 shell32 ole32 shlwapi msvcrt kernel32 ntdll) 23 24 add_rostests_file(TARGET browseui_apitest)
+1 -2
modules/rostests/apitests/fontext/CMakeLists.txt
··· 6 6 -D_UNICODE 7 7 -D_ATL_NO_EXCEPTIONS) 8 8 9 - set_cpp(WITH_RUNTIME) 10 9 11 10 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl 12 11 ${CMAKE_CURRENT_BINARY_DIR}) ··· 17 16 18 17 add_executable(fontext_apitest ${SOURCE}) 19 18 set_module_type(fontext_apitest win32cui) 20 - target_link_libraries(fontext_apitest uuid ${PSEH_LIB}) 19 + target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt) 21 20 add_importlibs(fontext_apitest oleaut32 ole32 shell32 user32 msvcrt kernel32 ntdll) 22 21 add_rostests_file(TARGET fontext_apitest)
+1 -2
modules/rostests/apitests/msgina/CMakeLists.txt
··· 2 2 add_definitions( 3 3 -D_ATL_NO_EXCEPTIONS) 4 4 5 - set_cpp(WITH_RUNTIME) 6 5 7 6 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 8 7 ··· 10 9 ShellDimScreen.cpp 11 10 testlist.c) 12 11 13 - target_link_libraries(msgina_apitest wine uuid) 12 + target_link_libraries(msgina_apitest wine uuid cpprt) 14 13 set_module_type(msgina_apitest win32cui) 15 14 add_importlibs(msgina_apitest msvcrt user32 kernel32) 16 15 add_rostests_file(TARGET msgina_apitest)
+1 -2
modules/rostests/apitests/ole32/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_RUNTIME) 3 2 add_executable(ole32_apitest initializespy.cpp testlist.c) 4 - target_link_libraries(ole32_apitest wine uuid) 3 + target_link_libraries(ole32_apitest wine uuid cpprt) 5 4 set_module_type(ole32_apitest win32cui) 6 5 add_importlibs(ole32_apitest user32 gdi32 shell32 ole32 shlwapi msvcrt kernel32) 7 6 add_rostests_file(TARGET ole32_apitest)
+2 -3
modules/rostests/apitests/shell32/CMakeLists.txt
··· 2 2 add_definitions( 3 3 -D_ATL_NO_EXCEPTIONS) 4 4 5 - set_cpp(WITH_RUNTIME) 6 - 7 5 spec2def(shell32_apitest.exe shell32_apitest.spec) 8 6 9 7 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) ··· 46 44 resource.rc 47 45 ${CMAKE_CURRENT_BINARY_DIR}/shell32_apitest.def) 48 46 49 - target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB}) 47 + target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt) 50 48 set_module_type(shell32_apitest win32cui) 51 49 add_importlibs(shell32_apitest user32 gdi32 shell32 ole32 oleaut32 advapi32 shlwapi msvcrt kernel32 ntdll) 52 50 add_pch(shell32_apitest shelltest.h "${PCH_SKIP_SOURCE}") ··· 54 52 55 53 # shell-notify.exe 56 54 add_executable(shell-notify shell-notify.cpp) 55 + target_link_libraries(shell-notify cpprt) 57 56 set_module_type(shell-notify win32gui UNICODE) 58 57 add_importlibs(shell-notify msvcrt kernel32 user32 shell32 shlwapi ole32) 59 58 add_rostests_file(TARGET shell-notify SUBDIR testdata)
+2 -4
modules/rostests/apitests/zipfldr/CMakeLists.txt
··· 1 - 2 - add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG) 3 - set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) 4 1 5 2 include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) 6 3 ··· 17 14 ${PCH_SKIP_SOURCE} 18 15 zipfldr_apitest.rc) 19 16 20 - target_link_libraries(zipfldr_apitest wine uuid) 17 + target_link_libraries(zipfldr_apitest wine uuid cpprt) 18 + set_target_cpp_properties(zipfldr_apitest WITH_EXCEPTIONS) 21 19 set_module_type(zipfldr_apitest win32cui) 22 20 add_importlibs(zipfldr_apitest shlwapi ole32 shell32 user32 msvcrt kernel32 ntdll) 23 21 add_pch(zipfldr_apitest precomp.h "${PCH_SKIP_SOURCE}")
+2 -2
modules/rostests/rosautotest/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_EXCEPTIONS WITH_STL) 3 1 4 2 list(APPEND SOURCE 5 3 CConfiguration.cpp ··· 21 19 precomp.h) 22 20 23 21 add_executable(rosautotest ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/rosautotestmsg.rc) 22 + target_link_libraries(rosautotest cppstl) 23 + set_target_cpp_properties(rosautotest WITH_EXCEPTIONS) 24 24 set_module_type(rosautotest win32cui UNICODE) 25 25 add_importlibs(rosautotest advapi32 shell32 user32 wininet msvcrt kernel32 ntdll) 26 26 add_pch(rosautotest precomp.h SOURCE)
+12 -82
sdk/cmake/CMakeMacros.cmake
··· 1 - 2 - # set_cpp 3 - # Marks the current folder as containing C++ modules, additionally enabling 4 - # specific C++ language features as specified (all of these default to off): 5 - # 6 - # WITH_RUNTIME 7 - # Links with the C++ runtime. Enable this for modules which use new/delete or 8 - # RTTI, but do not require STL. This is the right choice if you see undefined 9 - # references to operator new/delete, vector constructor/destructor iterator, 10 - # type_info::vtable, ... 11 - # Note: this only affects linking, so cannot be used for static libraries. 12 - # WITH_RTTI 13 - # Enables run-time type information. Enable this if the module uses typeid or 14 - # dynamic_cast. You will probably need to enable WITH_RUNTIME as well, if 15 - # you're not already using STL. 16 - # WITH_EXCEPTIONS 17 - # Enables C++ exception handling. Enable this if the module uses try/catch or 18 - # throw. You might also need this if you use a standard operator new (the one 19 - # without nothrow). 20 - # WITH_STL 21 - # Enables standard C++ headers and links to the Standard Template Library. 22 - # Use this for modules using anything from the std:: namespace, e.g. maps, 23 - # strings, vectors, etc. 24 - # Note: this affects both compiling (via include directories) and 25 - # linking (by adding STL). Implies WITH_RUNTIME. 26 - # FIXME: WITH_STL is currently also required for runtime headers such as 27 - # <new> and <exception>. This is not a big issue because in stl-less 28 - # environments you usually don't want those anyway; but we might want 29 - # to have modules like this in the future. 30 - # 31 - # Examples: 32 - # set_cpp() 33 - # Enables the C++ language, but will cause errors if any runtime or standard 34 - # library features are used. This should be the default for C++ in kernel 35 - # mode or otherwise restricted environments. 36 - # Note: this is required to get libgcc (for multiplication/division) linked 37 - # in for C++ modules, and to set the correct language for precompiled 38 - # header files, so it IS required even with no features specified. 39 - # set_cpp(WITH_RUNTIME) 40 - # Links with the C++ runtime, so that e.g. custom operator new implementations 41 - # can be used in a restricted environment. This is also required for linking 42 - # with libraries (such as ATL) which have RTTI enabled, even if the module in 43 - # question does not use WITH_RTTI. 44 - # set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) 45 - # The full package. This will adjust compiler and linker so that all C++ 46 - # features can be used. 47 - macro(set_cpp) 48 - cmake_parse_arguments(__cppopts "WITH_RUNTIME;WITH_RTTI;WITH_EXCEPTIONS;WITH_STL" "" "" ${ARGN}) 49 - if(__cppopts_UNPARSED_ARGUMENTS) 50 - message(FATAL_ERROR "set_cpp: unparsed arguments ${__cppopts_UNPARSED_ARGUMENTS}") 51 - endif() 52 - 53 - if(__cppopts_WITH_RUNTIME) 54 - set(CPP_USE_RT 1) 55 - endif() 56 - if(__cppopts_WITH_RTTI) 57 - if(MSVC) 58 - replace_compile_flags("/GR-" "/GR") 59 - else() 60 - replace_compile_flags_language("-fno-rtti" "-frtti" "CXX") 61 - endif() 62 - endif() 63 - if(__cppopts_WITH_EXCEPTIONS) 64 - if(MSVC) 65 - replace_compile_flags("/EHs-c-" "/EHsc") 66 - else() 67 - replace_compile_flags_language("-fno-exceptions" "-fexceptions" "CXX") 68 - endif() 69 - endif() 70 - if(__cppopts_WITH_STL) 71 - set(CPP_USE_STL 1) 72 - if(MSVC) 73 - add_definitions(-DNATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++) 74 - include_directories(${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport) 75 - else() 76 - replace_compile_flags("-nostdinc" " ") 77 - add_definitions(-DPAL_STDCPP_COMPAT) 78 - endif() 79 - endif() 80 - 81 - set(IS_CPP 1) 82 - endmacro() 83 1 84 2 function(add_dependency_node _node) 85 3 if(GENERATE_DEPENDENCY_GRAPH) ··· 988 906 macro(add_pch _target _pch _skip_list) 989 907 endmacro() 990 908 endif() 909 + 910 + function(set_target_cpp_properties _target) 911 + cmake_parse_arguments(_CPP "WITH_EXCEPTIONS;WITH_RTTI" "" "" ${ARGN}) 912 + 913 + if (_CPP_WITH_EXCEPTIONS) 914 + set_target_properties(${_target} PROPERTIES WITH_CXX_EXCEPTIONS TRUE) 915 + endif() 916 + 917 + if (_CPP_WITH_RTTI) 918 + set_target_properties(${_target} PROPERTIES WITH_CXX_RTTI TRUE) 919 + endif() 920 + endfunction()
+47 -15
sdk/cmake/gcc.cmake
··· 41 41 # Compiler Core 42 42 add_compile_flags("-pipe -fms-extensions -fno-strict-aliasing") 43 43 44 - # Prevent GCC from searching any of the default directories 45 - add_compile_flags("-nostdinc") 44 + # Prevent GCC from searching any of the default directories. 45 + # The case for C++ is handled through the reactos_c++ INTERFACE library 46 + add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>") 46 47 47 48 add_compile_flags("-mstackrealign") 48 49 add_compile_flags("-fno-aggressive-loop-optimizations") ··· 67 68 add_compile_flags_language("-Wold-style-declaration" "C") 68 69 endif() 69 70 endif() 70 - 71 - add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX") 72 71 73 72 #bug 74 73 #file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE) ··· 292 291 endfunction() 293 292 294 293 function(set_module_type_toolchain MODULE TYPE) 295 - if(CPP_USE_STL) 296 - if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) 297 - message(FATAL_ERROR "Use of STL in kernelmodedriver or wdmdriver type module prohibited") 298 - endif() 299 - target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex) 300 - elseif(CPP_USE_RT) 301 - target_link_libraries(${MODULE} -lsupc++ -lgcc) 302 - elseif(IS_CPP) 303 - target_link_libraries(${MODULE} -lgcc) 304 - endif() 305 - 306 294 if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) 307 295 add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000") 308 296 if(${TYPE} STREQUAL "wdmdriver") ··· 440 428 add_target_link_flags(${_target} "-Wl,-T,${_file_full_path}") 441 429 add_target_property(${_target} LINK_DEPENDS ${_file_full_path}) 442 430 endfunction() 431 + 432 + # Manage our C++ options 433 + # we disable standard includes if we don't use the STL 434 + add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<IN_LIST:cppstl,$<TARGET_PROPERTY:LINK_LIBRARIES>>>>:-nostdinc>") 435 + # we disable RTTI, unless said so 436 + add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_RTTI>>,-frtti,-fno-rtti>>") 437 + # We disable exceptions, unless said so 438 + add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>,-fexceptions,-fno-exceptions>>") 439 + 440 + # Find default G++ libraries 441 + add_library(libgcc STATIC IMPORTED) 442 + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libgcc.a OUTPUT_VARIABLE LIBGCC_LOCATION) 443 + string(STRIP ${LIBGCC_LOCATION} LIBGCC_LOCATION) 444 + set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION ${LIBGCC_LOCATION}) 445 + # libgcc needs kernel32 imports, a CRT and msvcrtex 446 + target_link_libraries(libgcc INTERFACE libkernel32 libmsvcrt msvcrtex) 447 + 448 + add_library(libsupc++ STATIC IMPORTED GLOBAL) 449 + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libsupc++.a OUTPUT_VARIABLE LIBSUPCXX_LOCATION) 450 + string(STRIP ${LIBSUPCXX_LOCATION} LIBSUPCXX_LOCATION) 451 + set_target_properties(libsupc++ PROPERTIES IMPORTED_LOCATION ${LIBSUPCXX_LOCATION}) 452 + # libsupc++ requires libgcc 453 + target_link_libraries(libsupc++ INTERFACE libgcc) 454 + 455 + add_library(libmingwex STATIC IMPORTED) 456 + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libmingwex.a OUTPUT_VARIABLE LIBMINGWEX_LOCATION) 457 + string(STRIP ${LIBMINGWEX_LOCATION} LIBMINGWEX_LOCATION) 458 + set_target_properties(libmingwex PROPERTIES IMPORTED_LOCATION ${LIBMINGWEX_LOCATION}) 459 + # libmingwex requires a CRT and imports from kernel32 460 + target_link_libraries(libmingwex INTERFACE libmsvcrt libkernel32) 461 + 462 + add_library(libstdc++ STATIC IMPORTED GLOBAL) 463 + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCCXX_LOCATION) 464 + string(STRIP ${LIBSTDCCXX_LOCATION} LIBSTDCCXX_LOCATION) 465 + set_target_properties(libstdc++ PROPERTIES IMPORTED_LOCATION ${LIBSTDCCXX_LOCATION}) 466 + # libstdc++ requires libsupc++ and mingwex provided by GCC 467 + target_link_libraries(libstdc++ INTERFACE libsupc++ libmingwex) 468 + # this is for our SAL annotations 469 + target_compile_definitions(libstdc++ INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:PAL_STDCPP_COMPAT>") 470 + 471 + # Create our alias libraries 472 + add_library(cppstl ALIAS libstdc++) 473 + add_library(cpprt ALIAS libsupc++) 474 +
+15 -9
sdk/cmake/msvc.cmake
··· 42 42 43 43 # Disable RTTI, exception handling and buffer security checks by default. 44 44 # These require run-time support that may not always be available. 45 - add_compile_flags("/GR- /EHs-c- /GS-") 45 + add_compile_flags("/GS-") 46 46 47 47 if(USE_CLANG_CL) 48 48 set(CMAKE_CL_SHOWINCLUDES_PREFIX "Note: including file: ") ··· 252 252 endfunction() 253 253 254 254 function(set_module_type_toolchain MODULE TYPE) 255 - if(CPP_USE_STL) 256 - if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) 257 - message(FATAL_ERROR "Use of STL in kernelmodedriver or wdmdriver type module prohibited") 258 - endif() 259 - target_link_libraries(${MODULE} cpprt stlport oldnames) 260 - elseif(CPP_USE_RT) 261 - target_link_libraries(${MODULE} cpprt) 262 - endif() 263 255 if((${TYPE} STREQUAL "win32dll") OR (${TYPE} STREQUAL "win32ocx") OR (${TYPE} STREQUAL "cpl")) 264 256 add_target_link_flags(${MODULE} "/DLL") 265 257 elseif(${TYPE} STREQUAL "kernelmodedriver") ··· 559 551 add_target_property(${_target} LINK_DEPENDS ${_file_full_path}) 560 552 endif() 561 553 endfunction() 554 + 555 + # handle C++ options 556 + # disable RTTI unless said so 557 + add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_RTTI>>,/GR,/GR->>") 558 + # disable exceptions unless said so 559 + add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>,/EHsc,/EHs-c->>") 560 + 561 + # Create our interface libraries wrapping the needed library for this compiler 562 + add_library(cppstl INTERFACE) 563 + target_link_libraries(cppstl INTERFACE cpprt stlport oldnames) 564 + # We set this properties through our INTERFACE library 565 + set_target_properties(cppstl PROPERTIES INTERFACE_WITH_CXX_STL TRUE) 566 + # add_library(cpprt INTERFACE) 567 + # Our runtime library is already called cpprt
+3 -2
sdk/lib/3rdparty/cardlib/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 4 3 list(APPEND SOURCE 5 4 cardbitmaps.cpp ··· 15 14 dropzone.cpp 16 15 cardlib.h) 17 16 18 - add_library(cardlib ${SOURCE}) 17 + add_library(cardlib STATIC ${SOURCE}) 18 + target_link_libraries(cardlib PRIVATE cpprt) 19 + target_include_directories(cardlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 20 20 21 if(NOT MSVC) 21 22 target_compile_options(cardlib PRIVATE "-Wno-unused-but-set-variable")
+9 -7
sdk/lib/3rdparty/stlport/CMakeLists.txt
··· 2 2 #uncomment this if you want to test c++ compilation 3 3 #add_subdirectory(test) 4 4 5 - set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) 6 - 7 - add_definitions( 8 - -D_STLP_USE_EXCEPTIONS 9 - -D_DLL -D__USE_CRTIMP 10 - -D_BUILD_STLPORT) 11 - 12 5 list(APPEND SOURCE 13 6 src/allocators.cpp 14 7 src/bitset.cpp ··· 52 45 target_compile_options(stlport PRIVATE -Wno-infinite-recursion -Wno-deprecated-register) 53 46 target_compile_options(stlport PRIVATE -Wno-tautological-unsigned-zero-compare) 54 47 endif() 48 + 49 + target_include_directories(stlport PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport) 50 + target_compile_definitions(stlport PRIVATE 51 + _STLP_USE_EXCEPTIONS _DLL __USE_CRTIMP 52 + _BUILD_STLPORT NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++) 53 + 54 + target_include_directories(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport>") 55 + target_compile_definitions(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++>") 56 + set_target_cpp_properties(stlport WITH_EXCEPTIONS WITH_RTTI) 55 57 56 58 add_dependencies(stlport xdk) 57 59 add_pch(stlport src/stlport_prefix.h SOURCE)
+3 -1
sdk/lib/comsupp/CMakeLists.txt
··· 1 1 2 - set_cpp(WITH_EXCEPTIONS WITH_STL) 3 2 add_library(comsupp comsupp.cpp) 3 + target_link_libraries(comsupp PRIVATE cppstl) 4 + set_target_cpp_properties(comsupp WITH_EXCEPTIONS) 5 + 4 6 add_dependencies(comsupp psdk)
+1 -2
sdk/lib/cpprt/CMakeLists.txt
··· 1 - 2 - set_cpp(WITH_EXCEPTIONS) 3 1 4 2 include_directories( 5 3 ${REACTOS_SOURCE_DIR}/sdk/lib/crt/include ··· 21 19 endif() 22 20 23 21 add_library(cpprt ${SOURCE} ${cpprt_asm}) 22 + set_target_cpp_properties(cpprt WITH_EXCEPTIONS) 24 23 add_dependencies(cpprt xdk)
-1
sdk/lib/drivers/sound/stdunk/CMakeLists.txt
··· 1 1 2 - set_cpp() 3 2 add_library(stdunk cunknown.cpp) 4 3 add_dependencies(stdunk xdk)