ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2020
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
156 discussions
Start a n
N
ew thread
[reactos] 11/12: Apply suggestions from code review
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c004b53d774472f577a38…
commit c004b53d774472f577a381bf66ded3ccc9cbdaa2 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Oct 16 08:41:35 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 Apply suggestions from code review Style fixes Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> Co-authored-by: Victor Perevertkin <victor(a)perevertkin.ru> --- base/services/tftpd/CMakeLists.txt | 2 +- dll/3rdparty/libtiff/CMakeLists.txt | 2 +- dll/directx/wine/wined3d/CMakeLists.txt | 2 +- dll/win32/msxml3/CMakeLists.txt | 2 +- dll/win32/shell32/CMakeLists.txt | 2 +- modules/rosapps/applications/devutils/createspec/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base/services/tftpd/CMakeLists.txt b/base/services/tftpd/CMakeLists.txt index 218464d28ae..fb6ab01c67d 100644 --- a/base/services/tftpd/CMakeLists.txt +++ b/base/services/tftpd/CMakeLists.txt @@ -4,6 +4,6 @@ set_module_type(tftpd win32cui) add_importlibs(tftpd advapi32 ws2_32 iphlpapi msvcrt kernel32) add_cd_file(TARGET tftpd DESTINATION reactos/system32 FOR all) -if ((NOT MSVC) OR USE_CLANG_CL) +if((NOT MSVC) OR USE_CLANG_CL) target_compile_options(tftpd PRIVATE -Wno-format-overflow) endif() diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index 470cbba14c8..fc98c11cac4 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -62,7 +62,7 @@ add_importlibs(libtiff user32 msvcrt kernel32 ntdll) add_pch(libtiff precomp.h SOURCE) add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) -if (MSVC) +if(MSVC) # error C4311: 'type cast': pointer truncation from 'thandle_t' to 'int' remove_target_compile_option(libtiff "/we4311") # error C4312: 'type cast': conversion from 'int' to 'thandle_t' of greater size diff --git a/dll/directx/wine/wined3d/CMakeLists.txt b/dll/directx/wine/wined3d/CMakeLists.txt index ea4f46059a6..3af303fd783 100644 --- a/dll/directx/wine/wined3d/CMakeLists.txt +++ b/dll/directx/wine/wined3d/CMakeLists.txt @@ -53,6 +53,6 @@ add_importlibs(d3dwine user32 opengl32 gdi32 advapi32 msvcrt kernel32 ntdll) add_pch(d3dwine precomp.h SOURCE) add_cd_file(TARGET d3dwine DESTINATION reactos/system32 FOR all) -if (NOT MSVC) +if(NOT MSVC) target_compile_options(d3dwine PRIVATE -Wno-format-overflow) endif() diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index 953b615d573..11fddb98a78 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -73,7 +73,7 @@ add_idl_headers(xmlparser_idlheader xmlparser.idl) set_module_type(msxml3 win32dll) target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib) -if (MSVC) +if(MSVC) target_compile_options(msxml3 PRIVATE /FIwine/typeof.h /FImsvc.h) endif() diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 4525db49984..4ebe876caea 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -102,7 +102,7 @@ add_library(shell32 MODULE shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) -if (MSVC) +if(MSVC) # error C4311: 'type cast': pointer truncation from 'HANDLE' to 'INT' remove_target_compile_option(shell32 "/we4311") endif() diff --git a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt index 1cb52624ccf..e008438e191 100644 --- a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(createspec createspec.c) set_module_type(createspec win32cui) target_link_libraries(createspec wine) -if (NOT MSVC) +if(NOT MSVC) target_compile_options(createspec PRIVATE -Wno-stringop-overflow) endif() add_importlibs(createspec dbghelp msvcrt kernel32)
4 years, 2 months
1
0
0
0
[reactos] 10/12: [CMAKE] Get rid of add_compile_flags
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00ed72d7e850a5bfec980…
commit 00ed72d7e850a5bfec98023ad3821a81a5f77ccc Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Sep 21 12:16:02 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Get rid of add_compile_flags Use add_compile_options and the like instead --- CMakeLists.txt | 2 +- base/services/tftpd/CMakeLists.txt | 8 +-- boot/freeldr/freeldr/CMakeLists.txt | 2 +- dll/3rdparty/libxslt/CMakeLists.txt | 11 ++-- dll/win32/comctl32/CMakeLists.txt | 6 +- dll/win32/framedyn/CMakeLists.txt | 6 +- dll/win32/msxml3/CMakeLists.txt | 9 +-- dll/win32/windowscodecs/CMakeLists.txt | 9 +-- .../devutils/createspec/CMakeLists.txt | 7 +-- .../applications/net/roshttpd/CMakeLists.txt | 2 +- modules/rostests/apitests/crt/CMakeLists.txt | 4 +- modules/rostests/tests/dllexport/CMakeLists.txt | 8 +-- modules/rostests/winetests/advpack/CMakeLists.txt | 14 ++--- modules/rostests/winetests/fusion/CMakeLists.txt | 13 +++-- modules/rostests/winetests/msi/CMakeLists.txt | 24 ++++---- modules/rostests/winetests/msvcrt/CMakeLists.txt | 21 ++++--- modules/rostests/winetests/services/CMakeLists.txt | 8 +-- modules/rostests/winetests/setupapi/CMakeLists.txt | 8 +-- modules/rostests/winetests/shell32/CMakeLists.txt | 6 +- modules/rostests/winetests/version/CMakeLists.txt | 12 ++-- sdk/cmake/compilerflags.cmake | 16 ------ sdk/cmake/gcc.cmake | 65 +++++++++++----------- sdk/cmake/msvc.cmake | 63 ++++++++++----------- sdk/lib/crt/msvcrtex.cmake | 17 +++--- sdk/lib/drivers/lwip/CMakeLists.txt | 6 +- sdk/tools/wpp/CMakeLists.txt | 9 ++- 26 files changed, 158 insertions(+), 198 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3de95fe75c1..ed703c8145c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ else() endif() if(MSVC_IDE) - add_compile_flags("/MP") + add_compile_options("/MP") endif() # Bison and Flex support diff --git a/base/services/tftpd/CMakeLists.txt b/base/services/tftpd/CMakeLists.txt index f4bd0cb6d7d..218464d28ae 100644 --- a/base/services/tftpd/CMakeLists.txt +++ b/base/services/tftpd/CMakeLists.txt @@ -1,9 +1,9 @@ -if(NOT MSVC) - add_compile_flags("-Wno-format-overflow") -endif() - add_executable(tftpd tftpd.cpp) set_module_type(tftpd win32cui) add_importlibs(tftpd advapi32 ws2_32 iphlpapi msvcrt kernel32) add_cd_file(TARGET tftpd DESTINATION reactos/system32 FOR all) + +if ((NOT MSVC) OR USE_CLANG_CL) + target_compile_options(tftpd PRIVATE -Wno-format-overflow) +endif() diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 80bea8f1f41..a401a5b1a66 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -8,7 +8,7 @@ endif() if(MSVC) # Explicitly use string pooling - add_compile_flags("/GF") + add_compile_options("/GF") endif() spec2def(freeldr_pe.exe freeldr.spec) diff --git a/dll/3rdparty/libxslt/CMakeLists.txt b/dll/3rdparty/libxslt/CMakeLists.txt index d5e2d3b9eb8..5247b3efb7a 100644 --- a/dll/3rdparty/libxslt/CMakeLists.txt +++ b/dll/3rdparty/libxslt/CMakeLists.txt @@ -1,8 +1,4 @@ -if(NOT MSVC) - add_compile_flags("-Wno-misleading-indentation") -endif() - include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libxslt ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/libwin-iconv) @@ -47,9 +43,10 @@ if(MSVC) add_importlibs(libxslt ntdll) endif() +if ((NOT MSVC) OR USE_CLANG_CL) + target_compile_options(libxslt PRIVATE -Wno-misleading-indentation -Wno-pointer-sign -Wno-unused-function) +endif() + add_pch(libxslt precomp.h SOURCE) add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) -if(USE_CLANG_CL OR (NOT MSVC)) - target_compile_options(libxslt PRIVATE -Wno-pointer-sign -Wno-unused-function) -endif() diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index 4d70e28eecc..60c571c58ed 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -64,8 +64,10 @@ add_library(comctl32 MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/comctl32.def) -# Disable warning C4477 (printf format warnings) -target_compile_options(comctl32 PRIVATE $<$<BOOL:${MSVC}>:/wd4477>) +if (MSVC) + # Disable warning C4477 (printf format warnings) + target_compile_options(comctl32 PRIVATE /wd4477) +endif() set_module_type(comctl32 win32dll UNICODE) target_link_libraries(comctl32 uuid wine ${PSEH_LIB}) diff --git a/dll/win32/framedyn/CMakeLists.txt b/dll/win32/framedyn/CMakeLists.txt index 922ead719e9..837fea881fa 100644 --- a/dll/win32/framedyn/CMakeLists.txt +++ b/dll/win32/framedyn/CMakeLists.txt @@ -7,10 +7,6 @@ list(APPEND SOURCE provider.cpp ${CMAKE_CURRENT_BINARY_DIR}/framedyn.def) -if(MSVC) - add_compile_flags("/Zc:wchar_t-") -endif() - add_library(framedyn MODULE ${SOURCE}) target_link_libraries(framedyn cpprt) set_target_cpp_properties(framedyn WITH_EXCEPTIONS) @@ -22,4 +18,6 @@ if(NOT MSVC) add_asm_files(framedynex_asm alias_gcc.s) add_library(framedynex ${framedynex_asm}) set_target_properties(framedynex PROPERTIES LINKER_LANGUAGE ASM) +else() + target_compile_options(framedyn PRIVATE /Zc:wchar_t-) endif() diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index b11bdf3f8ed..953b615d573 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -6,10 +6,6 @@ add_definitions( -DLIBXML_STATIC -DCOM_NO_WINDOWS_H) -if(MSVC) - add_compile_flags("/FIwine/typeof.h /FImsvc.h") -endif() - include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/libwin-iconv) @@ -76,6 +72,11 @@ add_library(msxml3 MODULE add_idl_headers(xmlparser_idlheader xmlparser.idl) set_module_type(msxml3 win32dll) target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib) + +if (MSVC) + target_compile_options(msxml3 PRIVATE /FIwine/typeof.h /FImsvc.h) +endif() + add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) add_dependencies(msxml3 xmlparser_idlheader stdole2) # msxml3_v1.tlb needs stdole2.tlb add_pch(msxml3 precomp.h "${PCH_SKIP_SOURCE}") diff --git a/dll/win32/windowscodecs/CMakeLists.txt b/dll/win32/windowscodecs/CMakeLists.txt index fd29c68ad48..c9f0e9ecdbd 100644 --- a/dll/win32/windowscodecs/CMakeLists.txt +++ b/dll/win32/windowscodecs/CMakeLists.txt @@ -16,10 +16,6 @@ include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libpng ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libtiff) -if(MSVC) - add_compile_flags("/FItypeof.h") -endif() - spec2def(windowscodecs.dll windowscodecs.spec ADD_IMPORTLIB) add_rpcproxy_files(windowscodecs_wincodec.idl) @@ -75,8 +71,9 @@ add_library(windowscodecs MODULE ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def) if(MSVC) - # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' - remove_target_compile_option(windowscodecs "/we4133") + target_compile_options(windowscodecs PRIVATE + /wd4133 # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' + /FItypeof.h) endif() set_module_type(windowscodecs win32dll) diff --git a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt index fbd6692604c..1cb52624ccf 100644 --- a/modules/rosapps/applications/devutils/createspec/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/createspec/CMakeLists.txt @@ -1,10 +1,9 @@ -if(GCC) - add_compile_flags("-Wno-stringop-overflow") -endif() - add_executable(createspec createspec.c) set_module_type(createspec win32cui) target_link_libraries(createspec wine) +if (NOT MSVC) + target_compile_options(createspec PRIVATE -Wno-stringop-overflow) +endif() add_importlibs(createspec dbghelp msvcrt kernel32) add_cd_file(TARGET createspec DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/net/roshttpd/CMakeLists.txt b/modules/rosapps/applications/net/roshttpd/CMakeLists.txt index 3cb22768855..938212c2016 100644 --- a/modules/rosapps/applications/net/roshttpd/CMakeLists.txt +++ b/modules/rosapps/applications/net/roshttpd/CMakeLists.txt @@ -1,6 +1,5 @@ include_directories(BEFORE include) -add_compile_flags("-D__USE_W32_SOCKETS") list(APPEND SOURCE config.cpp @@ -15,6 +14,7 @@ list(APPEND SOURCE add_executable(roshttpd ${SOURCE} common/roshttpd.rc) target_link_libraries(roshttpd cppstl) set_target_cpp_properties(roshttpd WITH_EXCEPTIONS) +target_compile_definitions(roshttpd PRIVATE __USE_W32_SOCKETS) set_module_type(roshttpd win32cui) add_importlibs(roshttpd user32 ws2_32 msvcrt kernel32) add_cd_file(TARGET roshttpd DESTINATION reactos/system32 FOR all) diff --git a/modules/rostests/apitests/crt/CMakeLists.txt b/modules/rostests/apitests/crt/CMakeLists.txt index 8b253d21f66..3b71f777bc6 100644 --- a/modules/rostests/apitests/crt/CMakeLists.txt +++ b/modules/rostests/apitests/crt/CMakeLists.txt @@ -1,6 +1,6 @@ -if(GCC) - add_compile_flags("-fno-builtin") +if (GCC) + add_compile_options(-fno-builtin) endif() include(ntdll_crt_apitest.cmake) diff --git a/modules/rostests/tests/dllexport/CMakeLists.txt b/modules/rostests/tests/dllexport/CMakeLists.txt index 741477d2c6e..65e87cec3bb 100644 --- a/modules/rostests/tests/dllexport/CMakeLists.txt +++ b/modules/rostests/tests/dllexport/CMakeLists.txt @@ -23,10 +23,6 @@ add_executable(dllexport_test dllexport_test.c) set_module_type(dllexport_test win32cui) add_importlibs(dllexport_test dllexport_test_dll1 msvcrt kernel32 ntdll) -if(MSVC) - add_compile_flags("/Zc:wchar_t-") -endif() - # framedyn is skipped in the clang-cl build if(NOT USE_CLANG_CL) @@ -34,7 +30,9 @@ add_library(dllimport_test MODULE dllimport_framedyn.cpp) set_module_type(dllimport_test module) add_importlibs(dllimport_test framedyn) -if(NOT MSVC) +if (MSVC) + target_compile_options(dllimport_test PRIVATE /Zc:wchar_t-) +else() target_link_libraries(dllimport_test framedynex) endif() diff --git a/modules/rostests/winetests/advpack/CMakeLists.txt b/modules/rostests/winetests/advpack/CMakeLists.txt index a920eda6d06..9eebedf7ba0 100644 --- a/modules/rostests/winetests/advpack/CMakeLists.txt +++ b/modules/rostests/winetests/advpack/CMakeLists.txt @@ -1,10 +1,4 @@ -add_definitions(-DUSE_WINE_TODOS) - -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE advpack.c files.c @@ -12,7 +6,13 @@ list(APPEND SOURCE testlist.c) add_executable(advpack_winetest ${SOURCE}) -target_link_libraries(advpack_winetest) + +target_compile_definitions(advpack_winetest PRIVATE USE_WINE_TODOS) + +if (NOT MSVC) + target_compile_options(advpack_winetest PRIVATE -Wno-format-overflow) +endif() + set_module_type(advpack_winetest win32cui) add_importlibs(advpack_winetest advpack cabinet advapi32 msvcrt kernel32) add_rostests_file(TARGET advpack_winetest) diff --git a/modules/rostests/winetests/fusion/CMakeLists.txt b/modules/rostests/winetests/fusion/CMakeLists.txt index faca708e42e..f3600c383d0 100644 --- a/modules/rostests/winetests/fusion/CMakeLists.txt +++ b/modules/rostests/winetests/fusion/CMakeLists.txt @@ -1,10 +1,4 @@ -add_definitions(-DUSE_WINE_TODOS) - -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE asmcache.c asmenum.c @@ -13,6 +7,13 @@ list(APPEND SOURCE testlist.c) add_executable(fusion_winetest ${SOURCE}) + +target_compile_definitions(fusion_winetest PRIVATE USE_WINE_TODOS) + +if (NOT MSVC) + target_compile_options(fusion_winetest PRIVATE -Wno-format-overflow) +endif() + set_module_type(fusion_winetest win32cui) add_importlibs(fusion_winetest user32 msvcrt kernel32) add_rostests_file(TARGET fusion_winetest) diff --git a/modules/rostests/winetests/msi/CMakeLists.txt b/modules/rostests/winetests/msi/CMakeLists.txt index 2c71551a024..815c2cfc2cc 100644 --- a/modules/rostests/winetests/msi/CMakeLists.txt +++ b/modules/rostests/winetests/msi/CMakeLists.txt @@ -1,17 +1,4 @@ -add_definitions( - -DUSE_WINE_TODOS - -D__WINESRC__) - -if(MSVC_IDE) - # msi_winetest.rc: let rc.exe find custom.dll in its subdirectory, i.e. Debug. - include_directories($<TARGET_FILE_DIR:custom>) -endif() - -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - spec2def(custom.dll custom.spec) add_library(custom MODULE custom.c ${CMAKE_CURRENT_BINARY_DIR}/custom.def) target_link_libraries(custom uuid) @@ -43,6 +30,17 @@ add_executable(msi_winetest ${PCH_SKIP_SOURCE} msi_winetest.rc) +target_compile_definitions(msi_winetest PRIVATE __WINESRC__ USE_WINE_TODOS) + +if (NOT MSVC) + target_compile_options(msi_winetest PRIVATE -Wno-format-overflow) +endif() + +# msi_winetest.rc: let rc.exe find custom.dll in its subdirectory, i.e. Debug. +if (MSVC_IDE) + target_include_directories(msi_winetest PRIVATE $<$<COMPILE_LANGUAGE:RC>:$<TARGET_FILE_DIR:custom>>) +endif() + target_link_libraries(msi_winetest uuid) set_module_type(msi_winetest win32cui) add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 user32 advapi32 version msvcrt kernel32) diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt b/modules/rostests/winetests/msvcrt/CMakeLists.txt index 9b9ab157cc7..0574e646adf 100644 --- a/modules/rostests/winetests/msvcrt/CMakeLists.txt +++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt @@ -1,13 +1,4 @@ -add_definitions( - -DWINETEST_USE_DBGSTR_LONGLONG - -D_CRT_NONSTDC_NO_DEPRECATE - -D__msvcrt_ulong=ULONG) - -if(GCC) - add_compile_flags("-Wno-stringop-truncation") -endif() - list(APPEND SOURCE cpp.c data.c @@ -31,8 +22,16 @@ add_executable(msvcrt_winetest ${SOURCE} ${PCH_SKIP_SOURCE}) -if(USE_CLANG_CL OR (NOT MSVC)) - target_compile_options(msvcrt_winetest PRIVATE "-Wno-format") +target_compile_definitions(msvcrt_winetest PRIVATE + WINETEST_USE_DBGSTR_LONGLONG + _CRT_NONSTDC_NO_DEPRECATE + __msvcrt_ulong=ULONG) + +if ((NOT MSVC) OR USE_CLANG_CL) + if (NOT USE_CLANG_CL) + target_compile_options(msvcrt_winetest PRIVATE -Wno-stringop-truncation) + endif() + target_compile_options(msvcrt_winetest PRIVATE -Wno-format) endif() set_module_type(msvcrt_winetest win32cui) diff --git a/modules/rostests/winetests/services/CMakeLists.txt b/modules/rostests/winetests/services/CMakeLists.txt index 01141885072..b6313f4d2e8 100644 --- a/modules/rostests/winetests/services/CMakeLists.txt +++ b/modules/rostests/winetests/services/CMakeLists.txt @@ -1,9 +1,9 @@ -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - add_executable(services_winetest service.c testlist.c) set_module_type(services_winetest win32cui) add_importlibs(services_winetest user32 advapi32 msvcrt kernel32) add_rostests_file(TARGET services_winetest) + +if (NOT MSVC) + target_compile_options(services_winetest PRIVATE -Wno-format-overflow) +endif() diff --git a/modules/rostests/winetests/setupapi/CMakeLists.txt b/modules/rostests/winetests/setupapi/CMakeLists.txt index d47b7f1c282..60ba1fef77b 100644 --- a/modules/rostests/winetests/setupapi/CMakeLists.txt +++ b/modules/rostests/winetests/setupapi/CMakeLists.txt @@ -1,8 +1,4 @@ -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE devinst.c dialog.c @@ -20,3 +16,7 @@ set_module_type(setupapi_winetest win32cui) target_link_libraries(setupapi_winetest uuid) add_importlibs(setupapi_winetest advapi32 setupapi user32 shell32 msvcrt kernel32 ntdll) add_rostests_file(TARGET setupapi_winetest) + +if (NOT MSVC) + target_compile_options(setupapi_winetest PRIVATE -Wno-format-overflow) +endif() diff --git a/modules/rostests/winetests/shell32/CMakeLists.txt b/modules/rostests/winetests/shell32/CMakeLists.txt index 3b3451c8343..a9816a60be4 100644 --- a/modules/rostests/winetests/shell32/CMakeLists.txt +++ b/modules/rostests/winetests/shell32/CMakeLists.txt @@ -3,10 +3,6 @@ add_definitions(-DWINETEST_USE_DBGSTR_LONGLONG) remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE appbar.c assoc.c @@ -42,6 +38,8 @@ add_importlibs(shell32_winetest shell32 shlwapi ole32 oleaut32 user32 gdi32 adva if(MSVC) add_importlibs(shell32_winetest ntdll) +else() + target_compile_options(shell32_winetest PRIVATE -Wno-format-overflow) endif() add_pch(shell32_winetest precomp.h "${PCH_SKIP_SOURCE}") diff --git a/modules/rostests/winetests/version/CMakeLists.txt b/modules/rostests/winetests/version/CMakeLists.txt index ccc7efa6d8d..a4d8a7901e2 100644 --- a/modules/rostests/winetests/version/CMakeLists.txt +++ b/modules/rostests/winetests/version/CMakeLists.txt @@ -1,10 +1,4 @@ -add_definitions(-DUSE_WINE_TODOS) - -if(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE info.c install.c @@ -14,7 +8,11 @@ add_executable(version_winetest ${SOURCE} version.rc) set_module_type(version_winetest win32cui) add_importlibs(version_winetest shell32 version msvcrt kernel32) -if(MSVC) +target_compile_definitions(version_winetest PRIVATE USE_WINE_TODOS) + +if (NOT MSVC) + target_compile_options(version_winetest PRIVATE -Wno-format-overflow) +else() add_importlibs(version_winetest ntdll) endif() diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index d42b57cbb05..3ebbc049e91 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -48,19 +48,3 @@ function(add_target_link_flags _module _flags) endif() add_target_property(${_module} LINK_FLAGS ${_flags}) endfunction() - -# add_compile_flags -# Add or replace compiler flags in the global scope for either all source -# files or only those of the specified language. -# -# Examples: -# add_compile_flags("-pedantic -O5") -function(add_compile_flags _flags) - if(${ARGC} GREATER 1) - message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}") - endif() - # Adds the compiler flag for all code files: C, C++, and assembly - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" PARENT_SCOPE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE) - set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE) -endfunction() diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index d5a20cba42e..d20abb20473 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -35,18 +35,17 @@ if(USE_DUMMY_PSEH) endif() if(STACK_PROTECTOR) - add_compile_flags(${MODULE} "-fstack-protector-all") + add_compile_options(-fstack-protector-all) endif() # Compiler Core -add_compile_flags("-pipe -fms-extensions -fno-strict-aliasing") +add_compile_options(-pipe -fms-extensions -fno-strict-aliasing) # Prevent GCC from searching any of the default directories. # The case for C++ is handled through the reactos_c++ INTERFACE library add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>") -add_compile_flags("-mstackrealign") -add_compile_flags("-fno-aggressive-loop-optimizations") +add_compile_options(-mstackrealign -fno-aggressive-loop-optimizations) if(CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_options("$<$<COMPILE_LANGUAGE:C>:-std=gnu99;-Wno-microsoft>") @@ -72,81 +71,81 @@ endif() # Debugging if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") if(SEPARATE_DBG) - add_compile_flags("-gdwarf-2 -ggdb") + add_compile_options(-gdwarf-2 -ggdb) else() - add_compile_flags("-gdwarf-2 -gstrict-dwarf") - if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") + add_compile_options(-gdwarf-2 -gstrict-dwarf) + if(NOT CMAKE_C_COMPILER_ID STREQUAL Clang) + add_compile_options(-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols) endif() endif() endif() # Tuning if(ARCH STREQUAL "i386") - add_compile_flags("-march=${OARCH} -mtune=${TUNE}") + add_compile_options(-march=${OARCH} -mtune=${TUNE}) else() - add_compile_flags("-march=${OARCH}") + add_compile_options(-march=${OARCH}) endif() # Warnings, errors -if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) - add_compile_flags("-Werror") +if((NOT CMAKE_BUILD_TYPE STREQUAL "Release") AND (NOT CMAKE_C_COMPILER_ID STREQUAL Clang)) + add_compile_options(-Werror) endif() -add_compile_flags("-Wall -Wpointer-arith") -add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value") -add_compile_flags("-Wno-unused-const-variable") -add_compile_flags("-Wno-unused-local-typedefs") -add_compile_flags("-Wno-deprecated") +add_compile_options(-Wall -Wpointer-arith) +add_compile_options(-Wno-char-subscripts -Wno-multichar -Wno-unused-value) +add_compile_options(-Wno-unused-const-variable) +add_compile_options(-Wno-unused-local-typedefs) +add_compile_options(-Wno-deprecated) if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags("-Wno-maybe-uninitialized") + add_compile_options(-Wno-maybe-uninitialized) endif() if(ARCH STREQUAL "amd64") - add_compile_flags("-Wno-format") + add_compile_options(-Wno-format) elseif(ARCH STREQUAL "arm") - add_compile_flags("-Wno-attributes") + add_compile_options(-Wno-attributes) endif() # Optimizations # FIXME: Revisit this to see if we even need these levels if(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_flags("-O2 -DNDEBUG") + add_compile_options(-O2 -DNDEBUG) else() if(OPTIMIZE STREQUAL "1") - add_compile_flags("-Os -ftracer") + add_compile_options(-Os -ftracer) elseif(OPTIMIZE STREQUAL "2") - add_compile_flags("-Os") + add_compile_options(-Os) elseif(OPTIMIZE STREQUAL "3") - add_compile_flags("-Og") + add_compile_options(-Og) elseif(OPTIMIZE STREQUAL "4") - add_compile_flags("-O1") + add_compile_options(-O1) elseif(OPTIMIZE STREQUAL "5") - add_compile_flags("-O2") + add_compile_options(-O2) elseif(OPTIMIZE STREQUAL "6") - add_compile_flags("-O3") + add_compile_options(-O3) elseif(OPTIMIZE STREQUAL "7") - add_compile_flags("-Ofast") + add_compile_options(-Ofast) endif() endif() # Link-time code generation if(LTCG) - add_compile_flags("-flto -fno-fat-lto-objects") + add_compile_options(-flto -fno-fat-lto-objects) endif() if(ARCH STREQUAL "i386") - add_compile_flags("-fno-optimize-sibling-calls -fno-omit-frame-pointer") + add_compile_options(-fno-optimize-sibling-calls -fno-omit-frame-pointer) if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable") + add_compile_options(-mpreferred-stack-boundary=3 -fno-set-stack-executable) endif() # FIXME: this doesn't work. CMAKE_BUILD_TYPE is always "Debug" if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - add_compile_flags("-momit-leaf-frame-pointer") + add_compile_options(-momit-leaf-frame-pointer) endif() elseif(ARCH STREQUAL "amd64") - add_compile_flags("-mpreferred-stack-boundary=4") + add_compile_options(-mpreferred-stack-boundary=4) endif() # Other diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index f44af850478..8af5b6094c1 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -2,32 +2,29 @@ #if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug") # no optimization - add_compile_flags("/Ob0 /Od") + add_compile_options(/Ob0 /Od) elseif(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_flags("/Ox /Ob2 /Ot /Oy /GT") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /OPT:ICF") + add_compile_options(/Ox /Ob2 /Ot /Oy /GT) elseif(OPTIMIZE STREQUAL "1") - add_compile_flags("/O1") + add_compile_options(/O1) elseif(OPTIMIZE STREQUAL "2") - add_compile_flags("/O2") + add_compile_options(/O2) elseif(OPTIMIZE STREQUAL "3") - add_compile_flags("/Ot /Ox /GS-") + add_compile_options(/Ot /Ox /GS-) elseif(OPTIMIZE STREQUAL "4") - add_compile_flags("/Os /Ox /GS-") + add_compile_options(/Os /Ox /GS-) elseif(OPTIMIZE STREQUAL "5") - add_compile_flags("/Gy /Ob2 /Os /Ox /GS-") + add_compile_options(/Gy /Ob2 /Os /Ox /GS-) endif() # Always use string pooling: this helps reducing the binaries size since a lot # of redundancy come from the usage of __FILE__ / __RELFILE__ in the debugging # helper macros. Note also that GCC builds use string pooling by default. -add_compile_flags("/GF") +add_compile_options(/GF) # Enable function level linking and comdat folding -add_compile_flags("/Gy") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:REF /OPT:ICF") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /OPT:REF /OPT:ICF") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:REF /OPT:ICF") +add_compile_options(/Gy) +add_link_options(/OPT:REF /OPT:ICF) if(ARCH STREQUAL "i386") add_definitions(/DWIN32 /D_WINDOWS) @@ -37,12 +34,11 @@ add_definitions(/Dinline=__inline /D__STDC__=1) # Ignore any "standard" include paths, and do not use any default CRT library. if(NOT USE_CLANG_CL) - add_compile_flags("/X /Zl") + add_compile_options(/X /Zl) endif() -# Disable RTTI, exception handling and buffer security checks by default. -# These require run-time support that may not always be available. -add_compile_flags("/GS-") +# Disable buffer security checks by default. +add_compile_options(/GS-) if(USE_CLANG_CL) set(CMAKE_CL_SHOWINCLUDES_PREFIX "Note: including file: ") @@ -53,29 +49,29 @@ endif() if(ARCH STREQUAL "i386") # Clang's IA32 means i386, which doesn't have cmpxchg8b if(USE_CLANG_CL) - add_compile_flags("-march=${OARCH}") + add_compile_options(-march=${OARCH}) else() - add_compile_flags("/arch:IA32") + add_compile_options(/arch:IA32) endif() endif() # VS 12+ requires /FS when used in parallel compilations if(NOT MSVC_IDE) - add_compile_flags("/FS") + add_compile_options(/FS) endif() # VS14+ tries to use thread-safe initialization -add_compile_flags("/Zc:threadSafeInit-") +add_compile_options(/Zc:threadSafeInit-) # HACK: Disable use of __CxxFrameHandler4 on VS 16.3+ (x64 only) # See
https://developercommunity.visualstudio.com/content/problem/746534/visual-c…
if(ARCH STREQUAL "amd64" AND MSVC_VERSION GREATER 1922) - add_compile_flags("/d2FH4-") - add_link_options("/d2:-FH4-") + add_compile_options(/d2FH4-) + add_link_options(/d2:-FH4-) endif() # Generate Warnings Level 3 -add_compile_flags("/W3") +add_compile_options(/W3) # Disable overly sensitive warnings as well as those that generally aren't # useful to us. @@ -84,10 +80,10 @@ add_compile_flags("/W3") # - C4800: forcing value to bool 'true' or 'false' (performance warning) # - C4200: nonstandard extension used : zero-sized array in struct/union # - C4214: nonstandard extension used : bit field types other than int -add_compile_flags("/wd4244 /wd4290 /wd4800 /wd4200 /wd4214") +add_compile_options(/wd4244 /wd4290 /wd4800 /wd4200 /wd4214) # FIXME: Temporarily disable C4018 until we fix more of the others. CORE-10113 -add_compile_flags("/wd4018") +add_compile_options(/wd4018) # The following warnings are treated as errors: # - C4013: implicit function declaration @@ -122,19 +118,17 @@ endif() # Enable warnings above the default level, but don't treat them as errors: # - C4115: named type definition in parentheses -add_compile_flags("/w14115") +add_compile_options(/w14115) if(USE_CLANG_CL) add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-nostdinc;-Wno-multichar;-Wno-char-subscripts;-Wno-microsoft-enum-forward-reference;-Wno-pragma-pack;-Wno-microsoft-anon-tag;-Wno-parentheses-equality;-Wno-unknown-pragmas>") endif() # Debugging -#if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") if(CMAKE_BUILD_TYPE STREQUAL "Debug") if(NOT (_PREFAST_ OR _VS_ANALYZE_)) - add_compile_flags("/Zi") + add_compile_options(/Zi) endif() -#elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release") elseif(CMAKE_BUILD_TYPE STREQUAL "Release") add_definitions("/D NDEBUG") endif() @@ -155,12 +149,11 @@ endif() if(RUNTIME_CHECKS) add_definitions(-D__RUNTIME_CHECKS__) - add_compile_flags("/RTC1") + add_compile_options(/RTC1) endif() -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4039") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4104 /IGNORE:4039") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4039") +add_link_options(/MANIFEST:NO /INCREMENTAL:NO /SAFESEH:NO /NODEFAULTLIB /RELEASE ${_hotpatch_link_flag} /IGNORE:4039) + set(CMAKE_MSVC_RUNTIME_LIBRARY "") # HACK: Remove the /implib argument, implibs are generated separately @@ -202,7 +195,7 @@ endif() if(_VS_ANALYZE_) message("VS static analysis enabled!") - add_compile_flags("/analyze") + add_compile_options(/analyze) elseif(_PREFAST_) message("PREFAST enabled!") set(CMAKE_C_COMPILE_OBJECT "prefast <CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <INCLUDES> <FLAGS> <DEFINES> /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}" diff --git a/sdk/lib/crt/msvcrtex.cmake b/sdk/lib/crt/msvcrtex.cmake index 66b90d47ed8..b55f53ce659 100644 --- a/sdk/lib/crt/msvcrtex.cmake +++ b/sdk/lib/crt/msvcrtex.cmake @@ -1,13 +1,6 @@ include_directories(include/internal/mingw-w64) -if(NOT MSVC) - add_compile_flags("-Wno-main") - if(LTCG) - add_compile_flags("-fno-lto") - endif() -endif() - list(APPEND MSVCRTEX_SOURCE startup/crtexe.c startup/wcrtexe.c @@ -102,11 +95,19 @@ add_asm_files(msvcrtex_asm ${MSVCRTEX_ASM_SOURCE}) add_library(msvcrtex ${MSVCRTEX_SOURCE} ${msvcrtex_asm}) target_compile_definitions(msvcrtex PRIVATE _DLL _MSVCRTEX_) + +if ((NOT MSVC) OR USE_CLANG_CL) + target_compile_options(msvcrtex PRIVATE $<$<COMPILE_LANGUAGE:C>:-Wno-main>) + if (LTCG) + target_compile_options(msvcrtex PRIVATE -fno-lto) + endif() +endif() + set_source_files_properties(startup/crtdll.c PROPERTIES COMPILE_DEFINITIONS CRTDLL) set_source_files_properties(startup/crtexe.c startup/wcrtexe.c PROPERTIES COMPILE_DEFINITIONS _M_CEE_PURE) -if(NOT MSVC) +if (NOT MSVC) target_link_libraries(msvcrtex oldnames) endif() diff --git a/sdk/lib/drivers/lwip/CMakeLists.txt b/sdk/lib/drivers/lwip/CMakeLists.txt index a0ea078abed..4b70c3c472c 100644 --- a/sdk/lib/drivers/lwip/CMakeLists.txt +++ b/sdk/lib/drivers/lwip/CMakeLists.txt @@ -62,8 +62,6 @@ add_library(lwip ${SOURCE}) add_dependencies(lwip bugcodes xdk) add_pch(lwip precomp.h SOURCE) -if(NOT MSVC) - if(LTCG) - add_compile_flags("-fno-builtin-malloc -fno-builtin-free") - endif() +if((NOT MSVC) AND LTCG) + target_compile_options(lwip PRIVATE -fno-builtin-malloc -fno-builtin-free) endif() diff --git a/sdk/tools/wpp/CMakeLists.txt b/sdk/tools/wpp/CMakeLists.txt index 4eef72c5231..0b68ae806cc 100644 --- a/sdk/tools/wpp/CMakeLists.txt +++ b/sdk/tools/wpp/CMakeLists.txt @@ -12,11 +12,10 @@ if(MSVC) endif() endif() - # Disable warning " unary minus operator applied to unsigned type, result still unsigned" - add_compile_flags("/wd4146") - - # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" - add_compile_flags("/wd4244") + # Disable warnings + add_compile_options( + /wd4146 # " unary minus operator applied to unsigned type, result still unsigned" + /wd4244) # "'=': conversion from 'a' to 'b', possible loss of data" endif()
4 years, 2 months
1
0
0
0
[reactos] 09/12: [CMAKE] Get rid of replace_compiler_option macro
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=84621b3634fb674c7176d…
commit 84621b3634fb674c7176df2ef087b793e2381f89 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 16:54:21 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Get rid of replace_compiler_option macro This is not used anymore --- sdk/cmake/compilerflags.cmake | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index 5da48e6cb53..d42b57cbb05 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -49,27 +49,6 @@ function(add_target_link_flags _module _flags) add_target_property(${_module} LINK_FLAGS ${_flags}) endfunction() -# replace_compiler_option -# (taken from LLVM) -# Replaces a compiler option or switch `_old' in `_var' by `_new'. -# If `_old' is not in `_var', appends `_new' to `_var'. -# -# Example: -# replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2") -macro(replace_compiler_option _var _old _new) - # If the option already is on the variable, don't add it: - if("${${_var}}" MATCHES "(^| )${_new}($| )") - set(__n "") - else() - set(__n "${_new}") - endif() - if("${${_var}}" MATCHES "(^| )${_old}($| )") - string(REGEX REPLACE "(^| )${_old}($| )" " ${__n} " ${_var} "${${_var}}") - else() - set(${_var} "${${_var}} ${__n}") - endif() -endmacro(replace_compiler_option) - # add_compile_flags # Add or replace compiler flags in the global scope for either all source # files or only those of the specified language.
4 years, 2 months
1
0
0
0
[reactos] 08/12: [CMAKE] Use -ffile-prefix-map for GCC builds
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=683489ccf16759c3aac6a…
commit 683489ccf16759c3aac6a70ed664b2998f7c04d1 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 16:19:46 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Use -ffile-prefix-map for GCC builds And also simplify the __RELFILE__ macro definition for the other cases --- CMakeLists.txt | 15 ++++++++++----- sdk/cmake/gcc.cmake | 12 ------------ 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cefcc5f93ae..3de95fe75c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,13 +44,18 @@ include(sdk/cmake/compilerflags.cmake) add_definitions(-D__REACTOS__) -# Double escape, since CMake unescapes before putting it on the command-line, where it's unescaped again by GCC/CL. -add_definitions(-DREACTOS_SOURCE_DIR="${REACTOS_SOURCE_DIR}") -add_definitions(-DREACTOS_BINARY_DIR="${REACTOS_BINARY_DIR}") - # There doesn't seem to be a standard for __FILE__ being relative or absolute, so detect it at runtime. file(RELATIVE_PATH _PATH_PREFIX ${REACTOS_BINARY_DIR} ${REACTOS_SOURCE_DIR}) -add_compile_flags(-D__RELFILE__="&__FILE__[__FILE__[0] == '.' ? sizeof \\\"${_PATH_PREFIX}\\\" - 1 : sizeof REACTOS_SOURCE_DIR]") +if (GCC AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0.0")) + # Thankfully, GCC has this + add_compile_options(-ffile-prefix-map=${REACTOS_SOURCE_DIR}=) + add_compile_options(-ffile-prefix-map=${_PATH_PREFIX}=) +else() + string(LENGTH ${_PATH_PREFIX} _PATH_PREFIX_LENGTH) + string(LENGTH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_LENGTH) + math(EXPR REACTOS_SOURCE_DIR_LENGTH "${REACTOS_SOURCE_DIR_LENGTH} + 1") + add_compile_definitions("__RELFILE__=&__FILE__[__FILE__[0] == '.' ? ${_PATH_PREFIX_LENGTH} : ${REACTOS_SOURCE_DIR_LENGTH}]") +endif() if(MSVC_IDE) add_compile_flags("/MP") diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 3ef5f58598a..d5a20cba42e 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -69,18 +69,6 @@ if(DBG) endif() endif() -#bug -#file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE) -#workaround -set(REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) - if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") -string(REPLACE "/" "\\" REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) -endif() - -if((NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") AND (NOT SEPARATE_DBG)) - add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS") -endif() - # Debugging if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") if(SEPARATE_DBG)
4 years, 2 months
1
0
0
0
[reactos] 07/12: [CMAKE] Get rid of add_compile_flags_language macro
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ed615122367bae5418663…
commit ed615122367bae54186637a3a3e34bb6418c9496 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 16:18:24 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Get rid of add_compile_flags_language macro in favor of add_compile_options and the like with generator expressions Also take this as an opportunity to remove the C++11 standard hack, GCC 8 now defaults to C++14 --- base/applications/charmap_new/CMakeLists.txt | 5 ----- base/applications/network/telnet/CMakeLists.txt | 14 ++++---------- dll/shellext/acppage/CMakeLists.txt | 5 ----- dll/shellext/mydocs/CMakeLists.txt | 5 ----- dll/shellext/netshell/CMakeLists.txt | 6 ------ dll/shellext/ntobjshex/CMakeLists.txt | 5 ----- dll/shellext/sendmail/CMakeLists.txt | 5 ----- dll/shellext/shellbtrfs/CMakeLists.txt | 4 ---- dll/shellext/stobject/CMakeLists.txt | 5 ----- dll/shellext/zipfldr/CMakeLists.txt | 7 ------- dll/win32/devmgr/CMakeLists.txt | 5 ----- dll/win32/shell32/CMakeLists.txt | 5 ----- drivers/network/dd/netkvm/CMakeLists.txt | 17 +++++++++-------- modules/rostests/apitests/browseui/CMakeLists.txt | 6 +----- sdk/cmake/compilerflags.cmake | 11 ----------- sdk/cmake/gcc.cmake | 4 ++-- sdk/cmake/msvc.cmake | 3 +-- sdk/tools/CMakeLists.txt | 4 ++-- win32ss/CMakeLists.txt | 7 +------ 19 files changed, 20 insertions(+), 103 deletions(-) diff --git a/base/applications/charmap_new/CMakeLists.txt b/base/applications/charmap_new/CMakeLists.txt index 06616bf0bca..c9198f5f9b1 100644 --- a/base/applications/charmap_new/CMakeLists.txt +++ b/base/applications/charmap_new/CMakeLists.txt @@ -1,10 +1,5 @@ PROJECT(CHARMAP) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - include_directories( includes) diff --git a/base/applications/network/telnet/CMakeLists.txt b/base/applications/network/telnet/CMakeLists.txt index acd2aa06cba..d77a95cc8bd 100644 --- a/base/applications/network/telnet/CMakeLists.txt +++ b/base/applications/network/telnet/CMakeLists.txt @@ -1,10 +1,4 @@ -add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) - -if(NOT MSVC) - add_compile_flags("-Wno-restrict") -endif() - list(APPEND SOURCE src/ansiprsr.cpp src/keytrans.cpp @@ -27,13 +21,13 @@ list(APPEND SOURCE src/ttelhndl.cpp precomp.h) -if(NOT MSVC) - add_compile_flags_language("-Wno-narrowing" "CXX") -endif() - add_executable(telnet ${SOURCE} telnet.rc) target_link_libraries(telnet cppstl) set_target_cpp_properties(telnet WITH_EXCEPTIONS) +if (NOT MSVC) + target_compile_options(telnet PRIVATE -Wno-restrict $<$<COMPILE_LANGUAGE:CXX>:-Wno-narrowing>) + target_compile_definitions(telnet PRIVATE _CRT_NONSTDC_NO_DEPRECATE) +endif() set_module_type(telnet win32cui) add_importlibs(telnet ws2_32 user32 msvcrt kernel32 ntdll) add_pch(telnet precomp.h SOURCE) diff --git a/dll/shellext/acppage/CMakeLists.txt b/dll/shellext/acppage/CMakeLists.txt index fe694f869f2..f38c77c50ce 100644 --- a/dll/shellext/acppage/CMakeLists.txt +++ b/dll/shellext/acppage/CMakeLists.txt @@ -1,11 +1,6 @@ project(appcompat) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - include_directories( ${REACTOS_SOURCE_DIR}/dll/appcompat/apphelp ${REACTOS_SOURCE_DIR}) diff --git a/dll/shellext/mydocs/CMakeLists.txt b/dll/shellext/mydocs/CMakeLists.txt index b74998e6603..5c1b170faa5 100644 --- a/dll/shellext/mydocs/CMakeLists.txt +++ b/dll/shellext/mydocs/CMakeLists.txt @@ -3,11 +3,6 @@ spec2def(mydocs.dll mydocs.spec) add_definitions( -D_WINE) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - file(GLOB_RECURSE mydocs_rc_deps res/*.*) add_rc_deps(mydocs.rc ${mydocs_rc_deps}) diff --git a/dll/shellext/netshell/CMakeLists.txt b/dll/shellext/netshell/CMakeLists.txt index 48ce800d927..30efec78ffa 100644 --- a/dll/shellext/netshell/CMakeLists.txt +++ b/dll/shellext/netshell/CMakeLists.txt @@ -1,12 +1,6 @@ project(SHELL) - -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11 -Wshadow" "CXX") -endif() - remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/dll/shellext/ntobjshex/CMakeLists.txt b/dll/shellext/ntobjshex/CMakeLists.txt index 3ecdae1a263..f5ce057c572 100644 --- a/dll/shellext/ntobjshex/CMakeLists.txt +++ b/dll/shellext/ntobjshex/CMakeLists.txt @@ -1,11 +1,6 @@ project(SHELL) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - spec2def(ntobjshex.dll ntobjshex.spec) file(GLOB_RECURSE ntobjshex_rc_deps resources/*.*) diff --git a/dll/shellext/sendmail/CMakeLists.txt b/dll/shellext/sendmail/CMakeLists.txt index 5adbf3a847f..5271729ae82 100644 --- a/dll/shellext/sendmail/CMakeLists.txt +++ b/dll/shellext/sendmail/CMakeLists.txt @@ -3,11 +3,6 @@ spec2def(sendmail.dll sendmail.spec) add_definitions( -D_WINE) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - file(GLOB_RECURSE sendmail_rc_deps res/*.*) add_rc_deps(sendmail.rc ${sendmail_rc_deps}) diff --git a/dll/shellext/shellbtrfs/CMakeLists.txt b/dll/shellext/shellbtrfs/CMakeLists.txt index 7a21c8aa6de..6cbd3b04271 100644 --- a/dll/shellext/shellbtrfs/CMakeLists.txt +++ b/dll/shellext/shellbtrfs/CMakeLists.txt @@ -2,10 +2,6 @@ remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x603) -if(NOT MSVC) - add_compile_flags_language("-std=c++11" "CXX") -endif() - include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems/btrfs) spec2def(shellbtrfs.dll shellbtrfs.spec) diff --git a/dll/shellext/stobject/CMakeLists.txt b/dll/shellext/stobject/CMakeLists.txt index f5c67cc58f6..b8b18915cab 100644 --- a/dll/shellext/stobject/CMakeLists.txt +++ b/dll/shellext/stobject/CMakeLists.txt @@ -1,11 +1,6 @@ project(SHELL) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - spec2def(stobject.dll stobject.spec) file(GLOB_RECURSE stobject_rc_deps resources/*.*) diff --git a/dll/shellext/zipfldr/CMakeLists.txt b/dll/shellext/zipfldr/CMakeLists.txt index 106a8860f74..1706cddb105 100644 --- a/dll/shellext/zipfldr/CMakeLists.txt +++ b/dll/shellext/zipfldr/CMakeLists.txt @@ -1,9 +1,4 @@ -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) @@ -13,7 +8,6 @@ include_directories( spec2def(zipfldr.dll zipfldr.spec ADD_IMPORTLIB) - list(APPEND SOURCE zipfldr.cpp zippidl.cpp @@ -40,7 +34,6 @@ add_library(zipfldr MODULE zipfldr.rc ${CMAKE_CURRENT_BINARY_DIR}/zipfldr.def) - set_module_type(zipfldr win32dll UNICODE) target_link_libraries(zipfldr minizip zlib uuid cpprt atl_classes) set_target_cpp_properties(zipfldr WITH_EXCEPTIONS) diff --git a/dll/win32/devmgr/CMakeLists.txt b/dll/win32/devmgr/CMakeLists.txt index e86615f6e25..c4833caf662 100644 --- a/dll/win32/devmgr/CMakeLists.txt +++ b/dll/win32/devmgr/CMakeLists.txt @@ -2,11 +2,6 @@ PROJECT(DEVMGR) spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll includes) diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 464ef62774b..4525db49984 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -6,11 +6,6 @@ add_subdirectory(shellrecyclebin) 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() - remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/drivers/network/dd/netkvm/CMakeLists.txt b/drivers/network/dd/netkvm/CMakeLists.txt index 73a4a2fe323..ac916e92cab 100644 --- a/drivers/network/dd/netkvm/CMakeLists.txt +++ b/drivers/network/dd/netkvm/CMakeLists.txt @@ -27,12 +27,13 @@ add_cd_file(TARGET netkvm DESTINATION reactos/system32/drivers FOR all) add_driver_inf(netkvm netkvm.inf) if(NOT MSVC) - add_compile_flags("-Wno-unused-function") - add_compile_flags("-Wno-old-style-declaration") - add_compile_flags("-Wno-unknown-pragmas") - add_compile_flags("-Wno-unused-but-set-variable") - add_compile_flags("-Wno-pointer-sign") - add_compile_flags("-Wno-pointer-to-int-cast") - add_compile_flags("-Wno-int-to-pointer-cast") - add_compile_flags("-Wno-attributes") + target_compile_options(netkvm PRIVATE + -Wno-unused-function + -Wno-old-style-declaration + -Wno-unknown-pragmas + -Wno-unused-but-set-variable + -Wno-pointer-sign + -Wno-pointer-to-int-cast + -Wno-int-to-pointer-cast + -Wno-attributes) endif() diff --git a/modules/rostests/apitests/browseui/CMakeLists.txt b/modules/rostests/apitests/browseui/CMakeLists.txt index f1875d3a03f..efae63cf8d9 100644 --- a/modules/rostests/apitests/browseui/CMakeLists.txt +++ b/modules/rostests/apitests/browseui/CMakeLists.txt @@ -1,9 +1,4 @@ -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - include_directories( includes) @@ -15,6 +10,7 @@ list(APPEND SOURCE testlist.c) add_executable(browseui_apitest ${SOURCE}) + 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) diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index c644ee21fc4..5da48e6cb53 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -71,13 +71,11 @@ macro(replace_compiler_option _var _old _new) endmacro(replace_compiler_option) # add_compile_flags -# add_compile_flags_language # Add or replace compiler flags in the global scope for either all source # files or only those of the specified language. # # Examples: # add_compile_flags("-pedantic -O5") -# add_compile_flags_language("-std=gnu99" "C") function(add_compile_flags _flags) if(${ARGC} GREATER 1) message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}") @@ -87,12 +85,3 @@ function(add_compile_flags _flags) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" PARENT_SCOPE) set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${_flags}" PARENT_SCOPE) endfunction() - -function(add_compile_flags_language _flags _lang) - if(NOT ${ARGC} EQUAL 2) - message(FATAL_ERROR "Wrong arguments to add_compile_flags_language! Args ${ARGN}") - endif() - # Adds the compiler flag for the specified language only, e.g. CMAKE_C_FLAGS - set(CMAKE_${_lang}_FLAGS "${CMAKE_${_lang}_FLAGS} ${_flags}" PARENT_SCOPE) -endfunction() - diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index cf72baeeea4..3ef5f58598a 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -49,7 +49,7 @@ add_compile_flags("-mstackrealign") add_compile_flags("-fno-aggressive-loop-optimizations") if(CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags_language("-std=gnu99 -Wno-microsoft" "C") + add_compile_options("$<$<COMPILE_LANGUAGE:C>:-std=gnu99;-Wno-microsoft>") set(CMAKE_LINK_DEF_FILE_FLAG "") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") set(CMAKE_LINK_LIBRARY_SUFFIX "") @@ -65,7 +65,7 @@ endif() if(DBG) if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") - add_compile_flags_language("-Wold-style-declaration" "C") + add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>") endif() endif() diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index 92d5bf41053..f44af850478 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -125,8 +125,7 @@ endif() add_compile_flags("/w14115") if(USE_CLANG_CL) - add_compile_flags_language("-nostdinc -Wno-multichar -Wno-char-subscripts -Wno-microsoft-enum-forward-reference -Wno-pragma-pack -Wno-microsoft-anon-tag -Wno-parentheses-equality -Wno-unknown-pragmas" "C") - add_compile_flags_language("-nostdinc -Wno-multichar -Wno-char-subscripts -Wno-microsoft-enum-forward-reference -Wno-pragma-pack -Wno-microsoft-anon-tag -Wno-parentheses-equality -Wno-unknown-pragmas" "CXX") + add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-nostdinc;-Wno-multichar;-Wno-char-subscripts;-Wno-microsoft-enum-forward-reference;-Wno-pragma-pack;-Wno-microsoft-anon-tag;-Wno-parentheses-equality;-Wno-unknown-pragmas>") endif() # Debugging diff --git a/sdk/tools/CMakeLists.txt b/sdk/tools/CMakeLists.txt index f9e0e19f5f4..3b6bf1368f0 100644 --- a/sdk/tools/CMakeLists.txt +++ b/sdk/tools/CMakeLists.txt @@ -6,10 +6,10 @@ endfunction() if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_IO_H=1) - add_compile_flags_language("/EHsc" "CXX") + add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/EHsc>") # Disable warning "conversion from 'size_t' to 'int', possible loss of data" - add_compile_flags("/wd4267") + add_compile_options("/wd4267") endif() add_host_tool(bin2c bin2c.c) diff --git a/win32ss/CMakeLists.txt b/win32ss/CMakeLists.txt index e3be784a27f..b74e41f0361 100644 --- a/win32ss/CMakeLists.txt +++ b/win32ss/CMakeLists.txt @@ -1,11 +1,6 @@ set(USE_DIBLIB FALSE) -if(NOT MSVC) - # HACK: this should be enabled globally! - add_compile_flags_language("-std=c++11" "CXX") -endif() - # Give WIN32 subsystem its own project. PROJECT(WIN32SS) @@ -247,4 +242,4 @@ set_source_files_properties(sys-stubs.S PROPERTIES OBJECT_DEPENDS ${CMAKE_CURREN add_asm_files(win32ksys_asm sys-stubs.S) add_library(win32ksys ${win32ksys_asm}) set_target_properties(win32ksys PROPERTIES LINKER_LANGUAGE "C") -add_dependencies(win32ksys asm) \ No newline at end of file +add_dependencies(win32ksys asm)
4 years, 2 months
1
0
0
0
[reactos] 06/12: [CMAKE] Get rid of replace_compile_flags
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7e116f0ef368e8fbd7e87…
commit 7e116f0ef368e8fbd7e87a1ae13f69c4cc8b58c1 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 11:49:18 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Get rid of replace_compile_flags Introduce a finer-grained remove_target_compile_option instead --- base/applications/wordpad/CMakeLists.txt | 10 +++++----- base/services/nfsd/CMakeLists.txt | 9 +++------ boot/freeldr/freeldr/CMakeLists.txt | 7 ++++--- dll/3rdparty/libtiff/CMakeLists.txt | 16 +++++++--------- dll/3rdparty/libtirpc/CMakeLists.txt | 20 +++++++++----------- dll/win32/clusapi/CMakeLists.txt | 11 ++++++----- dll/win32/comctl32/CMakeLists.txt | 6 ++++-- dll/win32/crypt32/CMakeLists.txt | 10 +++++----- dll/win32/dbghelp/CMakeLists.txt | 8 +++----- dll/win32/mshtml/CMakeLists.txt | 10 +++++----- dll/win32/msi/CMakeLists.txt | 16 ++++++++-------- dll/win32/msrle32/CMakeLists.txt | 11 ++++++----- dll/win32/shell32/CMakeLists.txt | 10 +++++----- dll/win32/windowscodecs/CMakeLists.txt | 10 +++++----- dll/win32/winmm/CMakeLists.txt | 11 ++++++----- dll/win32/winmm/midimap/CMakeLists.txt | 11 ++++++----- drivers/filesystems/ext2/CMakeLists.txt | 4 ++-- drivers/filesystems/reiserfs/CMakeLists.txt | 4 ++-- modules/rostests/winetests/CMakeLists.txt | 20 +++++++++++--------- modules/rostests/winetests/comctl32/CMakeLists.txt | 4 +--- modules/rostests/winetests/gdiplus/CMakeLists.txt | 10 +++++----- modules/rostests/winetests/kernel32/CMakeLists.txt | 10 +++++----- modules/rostests/winetests/user32/CMakeLists.txt | 14 +++++++------- sdk/cmake/compilerflags.cmake | 20 +++++++++----------- sdk/cmake/msvc.cmake | 6 +++--- sdk/lib/3rdparty/freetype/CMakeLists.txt | 10 ++++------ sdk/lib/3rdparty/libxml2/CMakeLists.txt | 4 ++-- 27 files changed, 138 insertions(+), 144 deletions(-) diff --git a/base/applications/wordpad/CMakeLists.txt b/base/applications/wordpad/CMakeLists.txt index 4953dd84bbc..759331f3546 100644 --- a/base/applications/wordpad/CMakeLists.txt +++ b/base/applications/wordpad/CMakeLists.txt @@ -4,11 +4,6 @@ remove_definitions(-D_WIN32_IE=0x600) add_definitions(-D__ROS_LONG64__) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) -if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") -endif() - list(APPEND SOURCE olecallback.c print.c @@ -22,3 +17,8 @@ set_module_type(wordpad win32gui) target_link_libraries(wordpad wine uuid) add_importlibs(wordpad comdlg32 ole32 shell32 user32 gdi32 advapi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET wordpad DESTINATION reactos/system32 FOR all) + +if(MSVC) + # Disable warning C4477 (printf format warnings) + target_compile_options(wordpad PRIVATE /wd4477) +endif() diff --git a/base/services/nfsd/CMakeLists.txt b/base/services/nfsd/CMakeLists.txt index 0da38928297..5726c898cb6 100644 --- a/base/services/nfsd/CMakeLists.txt +++ b/base/services/nfsd/CMakeLists.txt @@ -7,12 +7,7 @@ include_directories( ${REACTOS_SOURCE_DIR}/drivers/filesystems/nfs ${REACTOS_SOURCE_DIR}/dll/np/nfs) -if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") -endif() - -list(APPEND SOURCE +list(APPEND SOURCE acl.c callback_server.c callback_xdr.c @@ -54,6 +49,8 @@ list(APPEND SOURCE add_executable(nfsd ${SOURCE} nfsd.rc) if(MSVC AND (NOT USE_CLANG_CL)) + # Disable warning C4477 (printf format warnings) + target_compile_options(nfsd PRIVATE "/wd4477") else() # FIXME: Tons of warnings. target_compile_options(nfsd PRIVATE "-w") diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 41d4ab68c86..80bea8f1f41 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -7,9 +7,6 @@ if(SEPARATE_DBG) endif() if(MSVC) - # We don't need hotpatching - replace_compile_flags("/hotpatch" " ") - # Explicitly use string pooling add_compile_flags("/GF") endif() @@ -285,6 +282,10 @@ if(MSVC) add_target_link_flags(freeldr_pe_dbg "/ignore:4078 /ignore:4254 /DRIVER /FIXED /FILEALIGN:0x200 /ALIGN:0x200") add_linker_script(freeldr_pe_dbg freeldr_i386.msvc.lds) endif() + # We don't need hotpatching + remove_target_compile_option(freeldr_pe "/hotpatch") + remove_target_compile_option(freeldr_pe_dbg "/hotpatch") + remove_target_compile_option(freeldr_common "/hotpatch") else() add_target_link_flags(freeldr_pe "-Wl,--strip-all,--exclude-all-symbols,--file-alignment,0x200,--section-alignment,0x200") add_linker_script(freeldr_pe freeldr_i386.lds) diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index c8c388ba702..470cbba14c8 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -5,14 +5,6 @@ add_definitions( -DUSE_WIN32_FILEIO -DTIF_PLATFORM_CONSOLE) -if(MSVC) - # error C4311: 'type cast': pointer truncation from 'thandle_t' to 'int' - replace_compile_flags("/we4311" " ") - - # error C4312: 'type cast': conversion from 'int' to 'thandle_t' of greater size - replace_compile_flags("/we4312" " ") -endif() - include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libtiff ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) @@ -63,12 +55,18 @@ list(APPEND SOURCE precomp.h) add_library(libtiff MODULE ${SOURCE} libtiff.def) + set_module_type(libtiff win32dll) target_link_libraries(libtiff zlib getopt) add_importlibs(libtiff user32 msvcrt kernel32 ntdll) add_pch(libtiff precomp.h SOURCE) add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) -if(NOT MSVC) +if (MSVC) + # error C4311: 'type cast': pointer truncation from 'thandle_t' to 'int' + remove_target_compile_option(libtiff "/we4311") + # error C4312: 'type cast': conversion from 'int' to 'thandle_t' of greater size + remove_target_compile_option(libtiff "/we4312") +else() target_compile_options(libtiff PRIVATE "-Wno-unused-but-set-variable") endif() diff --git a/dll/3rdparty/libtirpc/CMakeLists.txt b/dll/3rdparty/libtirpc/CMakeLists.txt index 207ccb87a98..0ef4cc49132 100644 --- a/dll/3rdparty/libtirpc/CMakeLists.txt +++ b/dll/3rdparty/libtirpc/CMakeLists.txt @@ -6,14 +6,6 @@ add_definitions(-DUNICODE -D_WIN32 -DPORTMAP -Dstrdup=_strdup -D_CRT_NONSTDC_NO_ include_directories(${REACTOS_SOURCE_DIR}/dll/3rdparty/libtirpc/tirpc) -if(MSVC) - # error C4133: '=': incompatible types - from 'char *' to 'int32_t *' - replace_compile_flags("/we4133" " ") - - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4313") -endif() - list(APPEND SOURCE src/asprintf.c # src/auth_des.c @@ -101,9 +93,15 @@ add_library(libtirpc MODULE libtirpc/libtirpc_ros.rc ${CMAKE_CURRENT_BINARY_DIR}/libtirpc.def) -if(MSVC AND (NOT USE_CLANG_CL)) - replace_compile_flags("/we4101" " ") - target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477) +if(MSVC) + # error C4133: '=': incompatible types - from 'char *' to 'int32_t *' + remove_target_compile_option(libtirpc "/we4133") + # Disable warning C4477 (printf format warnings) + target_compile_options(libtirpc PRIVATE /wd4313) + if (NOT USE_CLANG_CL) + remove_target_compile_option(libtirpc "/we4101") + target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477) + endif() else() # FIXME: Tons of warnings. target_compile_options(libtirpc PRIVATE "-w") diff --git a/dll/win32/clusapi/CMakeLists.txt b/dll/win32/clusapi/CMakeLists.txt index 40cfdd21f24..b060e4b94df 100644 --- a/dll/win32/clusapi/CMakeLists.txt +++ b/dll/win32/clusapi/CMakeLists.txt @@ -3,17 +3,18 @@ add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(clusapi.dll clusapi.spec) -if(MSVC) - # error C4312: 'type cast': conversion from 'unsigned int' to 'HCLUSTER' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE clusapi.c ${CMAKE_CURRENT_BINARY_DIR}/clusapi_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/clusapi.def) add_library(clusapi MODULE ${SOURCE}) + +if(MSVC) + # error C4312: 'type cast': conversion from 'unsigned int' to 'HCLUSTER' of greater size + remove_target_compile_option(clusapi "/we4312") +endif() + set_module_type(clusapi win32dll) target_link_libraries(clusapi wine) add_importlibs(clusapi msvcrt kernel32 ntdll) diff --git a/dll/win32/comctl32/CMakeLists.txt b/dll/win32/comctl32/CMakeLists.txt index d60f18a1696..4d70e28eecc 100644 --- a/dll/win32/comctl32/CMakeLists.txt +++ b/dll/win32/comctl32/CMakeLists.txt @@ -12,8 +12,7 @@ include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(comctl32.dll comctl32.spec ADD_IMPORTLIB) if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") + endif() list(APPEND SOURCE @@ -65,6 +64,9 @@ add_library(comctl32 MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/comctl32.def) +# Disable warning C4477 (printf format warnings) +target_compile_options(comctl32 PRIVATE $<$<BOOL:${MSVC}>:/wd4477>) + set_module_type(comctl32 win32dll UNICODE) target_link_libraries(comctl32 uuid wine ${PSEH_LIB}) add_delay_importlibs(comctl32 winmm uxtheme) diff --git a/dll/win32/crypt32/CMakeLists.txt b/dll/win32/crypt32/CMakeLists.txt index b9ccf7b85dc..6bb17abc850 100644 --- a/dll/win32/crypt32/CMakeLists.txt +++ b/dll/win32/crypt32/CMakeLists.txt @@ -11,11 +11,6 @@ add_definitions( include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(crypt32.dll crypt32.spec ADD_IMPORTLIB) -if(MSVC) - # error C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE base64.c cert.c @@ -51,6 +46,11 @@ add_library(crypt32 MODULE crypt32.rc ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def) +if(MSVC) + # error C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size + remove_target_compile_option(crypt32 "/we4312") +endif() + set_module_type(crypt32 win32dll) target_link_libraries(crypt32 wine ${PSEH_LIB} oldnames) add_delay_importlibs(crypt32 cryptnet) diff --git a/dll/win32/dbghelp/CMakeLists.txt b/dll/win32/dbghelp/CMakeLists.txt index 508a9692842..b72e79e7584 100644 --- a/dll/win32/dbghelp/CMakeLists.txt +++ b/dll/win32/dbghelp/CMakeLists.txt @@ -1,9 +1,4 @@ -if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") -endif() - if(NOT CMAKE_CROSSCOMPILING) add_definitions(-DDBGHELP_STATIC_LIB) @@ -85,4 +80,7 @@ else() add_pch(dbghelp precomp.h SOURCE) add_cd_file(TARGET dbghelp DESTINATION reactos/system32 FOR all) + if (MSVC) + target_compile_options(dbghelp PRIVATE /wd4477) + endif() endif() diff --git a/dll/win32/mshtml/CMakeLists.txt b/dll/win32/mshtml/CMakeLists.txt index a225f25d64f..327e719aa0c 100644 --- a/dll/win32/mshtml/CMakeLists.txt +++ b/dll/win32/mshtml/CMakeLists.txt @@ -11,11 +11,6 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) add_idl_headers(mshtml_nsiface_header nsiface.idl) spec2def(mshtml.dll mshtml.spec ADD_IMPORTLIB) -if(MSVC) - # error C4028: formal parameter 3 different from declaration - replace_compile_flags("/we4028" " ") -endif() - list(APPEND SOURCE conpoint.c dispex.c @@ -105,6 +100,11 @@ add_library(mshtml MODULE rsrc.rc ${CMAKE_CURRENT_BINARY_DIR}/mshtml.def) +if(MSVC) + # error C4028: formal parameter 3 different from declaration + remove_target_compile_option(mshtml "/we4028") +endif() + list(APPEND mshtml_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/blank.htm ${CMAKE_CURRENT_SOURCE_DIR}/mshtml.inf diff --git a/dll/win32/msi/CMakeLists.txt b/dll/win32/msi/CMakeLists.txt index 106f6817851..73600cf4c6b 100644 --- a/dll/win32/msi/CMakeLists.txt +++ b/dll/win32/msi/CMakeLists.txt @@ -7,14 +7,6 @@ add_definitions(-D__WINESRC__ -D__ROS_LONG64__ -DMSIRUNMODE=MSIRUNMODE_T) spec2def(msi.dll msi.spec ADD_IMPORTLIB) generate_idl_iids(msiserver.idl) -if(MSVC) - # error C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *' - replace_compile_flags("/we4133" " ") - - # error C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE action.c alter.c @@ -71,6 +63,14 @@ add_library(msi MODULE msi.rc ${CMAKE_CURRENT_BINARY_DIR}/msi.def) +if(MSVC) + # error C4133: 'function': incompatible types - from 'UINT *' to 'MSIINSTALLCONTEXT *' + remove_target_compile_option(msi "/we4133") + + # error C4312: 'type cast': conversion from 'unsigned int' to 'HANDLE' of greater size + remove_target_compile_option(msi "/we4312") +endif() + add_idl_headers(msi_idlheader msiserver.idl) add_typelib(msiserver.idl) set_source_files_properties(msi.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/msiserver.tlb) diff --git a/dll/win32/msrle32/CMakeLists.txt b/dll/win32/msrle32/CMakeLists.txt index 04706201560..85311b2fad5 100644 --- a/dll/win32/msrle32/CMakeLists.txt +++ b/dll/win32/msrle32/CMakeLists.txt @@ -3,16 +3,17 @@ add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(msrle32.dll msrle32.spec) -if(MSVC) - # error C4312: 'type cast': conversion from 'unsigned int' to 'LPVOID' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE msrle32.c ${CMAKE_CURRENT_BINARY_DIR}/msrle32.def) add_library(msrle32 MODULE ${SOURCE} rsrc.rc) + +if(MSVC) + # error C4312: 'type cast': conversion from 'unsigned int' to 'LPVOID' of greater size + remove_target_compile_option(msrle32 "/we4312") +endif() + set_module_type(msrle32 win32dll) target_link_libraries(msrle32 wine) add_importlibs(msrle32 winmm user32 msvcrt kernel32 ntdll) diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 88a11e013c8..464ef62774b 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -11,11 +11,6 @@ if(NOT MSVC) 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) @@ -112,6 +107,11 @@ add_library(shell32 MODULE shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) +if (MSVC) + # error C4311: 'type cast': pointer truncation from 'HANDLE' to 'INT' + remove_target_compile_option(shell32 "/we4311") +endif() + add_typelib(shell32_shldisp.idl) set_source_files_properties(shell32.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/shell32_shldisp.tlb) diff --git a/dll/win32/windowscodecs/CMakeLists.txt b/dll/win32/windowscodecs/CMakeLists.txt index ff726c88162..fd29c68ad48 100644 --- a/dll/win32/windowscodecs/CMakeLists.txt +++ b/dll/win32/windowscodecs/CMakeLists.txt @@ -9,11 +9,6 @@ add_definitions( remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) -if(MSVC) - # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' - replace_compile_flags("/we4133" " ") -endif() - include_directories( BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/libjpeg @@ -79,6 +74,11 @@ add_library(windowscodecs MODULE version.rc ${CMAKE_CURRENT_BINARY_DIR}/windowscodecs.def) +if(MSVC) + # error C4133: 'function': incompatible types - from 'WICPixelFormatNumericRepresentation *' to 'DWORD *' + remove_target_compile_option(windowscodecs "/we4133") +endif() + set_module_type(windowscodecs win32dll) target_link_libraries(windowscodecs wine uuid ${PSEH_LIB}) add_importlibs(windowscodecs ole32 oleaut32 rpcrt4 shlwapi user32 gdi32 advapi32 advapi32_vista propsys msvcrt kernel32 ntdll) diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index fd746a2bafb..640ebf63081 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -3,11 +3,6 @@ add_definitions(-D_WINE) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) spec2def(winmm.dll winmm.spec ADD_IMPORTLIB) -if(MSVC) - # error C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE driver.c joystick.c @@ -26,6 +21,12 @@ add_library(winmm MODULE winmm_res.rc ${CMAKE_CURRENT_BINARY_DIR}/winmm.def) + +if(MSVC) + # error C4312: 'type cast': conversion from 'DWORD' to 'HTASK' of greater size + remove_target_compile_option(winmm "/we4312") +endif() + set_module_type(winmm win32dll) target_link_libraries(winmm wine ${PSEH_LIB}) add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) diff --git a/dll/win32/winmm/midimap/CMakeLists.txt b/dll/win32/winmm/midimap/CMakeLists.txt index cc35e2b0809..2e4aaa22403 100644 --- a/dll/win32/winmm/midimap/CMakeLists.txt +++ b/dll/win32/winmm/midimap/CMakeLists.txt @@ -1,17 +1,18 @@ spec2def(midimap.dll midimap.spec) -if(MSVC) - # error C4133: 'function': incompatible types - from 'LPDWORD' to 'DWORD_PTR *' - replace_compile_flags("/we4133" " ") -endif() - add_library(midimap MODULE midimap.c midimap.rc ${CMAKE_CURRENT_BINARY_DIR}/midimap.def) set_module_type(midimap win32dll UNICODE) + +if(MSVC) + # error C4133: 'function': incompatible types - from 'LPDWORD' to 'DWORD_PTR *' + remove_target_compile_option(midimap "/we4133") +endif() + target_link_libraries(midimap uuid wine) add_importlibs(midimap advapi32 user32 winmm msvcrt kernel32 ntdll) add_cd_file(TARGET midimap DESTINATION reactos/system32 FOR all) diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index b362a60f56d..38851437730 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -94,8 +94,8 @@ endif() if(MSVC AND (NOT USE_CLANG_CL)) # Disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include" - replace_compile_flags("/we4101" " ") - replace_compile_flags("/we4189" " ") + remove_target_compile_option(ext2fs "/we4101") + remove_target_compile_option(ext2fs "/we4189") target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101) else() target_compile_options(ext2fs PRIVATE -Wno-pointer-sign -Wno-unused-function) diff --git a/drivers/filesystems/reiserfs/CMakeLists.txt b/drivers/filesystems/reiserfs/CMakeLists.txt index cd939d40b85..b921bbfa250 100644 --- a/drivers/filesystems/reiserfs/CMakeLists.txt +++ b/drivers/filesystems/reiserfs/CMakeLists.txt @@ -87,8 +87,8 @@ if(USE_CLANG_CL OR (NOT MSVC)) endif() else() #disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include" - replace_compile_flags("/we4101" " ") - replace_compile_flags("/we4189" " ") + remove_target_compile_option(reiserfs "/we4101") + remove_target_compile_option(reiserfs "/we4189") target_compile_options(reiserfs PRIVATE /wd4189 /wd4142 /wd4101) endif() diff --git a/modules/rostests/winetests/CMakeLists.txt b/modules/rostests/winetests/CMakeLists.txt index 45a146c75d9..abf5f5efe4b 100644 --- a/modules/rostests/winetests/CMakeLists.txt +++ b/modules/rostests/winetests/CMakeLists.txt @@ -2,16 +2,18 @@ add_definitions(-D__ROS_LONG64__) if(MSVC) - add_compile_flags("/wd4090") # C4090: 'function': different 'const' qualifiers - add_compile_flags("/wd4133") # C4133: 'function': incompatible types - from '<enum> *' to 'UINT *' - add_compile_flags("/wd4146") # C4146: unary minus operator applied to unsigned type, result still unsigned - add_compile_flags("/wd4189") # C4189: 'x': local variable is initialized but not referenced - add_compile_flags("/wd4267") # C4267: '=': conversion from 'size_t' to 'int', possible loss of data - add_compile_flags("/wd4305") # C4305: '=': truncation from 'double' to 'FLOAT' + add_compile_options( + /wd4090 # C4090: 'function': different 'const' qualifiers + /wd4133 # C4133: 'function': incompatible types - from '<enum> *' to 'UINT *' + /wd4146 # C4146: unary minus operator applied to unsigned type, result still unsigned + /wd4189 # C4189: 'x': local variable is initialized but not referenced + /wd4267 # C4267: '=': conversion from 'size_t' to 'int', possible loss of data + /wd4305) # C4305: '=': truncation from 'double' to 'FLOAT' if(ARCH STREQUAL "amd64") - add_compile_flags("/wd4101") # C4101: 'x': unreferenced local variable - add_compile_flags("/wd4312") # C4312: 'type cast': conversion from 'unsigned int' to 'char *' of greater size - add_compile_flags("/wd4334") # C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) + add_compile_options( + /wd4101 # C4101: 'x': unreferenced local variable + /wd4312 # C4312: 'type cast': conversion from 'unsigned int' to 'char *' of greater size + /wd4334) # C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) endif() endif() diff --git a/modules/rostests/winetests/comctl32/CMakeLists.txt b/modules/rostests/winetests/comctl32/CMakeLists.txt index ddc4caf0dc9..604e0509bba 100644 --- a/modules/rostests/winetests/comctl32/CMakeLists.txt +++ b/modules/rostests/winetests/comctl32/CMakeLists.txt @@ -42,9 +42,7 @@ add_executable(comctl32_winetest ${PCH_SKIP_SOURCE} rsrc.rc) -if(USE_CLANG_CL OR (NOT MSVC)) - target_compile_options(comctl32_winetest PRIVATE "-Wno-format") -endif() +target_compile_options(comctl32_winetest PRIVATE $<$<NOT:$<C_COMPILER_ID:MSVC>>:-Wno-format>) set_module_type(comctl32_winetest win32cui) add_importlibs(comctl32_winetest comctl32 ole32 user32 gdi32 advapi32 msvcrt kernel32) diff --git a/modules/rostests/winetests/gdiplus/CMakeLists.txt b/modules/rostests/winetests/gdiplus/CMakeLists.txt index 73a04034472..df3cbc98e07 100644 --- a/modules/rostests/winetests/gdiplus/CMakeLists.txt +++ b/modules/rostests/winetests/gdiplus/CMakeLists.txt @@ -1,11 +1,6 @@ add_definitions(-DUSE_WINE_TODOS) -if(MSVC) - # error C4133: 'function': incompatible types - from 'ImageFlags *' to 'UINT *' - replace_compile_flags("/we4133" " ") -endif() - list(APPEND SOURCE brush.c customlinecap.c @@ -33,3 +28,8 @@ set_module_type(gdiplus_winetest win32cui) add_importlibs(gdiplus_winetest gdiplus user32 gdi32 ole32 msvcrt kernel32) add_pch(gdiplus_winetest precomp.h "${PCH_SKIP_SOURCE}") add_rostests_file(TARGET gdiplus_winetest) + +if(MSVC) + # error C4133: 'function': incompatible types - from 'ImageFlags *' to 'UINT *' + remove_target_compile_option(gdiplus_winetest "/we4133") +endif() diff --git a/modules/rostests/winetests/kernel32/CMakeLists.txt b/modules/rostests/winetests/kernel32/CMakeLists.txt index f61fe3cd9fb..6720ce33df7 100644 --- a/modules/rostests/winetests/kernel32/CMakeLists.txt +++ b/modules/rostests/winetests/kernel32/CMakeLists.txt @@ -3,11 +3,6 @@ include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) add_definitions(-DWINVER=0x600 -D_WIN32_WINNT=0x601) -if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") -endif() - list(APPEND SOURCE actctx.c atom.c @@ -50,6 +45,11 @@ add_executable(kernel32_winetest ${PCH_SKIP_SOURCE} resource.rc) +if(MSVC) + # Disable warning C4477 (printf format warnings) + target_compile_options(kernel32_winetest PRIVATE /wd4477) +endif() + if(USE_CLANG_CL OR (NOT MSVC)) target_compile_options(kernel32_winetest PRIVATE "-Wno-format") endif() diff --git a/modules/rostests/winetests/user32/CMakeLists.txt b/modules/rostests/winetests/user32/CMakeLists.txt index dd7bdac6051..226edab9690 100644 --- a/modules/rostests/winetests/user32/CMakeLists.txt +++ b/modules/rostests/winetests/user32/CMakeLists.txt @@ -2,13 +2,6 @@ remove_definitions(-DWINVER=0x502 -D_WIN32_WINNT=0x502) add_definitions(-DWINVER=0x602 -D_WIN32_WINNT=0x602) -if(MSVC) - # Disable warning C4477 (printf format warnings) - add_compile_flags("/wd4477") -elseif(GCC) - add_compile_flags("-Wno-format-overflow") -endif() - list(APPEND SOURCE broadcast.c class.c @@ -44,6 +37,13 @@ add_executable(user32_winetest ${PCH_SKIP_SOURCE} resource.rc) +if(MSVC) + # Disable warning C4477 (printf format warnings) + target_compile_options(user32_winetest PRIVATE /wd4477) +elseif(GCC) + target_compile_options(user32_winetest PRIVATE -Wno-format-overflow) +endif() + add_pch(user32_winetest precomp.h "${PCH_SKIP_SOURCE}") # some tests need to be run from an app compiled as GUI set_module_type(user32_winetest win32gui) diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index f229d34c70d..c644ee21fc4 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -24,6 +24,15 @@ function(add_target_property _module _propname) set_property(TARGET ${_module} PROPERTY ${_propname} ${_newvalue}) endfunction() +# remove_target_compile_options +# Remove one option from the target COMPILE_OPTIONS property, +# previously added through add_compile_options +function(remove_target_compile_option _module _option) + get_target_property(_options ${_module} COMPILE_OPTIONS) + list(REMOVE_ITEM _options ${_option}) + set_target_properties(${_module} PROPERTIES COMPILE_OPTIONS "${_options}") +endfunction() + # Wrapper functions for the important properties, using add_target_property # where appropriate. # Note that the functions for string properties take a single string @@ -63,14 +72,12 @@ endmacro(replace_compiler_option) # add_compile_flags # add_compile_flags_language -# replace_compile_flags # Add or replace compiler flags in the global scope for either all source # files or only those of the specified language. # # Examples: # add_compile_flags("-pedantic -O5") # add_compile_flags_language("-std=gnu99" "C") -# replace_compile_flags("-O5" "-O3") function(add_compile_flags _flags) if(${ARGC} GREATER 1) message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}") @@ -89,12 +96,3 @@ function(add_compile_flags_language _flags _lang) set(CMAKE_${_lang}_FLAGS "${CMAKE_${_lang}_FLAGS} ${_flags}" PARENT_SCOPE) endfunction() -macro(replace_compile_flags _oldflags _newflags) - if(NOT ${ARGC} EQUAL 2) - message(FATAL_ERROR "Wrong arguments to replace_compile_flags! Args ${ARGN}") - endif() - replace_compiler_option(CMAKE_C_FLAGS ${_oldflags} ${_newflags}) - replace_compiler_option(CMAKE_CXX_FLAGS ${_oldflags} ${_newflags}) - replace_compiler_option(CMAKE_ASM_FLAGS ${_oldflags} ${_newflags}) -endmacro() - diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index 3731ca4d500..92d5bf41053 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -112,12 +112,12 @@ add_compile_flags("/wd4018") # - C4700: uninitialized variable usage # - C4715: 'function': not all control paths return a value # - C4716: function must return a value -add_compile_flags("/we4013 /we4020 /we4022 /we4028 /we4047 /we4098 /we4101 /we4113 /we4129 /we4133 /we4163 /we4229 /we4311 /we4312 /we4313 /we4477 /we4603 /we4700 /we4715 /we4716") +add_compile_options(/we4013 /we4020 /we4022 /we4028 /we4047 /we4098 /we4101 /we4113 /we4129 /we4133 /we4163 /we4229 /we4311 /we4312 /we4313 /we4477 /we4603 /we4700 /we4715 /we4716) # - C4189: local variable initialized but not referenced # Not in Release mode if(NOT CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_flags("/we4189") + add_compile_options(/we4189) endif() # Enable warnings above the default level, but don't treat them as errors: @@ -143,7 +143,7 @@ endif() # Hotpatchable images if(ARCH STREQUAL "i386") if(NOT USE_CLANG_CL) - add_compile_flags("/hotpatch") + add_compile_options(/hotpatch) endif() set(_hotpatch_link_flag "/FUNCTIONPADMIN:5") elseif(ARCH STREQUAL "amd64") diff --git a/sdk/lib/3rdparty/freetype/CMakeLists.txt b/sdk/lib/3rdparty/freetype/CMakeLists.txt index d2d87133831..e2d7b3108ca 100644 --- a/sdk/lib/3rdparty/freetype/CMakeLists.txt +++ b/sdk/lib/3rdparty/freetype/CMakeLists.txt @@ -5,11 +5,6 @@ add_definitions( include_directories(include) -if(MSVC) - # error C4312: 'type cast': conversion from 'unsigned long' to 'void *' of greater size - replace_compile_flags("/we4312" " ") -endif() - list(APPEND SOURCE src/autofit/autofit.c src/base/ftadvanc.c @@ -60,7 +55,10 @@ list(APPEND SOURCE add_library(freetype ${SOURCE}) -if(GCC) +if (MSVC) + # error C4312: 'type cast': conversion from 'unsigned long' to 'void *' of greater size + remove_target_compile_option(freetype "/we4312") +elseif(GCC) target_compile_options(freetype PRIVATE -fno-builtin-malloc) elseif(CLANG) target_compile_options(freetype PRIVATE -Wno-tautological-constant-compare) diff --git a/sdk/lib/3rdparty/libxml2/CMakeLists.txt b/sdk/lib/3rdparty/libxml2/CMakeLists.txt index 855d45ff9cd..5d7186e69b4 100644 --- a/sdk/lib/3rdparty/libxml2/CMakeLists.txt +++ b/sdk/lib/3rdparty/libxml2/CMakeLists.txt @@ -66,10 +66,10 @@ add_library(libxml2 ${SOURCE}) if(MSVC AND (NOT USE_CLANG_CL)) # Unreferenced local variable - replace_compile_flags("/we4101" " ") + remove_target_compile_option(libxml2 "/we4101") target_compile_options(libxml2 PRIVATE "/wd4101") # Local variable initialized but not referenced - replace_compile_flags("/we4189" " ") + remove_target_compile_option(libxml2 "/we4189") else() target_compile_options(libxml2 PRIVATE "-w") endif()
4 years, 2 months
1
0
0
0
[reactos] 05/12: [CMAKE] Get rid of replace_compile_flags_language macro
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b52fa999ebf95789ca917…
commit b52fa999ebf95789ca917378439a2619c2995954 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 11:12:49 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Get rid of replace_compile_flags_language macro It was only used in the set_cpp macro --- sdk/cmake/compilerflags.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index b89023e3565..f229d34c70d 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -64,7 +64,6 @@ endmacro(replace_compiler_option) # add_compile_flags # add_compile_flags_language # replace_compile_flags -# replace_compile_flags_language # Add or replace compiler flags in the global scope for either all source # files or only those of the specified language. # @@ -72,7 +71,6 @@ endmacro(replace_compiler_option) # add_compile_flags("-pedantic -O5") # add_compile_flags_language("-std=gnu99" "C") # replace_compile_flags("-O5" "-O3") -# replace_compile_flags_language("-fno-exceptions" "-fexceptions" "CXX") function(add_compile_flags _flags) if(${ARGC} GREATER 1) message(FATAL_ERROR "Excess arguments to add_compile_flags! Args ${ARGN}") @@ -100,9 +98,3 @@ macro(replace_compile_flags _oldflags _newflags) replace_compiler_option(CMAKE_ASM_FLAGS ${_oldflags} ${_newflags}) endmacro() -macro(replace_compile_flags_language _oldflags _newflags _lang) - if(NOT ${ARGC} EQUAL 3) - message(FATAL_ERROR "Wrong arguments to replace_compile_flags_language! Args ${ARGN}") - endif() - replace_compiler_option(CMAKE_${_lang}_FLAGS ${_oldflags} ${_newflags}) -endmacro()
4 years, 2 months
1
0
0
0
[reactos] 04/12: [CMAKE] Introduce the atl_classes interface library
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=907025a01858fc7c6345a…
commit 907025a01858fc7c6345a5b7ae8b97e38d359d7d Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 11:08:58 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Introduce the atl_classes interface library This takes care of adding the relvant include directory and the _ATL_NO_EXCEPTIONS define, if needed --- base/applications/charmap_new/CMakeLists.txt | 3 +-- base/applications/drwtsn32/CMakeLists.txt | 3 +-- base/applications/fltmc/CMakeLists.txt | 4 +--- base/applications/msconfig_new/CMakeLists.txt | 5 ++--- base/applications/mspaint/CMakeLists.txt | 4 +--- base/applications/rapps/CMakeLists.txt | 6 ++---- base/shell/explorer/CMakeLists.txt | 5 +---- base/shell/rshell/CMakeLists.txt | 9 ++------- dll/shellext/acppage/CMakeLists.txt | 6 +----- dll/shellext/fontext/CMakeLists.txt | 8 +------- dll/shellext/mydocs/CMakeLists.txt | 9 ++------- dll/shellext/netshell/CMakeLists.txt | 7 +------ dll/shellext/ntobjshex/CMakeLists.txt | 10 +--------- dll/shellext/sendmail/CMakeLists.txt | 9 ++------- dll/shellext/stobject/CMakeLists.txt | 9 +-------- dll/shellext/zipfldr/CMakeLists.txt | 6 +----- dll/win32/browseui/CMakeLists.txt | 6 +----- dll/win32/browseui/shellbars/CMakeLists.txt | 6 ++---- dll/win32/browseui/shellfind/CMakeLists.txt | 6 ++---- dll/win32/devmgr/CMakeLists.txt | 3 +-- dll/win32/msgina/CMakeLists.txt | 10 +--------- dll/win32/shell32/CMakeLists.txt | 9 ++------- dll/win32/shell32/shelldesktop/CMakeLists.txt | 7 +++---- dll/win32/shell32/shellmenu/CMakeLists.txt | 8 +++----- dll/win32/shell32/shellrecyclebin/CMakeLists.txt | 3 +-- dll/win32/shlwapi/CMakeLists.txt | 11 +++++------ .../rosapps/applications/devutils/shlextdbg/CMakeLists.txt | 6 +----- modules/rostests/apitests/apphelp/CMakeLists.txt | 9 ++------- modules/rostests/apitests/atl/CMakeLists.txt | 4 +--- modules/rostests/apitests/browseui/CMakeLists.txt | 4 +--- modules/rostests/apitests/fontext/CMakeLists.txt | 9 ++------- modules/rostests/apitests/msgina/CMakeLists.txt | 8 +------- modules/rostests/apitests/shell32/CMakeLists.txt | 9 ++------- modules/rostests/apitests/zipfldr/CMakeLists.txt | 4 +--- sdk/lib/CMakeLists.txt | 1 + sdk/lib/atl/CMakeLists.txt | 8 ++++++++ 36 files changed, 62 insertions(+), 172 deletions(-) diff --git a/base/applications/charmap_new/CMakeLists.txt b/base/applications/charmap_new/CMakeLists.txt index 0e260478191..06616bf0bca 100644 --- a/base/applications/charmap_new/CMakeLists.txt +++ b/base/applications/charmap_new/CMakeLists.txt @@ -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) diff --git a/base/applications/drwtsn32/CMakeLists.txt b/base/applications/drwtsn32/CMakeLists.txt index 55d5f6ce497..953485004a1 100644 --- a/base/applications/drwtsn32/CMakeLists.txt +++ b/base/applications/drwtsn32/CMakeLists.txt @@ -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) diff --git a/base/applications/fltmc/CMakeLists.txt b/base/applications/fltmc/CMakeLists.txt index 3e0aa70635d..41774c407b0 100644 --- a/base/applications/fltmc/CMakeLists.txt +++ b/base/applications/fltmc/CMakeLists.txt @@ -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) diff --git a/base/applications/msconfig_new/CMakeLists.txt b/base/applications/msconfig_new/CMakeLists.txt index 5d8ebbe3bd9..a44f4597383 100644 --- a/base/applications/msconfig_new/CMakeLists.txt +++ b/base/applications/msconfig_new/CMakeLists.txt @@ -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) diff --git a/base/applications/mspaint/CMakeLists.txt b/base/applications/mspaint/CMakeLists.txt index c5ba106ba85..fcf694a08ca 100644 --- a/base/applications/mspaint/CMakeLists.txt +++ b/base/applications/mspaint/CMakeLists.txt @@ -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) diff --git a/base/applications/rapps/CMakeLists.txt b/base/applications/rapps/CMakeLists.txt index 0616ddd4468..cb559b5509d 100644 --- a/base/applications/rapps/CMakeLists.txt +++ b/base/applications/rapps/CMakeLists.txt @@ -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) diff --git a/base/shell/explorer/CMakeLists.txt b/base/shell/explorer/CMakeLists.txt index 33d90444fbf..743c10d33b2 100644 --- a/base/shell/explorer/CMakeLists.txt +++ b/base/shell/explorer/CMakeLists.txt @@ -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) diff --git a/base/shell/rshell/CMakeLists.txt b/base/shell/rshell/CMakeLists.txt index c47a121699f..8397a0124f6 100644 --- a/base/shell/rshell/CMakeLists.txt +++ b/base/shell/rshell/CMakeLists.txt @@ -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 diff --git a/dll/shellext/acppage/CMakeLists.txt b/dll/shellext/acppage/CMakeLists.txt index a8708a53b7f..fe694f869f2 100644 --- a/dll/shellext/acppage/CMakeLists.txt +++ b/dll/shellext/acppage/CMakeLists.txt @@ -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) diff --git a/dll/shellext/fontext/CMakeLists.txt b/dll/shellext/fontext/CMakeLists.txt index 5ceac5671fa..b0ddec81245 100644 --- a/dll/shellext/fontext/CMakeLists.txt +++ b/dll/shellext/fontext/CMakeLists.txt @@ -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) diff --git a/dll/shellext/mydocs/CMakeLists.txt b/dll/shellext/mydocs/CMakeLists.txt index 4abbd640d6d..b74998e6603 100644 --- a/dll/shellext/mydocs/CMakeLists.txt +++ b/dll/shellext/mydocs/CMakeLists.txt @@ -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) diff --git a/dll/shellext/netshell/CMakeLists.txt b/dll/shellext/netshell/CMakeLists.txt index 4302187660d..48ce800d927 100644 --- a/dll/shellext/netshell/CMakeLists.txt +++ b/dll/shellext/netshell/CMakeLists.txt @@ -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}") diff --git a/dll/shellext/ntobjshex/CMakeLists.txt b/dll/shellext/ntobjshex/CMakeLists.txt index 91132a405c0..3ecdae1a263 100644 --- a/dll/shellext/ntobjshex/CMakeLists.txt +++ b/dll/shellext/ntobjshex/CMakeLists.txt @@ -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 diff --git a/dll/shellext/sendmail/CMakeLists.txt b/dll/shellext/sendmail/CMakeLists.txt index 52d0a3943ca..5adbf3a847f 100644 --- a/dll/shellext/sendmail/CMakeLists.txt +++ b/dll/shellext/sendmail/CMakeLists.txt @@ -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) diff --git a/dll/shellext/stobject/CMakeLists.txt b/dll/shellext/stobject/CMakeLists.txt index 15d9206589b..f5c67cc58f6 100644 --- a/dll/shellext/stobject/CMakeLists.txt +++ b/dll/shellext/stobject/CMakeLists.txt @@ -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 diff --git a/dll/shellext/zipfldr/CMakeLists.txt b/dll/shellext/zipfldr/CMakeLists.txt index 4459b9d60d6..106a8860f74 100644 --- a/dll/shellext/zipfldr/CMakeLists.txt +++ b/dll/shellext/zipfldr/CMakeLists.txt @@ -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) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index 1aa48b83117..8cb68cf9efa 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -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) diff --git a/dll/win32/browseui/shellbars/CMakeLists.txt b/dll/win32/browseui/shellbars/CMakeLists.txt index 221de1777b2..360c785e5c3 100644 --- a/dll/win32/browseui/shellbars/CMakeLists.txt +++ b/dll/win32/browseui/shellbars/CMakeLists.txt @@ -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") diff --git a/dll/win32/browseui/shellfind/CMakeLists.txt b/dll/win32/browseui/shellfind/CMakeLists.txt index 5900ed9ae11..72f15422fcd 100644 --- a/dll/win32/browseui/shellfind/CMakeLists.txt +++ b/dll/win32/browseui/shellfind/CMakeLists.txt @@ -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") diff --git a/dll/win32/devmgr/CMakeLists.txt b/dll/win32/devmgr/CMakeLists.txt index f805b3f9ae6..e86615f6e25 100644 --- a/dll/win32/devmgr/CMakeLists.txt +++ b/dll/win32/devmgr/CMakeLists.txt @@ -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) diff --git a/dll/win32/msgina/CMakeLists.txt b/dll/win32/msgina/CMakeLists.txt index 056b602788d..cbea4edcb14 100644 --- a/dll/win32/msgina/CMakeLists.txt +++ b/dll/win32/msgina/CMakeLists.txt @@ -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}") diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index a76c13af22e..88a11e013c8 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -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 diff --git a/dll/win32/shell32/shelldesktop/CMakeLists.txt b/dll/win32/shell32/shelldesktop/CMakeLists.txt index 7da3e7b14a4..53fe4c4e460 100644 --- a/dll/win32/shell32/shelldesktop/CMakeLists.txt +++ b/dll/win32/shell32/shelldesktop/CMakeLists.txt @@ -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) diff --git a/dll/win32/shell32/shellmenu/CMakeLists.txt b/dll/win32/shell32/shellmenu/CMakeLists.txt index 94c04fc8515..01b813afa0f 100644 --- a/dll/win32/shell32/shellmenu/CMakeLists.txt +++ b/dll/win32/shell32/shellmenu/CMakeLists.txt @@ -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) diff --git a/dll/win32/shell32/shellrecyclebin/CMakeLists.txt b/dll/win32/shell32/shellrecyclebin/CMakeLists.txt index 5607bdbece2..627d4ae013a 100644 --- a/dll/win32/shell32/shellrecyclebin/CMakeLists.txt +++ b/dll/win32/shell32/shellrecyclebin/CMakeLists.txt @@ -2,8 +2,7 @@ project(SHELL) add_definitions( -DUNICODE - -D_UNICODE - -D_ATL_NO_EXCEPTIONS) + -D_UNICODE) list(APPEND SOURCE recyclebin.c diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt index 0e166a33223..076aaa4dcd6 100644 --- a/dll/win32/shlwapi/CMakeLists.txt +++ b/dll/win32/shlwapi/CMakeLists.txt @@ -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}") diff --git a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt index 2f6541bb389..41686b7813c 100644 --- a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/apphelp/CMakeLists.txt b/modules/rostests/apitests/apphelp/CMakeLists.txt index 6bf9ddc0739..11f81ad37a7 100644 --- a/modules/rostests/apitests/apphelp/CMakeLists.txt +++ b/modules/rostests/apitests/apphelp/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/atl/CMakeLists.txt b/modules/rostests/apitests/atl/CMakeLists.txt index 11ca2fdd72c..555529b7e38 100644 --- a/modules/rostests/apitests/atl/CMakeLists.txt +++ b/modules/rostests/apitests/atl/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/browseui/CMakeLists.txt b/modules/rostests/apitests/browseui/CMakeLists.txt index 2ae9cc3b895..f1875d3a03f 100644 --- a/modules/rostests/apitests/browseui/CMakeLists.txt +++ b/modules/rostests/apitests/browseui/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/fontext/CMakeLists.txt b/modules/rostests/apitests/fontext/CMakeLists.txt index aca32f42f27..0cb5e6a637a 100644 --- a/modules/rostests/apitests/fontext/CMakeLists.txt +++ b/modules/rostests/apitests/fontext/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/msgina/CMakeLists.txt b/modules/rostests/apitests/msgina/CMakeLists.txt index 9b873773950..a799fa56659 100644 --- a/modules/rostests/apitests/msgina/CMakeLists.txt +++ b/modules/rostests/apitests/msgina/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt b/modules/rostests/apitests/shell32/CMakeLists.txt index 39c81e5e59e..81b40767113 100644 --- a/modules/rostests/apitests/shell32/CMakeLists.txt +++ b/modules/rostests/apitests/shell32/CMakeLists.txt @@ -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) diff --git a/modules/rostests/apitests/zipfldr/CMakeLists.txt b/modules/rostests/apitests/zipfldr/CMakeLists.txt index 9bda3bd9b2c..89e460867e9 100644 --- a/modules/rostests/apitests/zipfldr/CMakeLists.txt +++ b/modules/rostests/apitests/zipfldr/CMakeLists.txt @@ -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) diff --git a/sdk/lib/CMakeLists.txt b/sdk/lib/CMakeLists.txt index 60b2844566b..0e75364c440 100644 --- a/sdk/lib/CMakeLists.txt +++ b/sdk/lib/CMakeLists.txt @@ -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 index 00000000000..6923a49bb8f --- /dev/null +++ b/sdk/lib/atl/CMakeLists.txt @@ -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>")
4 years, 2 months
1
0
0
0
[reactos] 03/12: [CMAKE] Allow INTERFACE libraries for MSVC IDEs
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b28f8d9bac5499b7f88b…
commit 8b28f8d9bac5499b7f88b7fbbc3e8263f2c8e361 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Oct 15 11:47:03 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [CMAKE] Allow INTERFACE libraries for MSVC IDEs --- sdk/cmake/CMakeMacros.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index 707a6b2e524..e3ed4a00545 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -474,15 +474,17 @@ elseif(USE_FOLDER_STRUCTURE) function(add_library name) _add_library(${name} ${ARGN}) - get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL) - if(_target_excluded AND ${name} MATCHES "^lib.*") - set_property(TARGET "${name}" PROPERTY FOLDER "Importlibs") - else() - string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE) - set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}") + get_target_property(_type ${name} TYPE) + if (NOT _type STREQUAL "INTERFACE_LIBRARY") + get_target_property(_target_excluded ${name} EXCLUDE_FROM_ALL) + if(_target_excluded AND ${name} MATCHES "^lib.*") + set_property(TARGET "${name}" PROPERTY FOLDER "Importlibs") + else() + string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR_LENGTH} -1 CMAKE_CURRENT_SOURCE_DIR_RELATIVE) + set_property(TARGET "${name}" PROPERTY FOLDER "${CMAKE_CURRENT_SOURCE_DIR_RELATIVE}") + endif() endif() # cmake adds a module_EXPORTS define when compiling a module or a shared library. We don't use that. - get_target_property(_type ${name} TYPE) if(_type MATCHES SHARED_LIBRARY|MODULE_LIBRARY) set_target_properties(${name} PROPERTIES DEFINE_SYMBOL "") endif()
4 years, 2 months
1
0
0
0
[reactos] 02/12: [CMAKE] Get rid of the set_cpp macro
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d6ea8659c87cbbb60a6ba…
commit d6ea8659c87cbbb60a6ba3760c14f6d5aaf0fbba Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Fri Sep 18 09:34:18 2020 +0200 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Tue Oct 20 21:44:54 2020 +0200 [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 --- CMakeLists.txt | 14 ++++ base/applications/atactl/CMakeLists.txt | 1 - base/applications/charmap_new/CMakeLists.txt | 7 +- base/applications/drwtsn32/CMakeLists.txt | 4 +- base/applications/fltmc/CMakeLists.txt | 4 +- base/applications/games/solitaire/CMakeLists.txt | 3 - base/applications/games/spider/CMakeLists.txt | 7 +- base/applications/msconfig_new/CMakeLists.txt | 5 +- base/applications/mspaint/CMakeLists.txt | 4 +- base/applications/network/telnet/CMakeLists.txt | 4 +- base/applications/rapps/CMakeLists.txt | 4 +- base/applications/sndrec32/CMakeLists.txt | 3 +- base/shell/explorer/CMakeLists.txt | 3 +- base/shell/rshell/CMakeLists.txt | 17 ++-- dll/directx/ksproxy/CMakeLists.txt | 3 +- dll/opengl/glu32/CMakeLists.txt | 3 +- dll/shellext/acppage/CMakeLists.txt | 3 +- dll/shellext/fontext/CMakeLists.txt | 3 +- dll/shellext/mydocs/CMakeLists.txt | 3 +- dll/shellext/netshell/CMakeLists.txt | 3 +- dll/shellext/ntobjshex/CMakeLists.txt | 3 +- dll/shellext/sendmail/CMakeLists.txt | 3 +- dll/shellext/shellbtrfs/CMakeLists.txt | 4 +- dll/shellext/stobject/CMakeLists.txt | 4 +- dll/shellext/zipfldr/CMakeLists.txt | 4 +- dll/win32/browseui/CMakeLists.txt | 10 +-- dll/win32/browseui/shellbars/CMakeLists.txt | 2 - dll/win32/browseui/shellfind/CMakeLists.txt | 2 - dll/win32/devmgr/CMakeLists.txt | 7 +- dll/win32/framedyn/CMakeLists.txt | 3 +- dll/win32/msgina/CMakeLists.txt | 3 +- dll/win32/shell32/CMakeLists.txt | 3 +- dll/win32/shell32/shelldesktop/CMakeLists.txt | 2 - dll/win32/shell32/shellmenu/CMakeLists.txt | 2 - dll/win32/shlwapi/CMakeLists.txt | 1 - drivers/filesystems/udfs/CMakeLists.txt | 2 - drivers/storage/ide/uniata/CMakeLists.txt | 1 - drivers/usb/usbaudio/CMakeLists.txt | 1 - drivers/wdm/audio/backpln/portcls/CMakeLists.txt | 1 - drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt | 1 - .../drivers/CMIDriver/cmicontrol/CMakeLists.txt | 1 - .../wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt | 1 - drivers/wdm/audio/hdaudbus/CMakeLists.txt | 1 - .../applications/devutils/gdb2/CMakeLists.txt | 2 +- .../applications/devutils/shlextdbg/CMakeLists.txt | 3 +- .../applications/explorer-old/CMakeLists.txt | 5 +- .../rosapps/applications/fraginator/CMakeLists.txt | 8 +- .../rosapps/applications/net/netreg/CMakeLists.txt | 3 +- .../applications/net/roshttpd/CMakeLists.txt | 3 +- .../applications/sysutils/fontsub/CMakeLists.txt | 11 +-- .../applications/sysutils/regexpl/CMakeLists.txt | 4 +- modules/rosapps/lib/vfdlib/CMakeLists.txt | 4 +- modules/rostests/apitests/apphelp/CMakeLists.txt | 5 +- modules/rostests/apitests/atl/CMakeLists.txt | 4 +- modules/rostests/apitests/browseui/CMakeLists.txt | 7 +- modules/rostests/apitests/fontext/CMakeLists.txt | 3 +- modules/rostests/apitests/msgina/CMakeLists.txt | 3 +- modules/rostests/apitests/ole32/CMakeLists.txt | 3 +- modules/rostests/apitests/shell32/CMakeLists.txt | 5 +- modules/rostests/apitests/zipfldr/CMakeLists.txt | 6 +- modules/rostests/rosautotest/CMakeLists.txt | 4 +- sdk/cmake/CMakeMacros.cmake | 94 +++------------------- sdk/cmake/gcc.cmake | 62 ++++++++++---- sdk/cmake/msvc.cmake | 24 +++--- sdk/lib/3rdparty/cardlib/CMakeLists.txt | 5 +- sdk/lib/3rdparty/stlport/CMakeLists.txt | 16 ++-- sdk/lib/comsupp/CMakeLists.txt | 4 +- sdk/lib/cpprt/CMakeLists.txt | 3 +- sdk/lib/drivers/sound/stdunk/CMakeLists.txt | 1 - 69 files changed, 193 insertions(+), 259 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce1995e3b80..cefcc5f93ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,20 @@ else() set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) + # Add our own target properties + # C++ + define_property(TARGET PROPERTY WITH_CXX_EXCEPTIONS + BRIEF_DOCS "Enable C++ exceptions on this target" + FULL_DOCS [[ +Enables C++ exception handling. +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).]]) + define_property(TARGET PROPERTY WITH_CXX_RTTI + BRIEF_DOCS "Enable C++ RTTI on this target" + FULL_DOCS [[ +Enables run-time type information. +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.]]) + + if(DBG) add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE) else() diff --git a/base/applications/atactl/CMakeLists.txt b/base/applications/atactl/CMakeLists.txt index 0070358fae4..e75dbbd7569 100644 --- a/base/applications/atactl/CMakeLists.txt +++ b/base/applications/atactl/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() add_definitions(-DUSER_MODE) include_directories(${REACTOS_SOURCE_DIR}/drivers/storage/ide/uniata) add_executable(atactl atactl.cpp atactl.rc) diff --git a/base/applications/charmap_new/CMakeLists.txt b/base/applications/charmap_new/CMakeLists.txt index 3863bca6eb3..0e260478191 100644 --- a/base/applications/charmap_new/CMakeLists.txt +++ b/base/applications/charmap_new/CMakeLists.txt @@ -1,14 +1,12 @@ PROJECT(CHARMAP) -set_cpp(WITH_RTTI WITH_RUNTIME WITH_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}/sdk/lib/atl includes) list(APPEND SOURCE @@ -21,7 +19,8 @@ add_library(charmap MODULE charmap.rc) set_module_type(charmap win32gui UNICODE) -target_link_libraries(charmap uuid wine) +target_link_libraries(charmap uuid wine cpprt) +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) add_cd_file(TARGET charmap DESTINATION reactos/system32 FOR all) diff --git a/base/applications/drwtsn32/CMakeLists.txt b/base/applications/drwtsn32/CMakeLists.txt index fbc210b5b89..55d5f6ce497 100644 --- a/base/applications/drwtsn32/CMakeLists.txt +++ b/base/applications/drwtsn32/CMakeLists.txt @@ -1,7 +1,6 @@ PROJECT(drwtsn32) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) include_directories( ${REACTOS_SOURCE_DIR}/sdk/lib/atl ${REACTOS_SOURCE_DIR}/sdk/lib/udmihelp) @@ -17,6 +16,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) +target_link_libraries(drwtsn32 udmihelp cppstl) +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) diff --git a/base/applications/fltmc/CMakeLists.txt b/base/applications/fltmc/CMakeLists.txt index 01bf7a3a261..3e0aa70635d 100644 --- a/base/applications/fltmc/CMakeLists.txt +++ b/base/applications/fltmc/CMakeLists.txt @@ -2,11 +2,11 @@ remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) add_definitions(-D_WIN32_WINNT=0x601) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) - include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) add_executable(fltmc fltmc.cpp fltmc.rc) +target_link_libraries(fltmc cpprt) +set_target_cpp_properties(fltmc WITH_EXCEPTIONS) set_module_type(fltmc win32cui UNICODE) add_importlibs(fltmc fltlib msvcrt kernel32 advapi32) add_cd_file(TARGET fltmc DESTINATION reactos/system32 FOR all) diff --git a/base/applications/games/solitaire/CMakeLists.txt b/base/applications/games/solitaire/CMakeLists.txt index 9cb672325d8..a0f083774ad 100644 --- a/base/applications/games/solitaire/CMakeLists.txt +++ b/base/applications/games/solitaire/CMakeLists.txt @@ -1,7 +1,4 @@ -set_cpp(WITH_RUNTIME) -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/cardlib) - list(APPEND SOURCE solcreate.cpp solgame.cpp diff --git a/base/applications/games/spider/CMakeLists.txt b/base/applications/games/spider/CMakeLists.txt index 59480763548..78d4f64d7aa 100644 --- a/base/applications/games/spider/CMakeLists.txt +++ b/base/applications/games/spider/CMakeLists.txt @@ -1,10 +1,4 @@ -set_cpp(WITH_RUNTIME) - -include_directories( - ${REACTOS_SOURCE_DIR}/sdk/lib/3rdparty/cardlib - ${CMAKE_CURRENT_SOURCE_DIR}) - list(APPEND SOURCE spider.cpp spigame.cpp @@ -13,6 +7,7 @@ list(APPEND SOURCE add_rc_deps(rsrc.rc ${CMAKE_CURRENT_SOURCE_DIR}/spider.ico) add_executable(spider ${SOURCE} rsrc.rc) target_link_libraries(spider cardlib) +target_include_directories(spider PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) add_pch(spider spider.h SOURCE) set_module_type(spider win32gui UNICODE) add_importlibs(spider advapi32 comctl32 user32 gdi32 msvcrt kernel32) diff --git a/base/applications/msconfig_new/CMakeLists.txt b/base/applications/msconfig_new/CMakeLists.txt index 0fc32ec5360..5d8ebbe3bd9 100644 --- a/base/applications/msconfig_new/CMakeLists.txt +++ b/base/applications/msconfig_new/CMakeLists.txt @@ -1,8 +1,6 @@ PROJECT(msconfig_new) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) - include_directories( . comctl32ex @@ -35,6 +33,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) +target_link_libraries(msconfig_new comsupp cpprt) +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) diff --git a/base/applications/mspaint/CMakeLists.txt b/base/applications/mspaint/CMakeLists.txt index b07e10d4ce0..c5ba106ba85 100644 --- a/base/applications/mspaint/CMakeLists.txt +++ b/base/applications/mspaint/CMakeLists.txt @@ -1,7 +1,6 @@ project(MSPAINT) add_definitions(-DINITGUID) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -33,7 +32,8 @@ 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) +target_link_libraries(mspaint uuid cpprt) +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) add_cd_file(TARGET mspaint DESTINATION reactos/system32 FOR all) diff --git a/base/applications/network/telnet/CMakeLists.txt b/base/applications/network/telnet/CMakeLists.txt index 8e586fa363b..acd2aa06cba 100644 --- a/base/applications/network/telnet/CMakeLists.txt +++ b/base/applications/network/telnet/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_EXCEPTIONS WITH_STL) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) if(NOT MSVC) @@ -34,6 +32,8 @@ if(NOT MSVC) endif() add_executable(telnet ${SOURCE} telnet.rc) +target_link_libraries(telnet cppstl) +set_target_cpp_properties(telnet WITH_EXCEPTIONS) set_module_type(telnet win32cui) add_importlibs(telnet ws2_32 user32 msvcrt kernel32 ntdll) add_pch(telnet precomp.h SOURCE) diff --git a/base/applications/rapps/CMakeLists.txt b/base/applications/rapps/CMakeLists.txt index 62a61d24b95..0616ddd4468 100644 --- a/base/applications/rapps/CMakeLists.txt +++ b/base/applications/rapps/CMakeLists.txt @@ -1,7 +1,5 @@ project(rapps) -set_cpp(WITH_RUNTIME) - include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) @@ -46,7 +44,7 @@ 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) +target_link_libraries(rapps conutils ${PSEH_LIB} uuid wine cpprt) 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) diff --git a/base/applications/sndrec32/CMakeLists.txt b/base/applications/sndrec32/CMakeLists.txt index 83809d2d480..3a97846df2a 100644 --- a/base/applications/sndrec32/CMakeLists.txt +++ b/base/applications/sndrec32/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_RUNTIME) - list(APPEND SOURCE audio_format.cpp audio_membuffer.cpp @@ -15,6 +13,7 @@ list(APPEND SOURCE file(GLOB sndrec32_rc_deps resources/*.*) add_rc_deps(rsrc.rc ${sndrec32_rc_deps}) add_executable(sndrec32 ${SOURCE} rsrc.rc) +target_link_libraries(sndrec32 cpprt) set_module_type(sndrec32 win32gui UNICODE) add_importlibs(sndrec32 winmm user32 msacm32 comctl32 comdlg32 gdi32 shell32 msvcrt kernel32) add_pch(sndrec32 stdafx.h SOURCE) diff --git a/base/shell/explorer/CMakeLists.txt b/base/shell/explorer/CMakeLists.txt index 18562492378..33d90444fbf 100644 --- a/base/shell/explorer/CMakeLists.txt +++ b/base/shell/explorer/CMakeLists.txt @@ -1,6 +1,5 @@ PROJECT(SHELL) -set_cpp(WITH_RUNTIME) add_definitions(-D_ATL_NO_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -31,7 +30,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) +target_link_libraries(explorer uuid wine cpprt) 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) diff --git a/base/shell/rshell/CMakeLists.txt b/base/shell/rshell/CMakeLists.txt index a2722178bbd..c47a121699f 100644 --- a/base/shell/rshell/CMakeLists.txt +++ b/base/shell/rshell/CMakeLists.txt @@ -3,8 +3,6 @@ PROJECT(SHELL) add_definitions( -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) - include_directories( ${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -24,7 +22,8 @@ target_link_libraries(rshell shellmenu shelldesktop uuid - wine) + wine + cpprt) add_importlibs(rshell browseui @@ -40,14 +39,14 @@ add_importlibs(rshell kernel32 ntdll) -add_custom_command(TARGET rshell POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy +add_custom_command(TARGET rshell POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:rshell>" - "$<TARGET_FILE_DIR:explorer>/$<TARGET_FILE_NAME:rshell>" + "$<TARGET_FILE_DIR:explorer>/$<TARGET_FILE_NAME:rshell>" COMMENT "Copying to output directory") -add_custom_command(TARGET rshell POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy +add_custom_command(TARGET rshell POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:rshell>" - "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>" + "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:rshell>" COMMENT "Copying to output directory") diff --git a/dll/directx/ksproxy/CMakeLists.txt b/dll/directx/ksproxy/CMakeLists.txt index 15d7ebc0bfe..b6d070d6385 100644 --- a/dll/directx/ksproxy/CMakeLists.txt +++ b/dll/directx/ksproxy/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_STL) spec2def(ksproxy.ax ksproxy.spec) list(APPEND SOURCE @@ -25,7 +24,7 @@ list(APPEND SOURCE add_library(ksproxy MODULE ${SOURCE} ksproxy.rc) set_module_type(ksproxy win32dll) set_target_properties(ksproxy PROPERTIES SUFFIX ".ax") -target_link_libraries(ksproxy strmiids) +target_link_libraries(ksproxy strmiids cppstl) add_importlibs(ksproxy advapi32 ole32 setupapi ksuser msvcrt kernel32 ntdll) add_dependencies(ksproxy dxsdk) add_cd_file(TARGET ksproxy DESTINATION reactos/system32 FOR all) diff --git a/dll/opengl/glu32/CMakeLists.txt b/dll/opengl/glu32/CMakeLists.txt index b2e6de97f2f..490732e6d49 100644 --- a/dll/opengl/glu32/CMakeLists.txt +++ b/dll/opengl/glu32/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_RUNTIME) - include_directories(BEFORE include src/include @@ -118,6 +116,7 @@ add_library(glu32 MODULE ${PCH_SKIP_SOURCE} glu32.rc ${CMAKE_CURRENT_BINARY_DIR}/glu32.def) +target_link_libraries(glu32 cpprt) set_module_type(glu32 win32dll) diff --git a/dll/shellext/acppage/CMakeLists.txt b/dll/shellext/acppage/CMakeLists.txt index f4dc6e1c011..a8708a53b7f 100644 --- a/dll/shellext/acppage/CMakeLists.txt +++ b/dll/shellext/acppage/CMakeLists.txt @@ -1,7 +1,6 @@ project(appcompat) -set_cpp(WITH_RUNTIME) if(NOT MSVC) # HACK: this should be enabled globally! add_compile_flags_language("-std=c++11" "CXX") @@ -32,7 +31,7 @@ add_library(acppage MODULE ${CMAKE_CURRENT_BINARY_DIR}/acppage.def) set_module_type(acppage win32dll UNICODE) -target_link_libraries(acppage wine uuid) +target_link_libraries(acppage wine uuid cpprt) 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) diff --git a/dll/shellext/fontext/CMakeLists.txt b/dll/shellext/fontext/CMakeLists.txt index e50eebfa95b..5ceac5671fa 100644 --- a/dll/shellext/fontext/CMakeLists.txt +++ b/dll/shellext/fontext/CMakeLists.txt @@ -5,7 +5,6 @@ add_definitions( remove_definitions(-D_WIN32_WINNT=0x502 -DWINVER=0x502) add_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601) -set_cpp(WITH_RUNTIME) spec2def(fontext.dll fontext.spec) @@ -32,7 +31,7 @@ add_library(fontext MODULE ${CMAKE_CURRENT_BINARY_DIR}/fontext.def) set_module_type(fontext win32dll UNICODE) -target_link_libraries(fontext uuid wine) +target_link_libraries(fontext uuid wine cpprt) add_delay_importlibs(fontext ole32 oleaut32 shlwapi gdi32) add_importlibs(fontext shell32 advapi32 user32 msvcrt kernel32 ntdll) add_pch(fontext precomp.h SOURCE) diff --git a/dll/shellext/mydocs/CMakeLists.txt b/dll/shellext/mydocs/CMakeLists.txt index 0c9649c25f4..4abbd640d6d 100644 --- a/dll/shellext/mydocs/CMakeLists.txt +++ b/dll/shellext/mydocs/CMakeLists.txt @@ -1,4 +1,3 @@ -set_cpp(WITH_RUNTIME) spec2def(mydocs.dll mydocs.spec) add_definitions( @@ -28,7 +27,7 @@ add_library(mydocs MODULE ${CMAKE_CURRENT_BINARY_DIR}/mydocs.def) set_module_type(mydocs win32dll UNICODE) -target_link_libraries(mydocs uuid wine) +target_link_libraries(mydocs uuid wine cpprt) add_delay_importlibs(mydocs ole32 oleaut32) add_importlibs(mydocs advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll) add_pch(mydocs precomp.hpp SOURCE) diff --git a/dll/shellext/netshell/CMakeLists.txt b/dll/shellext/netshell/CMakeLists.txt index 2ed317395d0..4302187660d 100644 --- a/dll/shellext/netshell/CMakeLists.txt +++ b/dll/shellext/netshell/CMakeLists.txt @@ -1,7 +1,6 @@ project(SHELL) -set_cpp(WITH_RUNTIME) if(NOT MSVC) # HACK: this should be enabled globally! @@ -41,7 +40,7 @@ add_library(netshell MODULE ${CMAKE_CURRENT_BINARY_DIR}/netshell.def) set_module_type(netshell win32dll UNICODE) -target_link_libraries(netshell uuid wine) +target_link_libraries(netshell uuid wine cpprt) 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}") diff --git a/dll/shellext/ntobjshex/CMakeLists.txt b/dll/shellext/ntobjshex/CMakeLists.txt index 3015c649947..91132a405c0 100644 --- a/dll/shellext/ntobjshex/CMakeLists.txt +++ b/dll/shellext/ntobjshex/CMakeLists.txt @@ -4,7 +4,6 @@ project(SHELL) add_definitions( -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) if(NOT MSVC) # HACK: this should be enabled globally! @@ -33,7 +32,7 @@ add_library(ntobjshex MODULE ${CMAKE_CURRENT_BINARY_DIR}/ntobjshex.def) set_module_type(ntobjshex win32dll UNICODE) -target_link_libraries(ntobjshex uuid wine) +target_link_libraries(ntobjshex uuid wine cpprt) add_importlibs(ntobjshex advapi32 diff --git a/dll/shellext/sendmail/CMakeLists.txt b/dll/shellext/sendmail/CMakeLists.txt index 51128933c18..52d0a3943ca 100644 --- a/dll/shellext/sendmail/CMakeLists.txt +++ b/dll/shellext/sendmail/CMakeLists.txt @@ -1,4 +1,3 @@ -set_cpp(WITH_RUNTIME) spec2def(sendmail.dll sendmail.spec) add_definitions( @@ -28,7 +27,7 @@ add_library(sendmail MODULE ${CMAKE_CURRENT_BINARY_DIR}/sendmail.def) set_module_type(sendmail win32dll UNICODE) -target_link_libraries(sendmail uuid wine) +target_link_libraries(sendmail uuid wine cpprt) add_delay_importlibs(sendmail ole32 oleaut32) add_importlibs(sendmail advapi32 shell32 user32 comctl32 shlwapi msvcrt kernel32 ntdll) add_pch(sendmail precomp.hpp SOURCE) diff --git a/dll/shellext/shellbtrfs/CMakeLists.txt b/dll/shellext/shellbtrfs/CMakeLists.txt index c8fdc857001..7a21c8aa6de 100644 --- a/dll/shellext/shellbtrfs/CMakeLists.txt +++ b/dll/shellext/shellbtrfs/CMakeLists.txt @@ -1,4 +1,3 @@ -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x603) @@ -39,7 +38,8 @@ file(GLOB shellbtrfs_rc_deps *.ico) add_rc_deps(shellbtrfs.rc ${shellbtrfs_rc_deps}) set_module_type(shellbtrfs win32dll UNICODE) -target_link_libraries(shellbtrfs uuid) +target_link_libraries(shellbtrfs uuid cppstl) +set_target_cpp_properties(shellbtrfs WITH_EXCEPTIONS) add_importlibs(shellbtrfs advapi32 advapi32_vista ole32 shell32 shlwapi user32 comctl32 uxtheme setupapi comdlg32 gdi32 msvcrt kernel32_vista kernel32 ntdll) add_pch(shellbtrfs precomp.h "${PCH_SKIP_SOURCE}") add_cd_file(TARGET shellbtrfs DESTINATION reactos/system32 FOR all) diff --git a/dll/shellext/stobject/CMakeLists.txt b/dll/shellext/stobject/CMakeLists.txt index 411dab205d3..15d9206589b 100644 --- a/dll/shellext/stobject/CMakeLists.txt +++ b/dll/shellext/stobject/CMakeLists.txt @@ -1,8 +1,6 @@ project(SHELL) -set_cpp(WITH_RUNTIME) - if(NOT MSVC) # HACK: this should be enabled globally! add_compile_flags_language("-std=c++11" "CXX") @@ -34,7 +32,7 @@ add_library(stobject MODULE ${CMAKE_CURRENT_BINARY_DIR}/stobject.def) set_module_type(stobject win32dll UNICODE) -target_link_libraries(stobject uuid wine) +target_link_libraries(stobject uuid wine cpprt) add_importlibs(stobject setupapi diff --git a/dll/shellext/zipfldr/CMakeLists.txt b/dll/shellext/zipfldr/CMakeLists.txt index f0339f9a6ff..4459b9d60d6 100644 --- a/dll/shellext/zipfldr/CMakeLists.txt +++ b/dll/shellext/zipfldr/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) if(NOT MSVC) # HACK: this should be enabled globally! add_compile_flags_language("-std=c++11" "CXX") @@ -47,7 +46,8 @@ add_library(zipfldr MODULE set_module_type(zipfldr win32dll UNICODE) -target_link_libraries(zipfldr minizip zlib uuid) +target_link_libraries(zipfldr minizip zlib uuid cpprt) +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) add_cd_file(TARGET zipfldr DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index 5c136cd02cb..1aa48b83117 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -3,8 +3,6 @@ PROJECT(SHELL) add_subdirectory(shellbars) add_subdirectory(shellfind) -set_cpp(WITH_RUNTIME) - add_definitions( -D_ATL_NO_EXCEPTIONS) @@ -49,7 +47,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) +target_link_libraries(browseui shellbars shellfind uuid wine cpprt) 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) @@ -62,8 +60,8 @@ if(NOT MSVC) endif() endif() -add_custom_command(TARGET browseui POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy +add_custom_command(TARGET browseui POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy "$<TARGET_FILE:browseui>" - "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>" + "$<TARGET_FILE_DIR:filebrowser>/$<TARGET_FILE_NAME:browseui>" COMMENT "Copying to output directory") diff --git a/dll/win32/browseui/shellbars/CMakeLists.txt b/dll/win32/browseui/shellbars/CMakeLists.txt index 661284c0386..221de1777b2 100644 --- a/dll/win32/browseui/shellbars/CMakeLists.txt +++ b/dll/win32/browseui/shellbars/CMakeLists.txt @@ -1,8 +1,6 @@ PROJECT(SHELL) -set_cpp(WITH_RUNTIME) - add_definitions(-DUNICODE -D_UNICODE) add_definitions(-D_ATL_NO_EXCEPTIONS) diff --git a/dll/win32/browseui/shellfind/CMakeLists.txt b/dll/win32/browseui/shellfind/CMakeLists.txt index 0d7fd02d398..5900ed9ae11 100644 --- a/dll/win32/browseui/shellfind/CMakeLists.txt +++ b/dll/win32/browseui/shellfind/CMakeLists.txt @@ -1,8 +1,6 @@ PROJECT(SHELL) -set_cpp(WITH_RUNTIME) - add_definitions(-DUNICODE -D_UNICODE) add_definitions(-D_ATL_NO_EXCEPTIONS) diff --git a/dll/win32/devmgr/CMakeLists.txt b/dll/win32/devmgr/CMakeLists.txt index 88b24753e5c..f805b3f9ae6 100644 --- a/dll/win32/devmgr/CMakeLists.txt +++ b/dll/win32/devmgr/CMakeLists.txt @@ -2,8 +2,6 @@ PROJECT(DEVMGR) spec2def(devmgr.dll devmgr.spec ADD_IMPORTLIB) -set_cpp(WITH_RTTI WITH_RUNTIME WITH_EXCEPTIONS) - if(NOT MSVC) # HACK: this should be enabled globally! add_compile_flags_language("-std=c++11" "CXX") @@ -11,7 +9,7 @@ endif() include_directories( ${REACTOS_SOURCE_DIR}/sdk/include/reactos/dll - ${REACTOS_SOURCE_DIR}/sdk/lib/atl + ${REACTOS_SOURCE_DIR}/sdk/lib/atl includes) list(APPEND SOURCE @@ -35,7 +33,8 @@ add_library(devmgr MODULE ${CMAKE_CURRENT_BINARY_DIR}/devmgr.def) set_module_type(devmgr win32dll UNICODE) -target_link_libraries(devmgr uuid wine) +target_link_libraries(devmgr uuid wine cpprt) +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) add_cd_file(TARGET devmgr DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/framedyn/CMakeLists.txt b/dll/win32/framedyn/CMakeLists.txt index edc6ab7c7c2..922ead719e9 100644 --- a/dll/win32/framedyn/CMakeLists.txt +++ b/dll/win32/framedyn/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) spec2def(framedyn.dll framedyn.spec ADD_IMPORTLIB) list(APPEND SOURCE @@ -13,6 +12,8 @@ if(MSVC) endif() add_library(framedyn MODULE ${SOURCE}) +target_link_libraries(framedyn cpprt) +set_target_cpp_properties(framedyn WITH_EXCEPTIONS) set_module_type(framedyn win32dll UNICODE) add_importlibs(framedyn oleaut32 msvcrt kernel32 ntdll) add_cd_file(TARGET framedyn DESTINATION reactos/system32/wbem FOR all) diff --git a/dll/win32/msgina/CMakeLists.txt b/dll/win32/msgina/CMakeLists.txt index 5f3fa9ece15..056b602788d 100644 --- a/dll/win32/msgina/CMakeLists.txt +++ b/dll/win32/msgina/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_RUNTIME) add_definitions( -D_ATL_NO_EXCEPTIONS) @@ -29,7 +28,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}) +target_link_libraries(msgina wine uuid ${PSEH_LIB} cpprt) add_delay_importlibs(msgina secur32) add_importlibs(msgina advapi32 user32 gdi32 powrprof userenv msvcrt kernel32 ntdll) add_pch(msgina msgina.h "${PCH_SKIP_SOURCE}") diff --git a/dll/win32/shell32/CMakeLists.txt b/dll/win32/shell32/CMakeLists.txt index 5c812e953e4..a76c13af22e 100644 --- a/dll/win32/shell32/CMakeLists.txt +++ b/dll/win32/shell32/CMakeLists.txt @@ -4,7 +4,6 @@ add_subdirectory(shelldesktop) add_subdirectory(shellmenu) add_subdirectory(shellrecyclebin) -set_cpp(WITH_RUNTIME) spec2def(shell32.dll shell32.spec ADD_IMPORTLIB) if(NOT MSVC) @@ -122,7 +121,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) +target_link_libraries(shell32 shellmenu shelldesktop wine uuid recyclebin cpprt) 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 diff --git a/dll/win32/shell32/shelldesktop/CMakeLists.txt b/dll/win32/shell32/shelldesktop/CMakeLists.txt index 2ea167b95f7..7da3e7b14a4 100644 --- a/dll/win32/shell32/shelldesktop/CMakeLists.txt +++ b/dll/win32/shell32/shelldesktop/CMakeLists.txt @@ -1,7 +1,5 @@ project(SHELL) -set_cpp(WITH_RUNTIME) - add_definitions( -DUNICODE -D_UNICODE diff --git a/dll/win32/shell32/shellmenu/CMakeLists.txt b/dll/win32/shell32/shellmenu/CMakeLists.txt index ebca89a0226..94c04fc8515 100644 --- a/dll/win32/shell32/shellmenu/CMakeLists.txt +++ b/dll/win32/shell32/shellmenu/CMakeLists.txt @@ -1,7 +1,5 @@ project(SHELL) -set_cpp(WITH_RUNTIME) - add_definitions( -DUNICODE -D_UNICODE diff --git a/dll/win32/shlwapi/CMakeLists.txt b/dll/win32/shlwapi/CMakeLists.txt index 6c425e78ceb..0e166a33223 100644 --- a/dll/win32/shlwapi/CMakeLists.txt +++ b/dll/win32/shlwapi/CMakeLists.txt @@ -9,7 +9,6 @@ add_definitions( -D_SHLWAPI_ -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine ${REACTOS_SOURCE_DIR}/sdk/lib/atl) diff --git a/drivers/filesystems/udfs/CMakeLists.txt b/drivers/filesystems/udfs/CMakeLists.txt index 8c13bf7d861..292fe2421e3 100644 --- a/drivers/filesystems/udfs/CMakeLists.txt +++ b/drivers/filesystems/udfs/CMakeLists.txt @@ -1,8 +1,6 @@ include_directories(Include) -set_cpp(WITH_RUNTIME) - list(APPEND SOURCE udf_info/alloc.cpp udf_info/dirtree.cpp diff --git a/drivers/storage/ide/uniata/CMakeLists.txt b/drivers/storage/ide/uniata/CMakeLists.txt index 163174825a4..f8f952a5a79 100644 --- a/drivers/storage/ide/uniata/CMakeLists.txt +++ b/drivers/storage/ide/uniata/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() include_directories( BEFORE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/drivers/usb/usbaudio/CMakeLists.txt b/drivers/usb/usbaudio/CMakeLists.txt index 2262caa6066..218eaec61fd 100644 --- a/drivers/usb/usbaudio/CMakeLists.txt +++ b/drivers/usb/usbaudio/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt index 294b48c9f8c..a873b75fe2a 100644 --- a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt +++ b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt index ba6cd3f9c4c..564c5e42212 100644 --- a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt +++ b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt @@ -2,7 +2,6 @@ add_subdirectory(cmicontrol) add_subdirectory(cpl) -set_cpp() # for WaveRT support remove_definitions(-D_WIN32_WINNT=0x502) diff --git a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/CMakeLists.txt b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/CMakeLists.txt index aeff43e3db7..8574b420629 100644 --- a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/CMakeLists.txt +++ b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() include_directories(..) add_executable(cmicontrol main.cpp window.rc) diff --git a/drivers/wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt b/drivers/wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt index 2ee32c73ac0..95c5a7fb7ae 100644 --- a/drivers/wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt +++ b/drivers/wdm/audio/drivers/CMIDriver/cpl/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() add_library(cmicpl MODULE cmicpl.cpp diff --git a/drivers/wdm/audio/hdaudbus/CMakeLists.txt b/drivers/wdm/audio/hdaudbus/CMakeLists.txt index 3c5883dc64f..d129c3e8b1c 100644 --- a/drivers/wdm/audio/hdaudbus/CMakeLists.txt +++ b/drivers/wdm/audio/hdaudbus/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) diff --git a/modules/rosapps/applications/devutils/gdb2/CMakeLists.txt b/modules/rosapps/applications/devutils/gdb2/CMakeLists.txt index e3b71b498df..b427fdd57d0 100644 --- a/modules/rosapps/applications/devutils/gdb2/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/gdb2/CMakeLists.txt @@ -1,6 +1,6 @@ -set_cpp(WITH_RUNTIME) add_executable(gdb2 gdb2.cpp) +target_link_libraries(gdb2 cpprt) set_module_type(gdb2 win32cui) add_importlibs(gdb2 user32 msvcrt kernel32) add_cd_file(TARGET gdb2 DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt index 232244049b8..2f6541bb389 100644 --- a/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/shlextdbg/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_RUNTIME) add_definitions(-D_ATL_NO_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -7,6 +6,6 @@ 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) +target_link_libraries(shlextdbg uuid cpprt) add_importlibs(shlextdbg ole32 comctl32 shell32 user32 msvcrt kernel32) add_cd_file(TARGET shlextdbg DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/explorer-old/CMakeLists.txt b/modules/rosapps/applications/explorer-old/CMakeLists.txt index ca824c486f2..82c7d75c658 100644 --- a/modules/rosapps/applications/explorer-old/CMakeLists.txt +++ b/modules/rosapps/applications/explorer-old/CMakeLists.txt @@ -1,8 +1,6 @@ add_subdirectory(notifyhook) -set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) - add_definitions( -DWIN32 -D__WINDRES__) @@ -53,7 +51,8 @@ add_executable(explorer_old ${PCH_SKIP_SOURCE} explorer.rc) -target_link_libraries(explorer_old comsupp wine uuid) +target_link_libraries(explorer_old comsupp wine uuid cppstl) +set_target_cpp_properties(explorer_old WITH_EXCEPTIONS WITH_RTTI) set_module_type(explorer_old win32gui UNICODE) add_importlibs(explorer_old advapi32 gdi32 user32 ws2_32 msimg32 comctl32 ole32 oleaut32 shell32 shlwapi notifyhook msvcrt kernel32 ntdll) add_pch(explorer_old precomp.h "${PCH_SKIP_SOURCE}") diff --git a/modules/rosapps/applications/fraginator/CMakeLists.txt b/modules/rosapps/applications/fraginator/CMakeLists.txt index 7526d90bd8b..17d7d28037c 100644 --- a/modules/rosapps/applications/fraginator/CMakeLists.txt +++ b/modules/rosapps/applications/fraginator/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) - list(APPEND SOURCE Fraginator.cpp MainDialog.cpp @@ -12,12 +10,16 @@ list(APPEND UNFRAG_SOURCE DriveVolume.cpp) add_executable(frag ${SOURCE} ${UNFRAG_SOURCE} Fraginator.rc) +target_link_libraries(frag cppstl) +set_target_cpp_properties(frag WITH_EXCEPTIONS) set_module_type(frag win32gui UNICODE) add_importlibs(frag user32 advapi32 shell32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET frag DESTINATION reactos/system32 FOR all) add_executable(unfrag ${UNFRAG_SOURCE}) +target_link_libraries(unfrag cppstl) +set_target_cpp_properties(unfrag WITH_EXCEPTIONS) target_compile_definitions(unfrag PRIVATE "_CUI_") set_module_type(unfrag win32cui UNICODE) add_importlibs(unfrag advapi32 msvcrt kernel32 ntdll) -add_cd_file(TARGET unfrag DESTINATION reactos/system32 FOR all) \ No newline at end of file +add_cd_file(TARGET unfrag DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/net/netreg/CMakeLists.txt b/modules/rosapps/applications/net/netreg/CMakeLists.txt index 36425680b72..3f1f1784463 100644 --- a/modules/rosapps/applications/net/netreg/CMakeLists.txt +++ b/modules/rosapps/applications/net/netreg/CMakeLists.txt @@ -1,6 +1,7 @@ -set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) add_executable(netreg netreg.cpp netreg.rc) +target_link_libraries(netreg cppstl) +set_target_cpp_properties(netreg WITH_EXCEPTIONS) set_module_type(netreg win32cui) add_importlibs(netreg advapi32 user32 ws2_32 msvcrt kernel32 ntdll) add_cd_file(TARGET netreg DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/net/roshttpd/CMakeLists.txt b/modules/rosapps/applications/net/roshttpd/CMakeLists.txt index 72e02da811f..3cb22768855 100644 --- a/modules/rosapps/applications/net/roshttpd/CMakeLists.txt +++ b/modules/rosapps/applications/net/roshttpd/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) include_directories(BEFORE include) add_compile_flags("-D__USE_W32_SOCKETS") @@ -14,6 +13,8 @@ list(APPEND SOURCE common/thread.cpp) add_executable(roshttpd ${SOURCE} common/roshttpd.rc) +target_link_libraries(roshttpd cppstl) +set_target_cpp_properties(roshttpd WITH_EXCEPTIONS) set_module_type(roshttpd win32cui) add_importlibs(roshttpd user32 ws2_32 msvcrt kernel32) add_cd_file(TARGET roshttpd DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/fontsub/CMakeLists.txt b/modules/rosapps/applications/sysutils/fontsub/CMakeLists.txt index 09e1c733ca9..b24ae314ade 100644 --- a/modules/rosapps/applications/sysutils/fontsub/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/fontsub/CMakeLists.txt @@ -1,16 +1,17 @@ # FontSub by Katayama Hirofumi MZ -# +# # To the extent possible under law, the person who associated CC0 with # FontSub has waived all copyright and related or neighboring rights # to FontSub. -# +# # You should have received a copy of the CC0 legalcode along with this # work. If not, see <
http://creativecommons.org/publicdomain/zero/1.0/
>. -set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) - add_executable(fontsubedit fontsub.cpp fontsub_res.rc) +target_link_libraries(fontsubedit cppstl) set_module_type(fontsubedit win32gui UNICODE) add_importlibs(fontsubedit advapi32 comctl32 comdlg32 shell32 gdi32 user32 msvcrt kernel32) -set_target_properties(fontsubedit PROPERTIES OUTPUT_NAME "fontsub") +set_target_cpp_properties(fontsubedit WITH_EXCEPTIONS) +set_target_properties(fontsubedit PROPERTIES + OUTPUT_NAME "fontsub") add_cd_file(TARGET fontsubedit DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/regexpl/CMakeLists.txt b/modules/rosapps/applications/sysutils/regexpl/CMakeLists.txt index 2b767386bf0..1cd493d4887 100644 --- a/modules/rosapps/applications/sysutils/regexpl/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/regexpl/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_RUNTIME WITH_STL WITH_EXCEPTIONS) - list(APPEND SOURCE ArgumentParser.cpp Console.cpp @@ -31,6 +29,8 @@ list(APPEND SOURCE Prompt.cpp) add_executable(regexpl ${SOURCE} regexpl.rc) +target_link_libraries(regexpl cppstl) +set_target_cpp_properties(regexpl WITH_EXCEPTIONS) set_module_type(regexpl win32cui) add_importlibs(regexpl user32 advapi32 msvcrt kernel32 ntdll) add_cd_file(TARGET regexpl DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/lib/vfdlib/CMakeLists.txt b/modules/rosapps/lib/vfdlib/CMakeLists.txt index 9dcf9329424..d1c5946fb84 100644 --- a/modules/rosapps/lib/vfdlib/CMakeLists.txt +++ b/modules/rosapps/lib/vfdlib/CMakeLists.txt @@ -1,4 +1,3 @@ -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS WITH_STL) spec2def(vfd.dll vfdlib.spec ADD_IMPORTLIB) @@ -31,7 +30,8 @@ add_library(vfd MODULE include_directories(${REACTOS_SOURCE_DIR}/modules/rosapps/include/vfd ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) set_module_type(vfd win32dll ENTRYPOINT DllMain 12) -target_link_libraries(vfd zlib_solo uuid) +target_link_libraries(vfd zlib_solo uuid cppstl) +set_target_cpp_properties(vfd WITH_EXCEPTIONS) add_importlibs(vfd advapi32 user32 gdi32 shell32 comdlg32 comctl32 ole32 version psapi msvcrt kernel32 ntdll) add_dependencies(vfd vfdmsg_lib) add_cd_file(TARGET vfd DESTINATION reactos/system32 FOR all) diff --git a/modules/rostests/apitests/apphelp/CMakeLists.txt b/modules/rostests/apitests/apphelp/CMakeLists.txt index 5a17d8cbfe7..6bf9ddc0739 100644 --- a/modules/rostests/apitests/apphelp/CMakeLists.txt +++ b/modules/rostests/apitests/apphelp/CMakeLists.txt @@ -7,7 +7,6 @@ add_definitions( -D_UNICODE -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl ${CMAKE_CURRENT_BINARY_DIR}) @@ -26,10 +25,10 @@ list(APPEND SOURCE add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb COMMAND native-xml2sdb -i ${CMAKE_CURRENT_SOURCE_DIR}/testdb.xml -o ${CMAKE_CURRENT_BINARY_DIR}/testdb.sdb DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/testdb.xml native-xml2sdb) - + 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}) +target_link_libraries(apphelp_apitest ${PSEH_LIB} cpprt) add_importlibs(apphelp_apitest advapi32 userenv version shlwapi msvcrt kernel32 ntdll) add_rostests_file(TARGET apphelp_apitest) diff --git a/modules/rostests/apitests/atl/CMakeLists.txt b/modules/rostests/apitests/atl/CMakeLists.txt index c0c3781defd..11ca2fdd72c 100644 --- a/modules/rostests/apitests/atl/CMakeLists.txt +++ b/modules/rostests/apitests/atl/CMakeLists.txt @@ -1,6 +1,5 @@ add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -29,7 +28,8 @@ add_executable(atl_apitest ${PCH_SKIP_SOURCE} atl_apitest.rc) -target_link_libraries(atl_apitest wine uuid) +target_link_libraries(atl_apitest wine uuid cpprt) +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) add_pch(atl_apitest precomp.h "${PCH_SKIP_SOURCE}") diff --git a/modules/rostests/apitests/browseui/CMakeLists.txt b/modules/rostests/apitests/browseui/CMakeLists.txt index 053ca9776c5..2ae9cc3b895 100644 --- a/modules/rostests/apitests/browseui/CMakeLists.txt +++ b/modules/rostests/apitests/browseui/CMakeLists.txt @@ -1,12 +1,11 @@ -set_cpp(WITH_RTTI WITH_RUNTIME WITH_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}/sdk/lib/atl includes) list(APPEND SOURCE @@ -17,7 +16,9 @@ list(APPEND SOURCE testlist.c) add_executable(browseui_apitest ${SOURCE}) -target_link_libraries(browseui_apitest uuid wine) +target_link_libraries(browseui_apitest uuid wine cpprt) + +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) add_rostests_file(TARGET browseui_apitest) diff --git a/modules/rostests/apitests/fontext/CMakeLists.txt b/modules/rostests/apitests/fontext/CMakeLists.txt index 80654e4d7d5..aca32f42f27 100644 --- a/modules/rostests/apitests/fontext/CMakeLists.txt +++ b/modules/rostests/apitests/fontext/CMakeLists.txt @@ -6,7 +6,6 @@ add_definitions( -D_UNICODE -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl ${CMAKE_CURRENT_BINARY_DIR}) @@ -17,6 +16,6 @@ list(APPEND SOURCE add_executable(fontext_apitest ${SOURCE}) set_module_type(fontext_apitest win32cui) -target_link_libraries(fontext_apitest uuid ${PSEH_LIB}) +target_link_libraries(fontext_apitest uuid ${PSEH_LIB} cpprt) add_importlibs(fontext_apitest oleaut32 ole32 shell32 user32 msvcrt kernel32 ntdll) add_rostests_file(TARGET fontext_apitest) diff --git a/modules/rostests/apitests/msgina/CMakeLists.txt b/modules/rostests/apitests/msgina/CMakeLists.txt index 0d64a0c2336..9b873773950 100644 --- a/modules/rostests/apitests/msgina/CMakeLists.txt +++ b/modules/rostests/apitests/msgina/CMakeLists.txt @@ -2,7 +2,6 @@ add_definitions( -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -10,7 +9,7 @@ add_executable(msgina_apitest ShellDimScreen.cpp testlist.c) -target_link_libraries(msgina_apitest wine uuid) +target_link_libraries(msgina_apitest wine uuid cpprt) set_module_type(msgina_apitest win32cui) add_importlibs(msgina_apitest msvcrt user32 kernel32) add_rostests_file(TARGET msgina_apitest) diff --git a/modules/rostests/apitests/ole32/CMakeLists.txt b/modules/rostests/apitests/ole32/CMakeLists.txt index 4f6ad2dfdea..d3212869e12 100644 --- a/modules/rostests/apitests/ole32/CMakeLists.txt +++ b/modules/rostests/apitests/ole32/CMakeLists.txt @@ -1,7 +1,6 @@ -set_cpp(WITH_RUNTIME) add_executable(ole32_apitest initializespy.cpp testlist.c) -target_link_libraries(ole32_apitest wine uuid) +target_link_libraries(ole32_apitest wine uuid cpprt) set_module_type(ole32_apitest win32cui) add_importlibs(ole32_apitest user32 gdi32 shell32 ole32 shlwapi msvcrt kernel32) add_rostests_file(TARGET ole32_apitest) diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt b/modules/rostests/apitests/shell32/CMakeLists.txt index f719ab6ddab..39c81e5e59e 100644 --- a/modules/rostests/apitests/shell32/CMakeLists.txt +++ b/modules/rostests/apitests/shell32/CMakeLists.txt @@ -2,8 +2,6 @@ add_definitions( -D_ATL_NO_EXCEPTIONS) -set_cpp(WITH_RUNTIME) - spec2def(shell32_apitest.exe shell32_apitest.spec) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -46,7 +44,7 @@ add_executable(shell32_apitest resource.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32_apitest.def) -target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB}) +target_link_libraries(shell32_apitest wine uuid ${PSEH_LIB} cpprt) 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}") @@ -54,6 +52,7 @@ add_rostests_file(TARGET shell32_apitest) # shell-notify.exe add_executable(shell-notify shell-notify.cpp) +target_link_libraries(shell-notify cpprt) 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) diff --git a/modules/rostests/apitests/zipfldr/CMakeLists.txt b/modules/rostests/apitests/zipfldr/CMakeLists.txt index 63da6889d71..9bda3bd9b2c 100644 --- a/modules/rostests/apitests/zipfldr/CMakeLists.txt +++ b/modules/rostests/apitests/zipfldr/CMakeLists.txt @@ -1,7 +1,4 @@ -add_definitions(-DINITGUID -DWINETEST_USE_DBGSTR_LONGLONG) -set_cpp(WITH_RUNTIME WITH_EXCEPTIONS) - include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) list(APPEND SOURCE @@ -17,7 +14,8 @@ add_executable(zipfldr_apitest ${PCH_SKIP_SOURCE} zipfldr_apitest.rc) -target_link_libraries(zipfldr_apitest wine uuid) +target_link_libraries(zipfldr_apitest wine uuid cpprt) +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) add_pch(zipfldr_apitest precomp.h "${PCH_SKIP_SOURCE}") diff --git a/modules/rostests/rosautotest/CMakeLists.txt b/modules/rostests/rosautotest/CMakeLists.txt index 21f0cdd5e23..5d82a954936 100644 --- a/modules/rostests/rosautotest/CMakeLists.txt +++ b/modules/rostests/rosautotest/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_EXCEPTIONS WITH_STL) - list(APPEND SOURCE CConfiguration.cpp CFatalException.cpp @@ -21,6 +19,8 @@ list(APPEND SOURCE precomp.h) add_executable(rosautotest ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/rosautotestmsg.rc) +target_link_libraries(rosautotest cppstl) +set_target_cpp_properties(rosautotest WITH_EXCEPTIONS) set_module_type(rosautotest win32cui UNICODE) add_importlibs(rosautotest advapi32 shell32 user32 wininet msvcrt kernel32 ntdll) add_pch(rosautotest precomp.h SOURCE) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index fa408d7d631..707a6b2e524 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -1,86 +1,4 @@ -# set_cpp -# Marks the current folder as containing C++ modules, additionally enabling -# specific C++ language features as specified (all of these default to off): -# -# WITH_RUNTIME -# Links with the C++ runtime. Enable this for modules which use new/delete or -# RTTI, but do not require STL. This is the right choice if you see undefined -# references to operator new/delete, vector constructor/destructor iterator, -# type_info::vtable, ... -# Note: this only affects linking, so cannot be used for static libraries. -# WITH_RTTI -# Enables run-time type information. Enable this if the module uses typeid or -# dynamic_cast. You will probably need to enable WITH_RUNTIME as well, if -# you're not already using STL. -# WITH_EXCEPTIONS -# Enables C++ exception handling. 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). -# WITH_STL -# Enables standard C++ headers and links to the Standard Template Library. -# Use this for modules using anything from the std:: namespace, e.g. maps, -# strings, vectors, etc. -# Note: this affects both compiling (via include directories) and -# linking (by adding STL). Implies WITH_RUNTIME. -# FIXME: WITH_STL is currently also required for runtime headers such as -# <new> and <exception>. This is not a big issue because in stl-less -# environments you usually don't want those anyway; but we might want -# to have modules like this in the future. -# -# Examples: -# set_cpp() -# Enables the C++ language, but will cause errors if any runtime or standard -# library features are used. This should be the default for C++ in kernel -# mode or otherwise restricted environments. -# Note: this is required to get libgcc (for multiplication/division) linked -# in for C++ modules, and to set the correct language for precompiled -# header files, so it IS required even with no features specified. -# set_cpp(WITH_RUNTIME) -# Links with the C++ runtime, so that e.g. custom operator new implementations -# can be used in a restricted environment. This is also required for linking -# with libraries (such as ATL) which have RTTI enabled, even if the module in -# question does not use WITH_RTTI. -# set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) -# The full package. This will adjust compiler and linker so that all C++ -# features can be used. -macro(set_cpp) - cmake_parse_arguments(__cppopts "WITH_RUNTIME;WITH_RTTI;WITH_EXCEPTIONS;WITH_STL" "" "" ${ARGN}) - if(__cppopts_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "set_cpp: unparsed arguments ${__cppopts_UNPARSED_ARGUMENTS}") - endif() - - if(__cppopts_WITH_RUNTIME) - set(CPP_USE_RT 1) - endif() - if(__cppopts_WITH_RTTI) - if(MSVC) - replace_compile_flags("/GR-" "/GR") - else() - replace_compile_flags_language("-fno-rtti" "-frtti" "CXX") - endif() - endif() - if(__cppopts_WITH_EXCEPTIONS) - if(MSVC) - replace_compile_flags("/EHs-c-" "/EHsc") - else() - replace_compile_flags_language("-fno-exceptions" "-fexceptions" "CXX") - endif() - endif() - if(__cppopts_WITH_STL) - set(CPP_USE_STL 1) - if(MSVC) - add_definitions(-DNATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++) - include_directories(${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport) - else() - replace_compile_flags("-nostdinc" " ") - add_definitions(-DPAL_STDCPP_COMPAT) - endif() - endif() - - set(IS_CPP 1) -endmacro() - function(add_dependency_node _node) if(GENERATE_DEPENDENCY_GRAPH) get_target_property(_type ${_node} TYPE) @@ -988,3 +906,15 @@ else() macro(add_pch _target _pch _skip_list) endmacro() endif() + +function(set_target_cpp_properties _target) + cmake_parse_arguments(_CPP "WITH_EXCEPTIONS;WITH_RTTI" "" "" ${ARGN}) + + if (_CPP_WITH_EXCEPTIONS) + set_target_properties(${_target} PROPERTIES WITH_CXX_EXCEPTIONS TRUE) + endif() + + if (_CPP_WITH_RTTI) + set_target_properties(${_target} PROPERTIES WITH_CXX_RTTI TRUE) + endif() +endfunction() diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 1abe186c702..cf72baeeea4 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -41,8 +41,9 @@ endif() # Compiler Core add_compile_flags("-pipe -fms-extensions -fno-strict-aliasing") -# Prevent GCC from searching any of the default directories -add_compile_flags("-nostdinc") +# Prevent GCC from searching any of the default directories. +# The case for C++ is handled through the reactos_c++ INTERFACE library +add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>") add_compile_flags("-mstackrealign") add_compile_flags("-fno-aggressive-loop-optimizations") @@ -68,8 +69,6 @@ if(DBG) endif() endif() -add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX") - #bug #file(TO_NATIVE_PATH ${REACTOS_SOURCE_DIR} REACTOS_SOURCE_DIR_NATIVE) #workaround @@ -292,17 +291,6 @@ function(set_image_base MODULE IMAGE_BASE) endfunction() function(set_module_type_toolchain MODULE TYPE) - if(CPP_USE_STL) - if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) - message(FATAL_ERROR "Use of STL in kernelmodedriver or wdmdriver type module prohibited") - endif() - target_link_libraries(${MODULE} -lstdc++ -lsupc++ -lgcc -lmingwex) - elseif(CPP_USE_RT) - target_link_libraries(${MODULE} -lsupc++ -lgcc) - elseif(IS_CPP) - target_link_libraries(${MODULE} -lgcc) - endif() - if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) add_target_link_flags(${MODULE} "-Wl,--exclude-all-symbols,-file-alignment=0x1000,-section-alignment=0x1000") if(${TYPE} STREQUAL "wdmdriver") @@ -440,3 +428,47 @@ function(add_linker_script _target _linker_script_file) add_target_link_flags(${_target} "-Wl,-T,${_file_full_path}") add_target_property(${_target} LINK_DEPENDS ${_file_full_path}) endfunction() + +# Manage our C++ options +# we disable standard includes if we don't use the STL +add_compile_options("$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<IN_LIST:cppstl,$<TARGET_PROPERTY:LINK_LIBRARIES>>>>:-nostdinc>") +# we disable RTTI, unless said so +add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_RTTI>>,-frtti,-fno-rtti>>") +# We disable exceptions, unless said so +add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>,-fexceptions,-fno-exceptions>>") + +# Find default G++ libraries +add_library(libgcc STATIC IMPORTED) +execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libgcc.a OUTPUT_VARIABLE LIBGCC_LOCATION) +string(STRIP ${LIBGCC_LOCATION} LIBGCC_LOCATION) +set_target_properties(libgcc PROPERTIES IMPORTED_LOCATION ${LIBGCC_LOCATION}) +# libgcc needs kernel32 imports, a CRT and msvcrtex +target_link_libraries(libgcc INTERFACE libkernel32 libmsvcrt msvcrtex) + +add_library(libsupc++ STATIC IMPORTED GLOBAL) +execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libsupc++.a OUTPUT_VARIABLE LIBSUPCXX_LOCATION) +string(STRIP ${LIBSUPCXX_LOCATION} LIBSUPCXX_LOCATION) +set_target_properties(libsupc++ PROPERTIES IMPORTED_LOCATION ${LIBSUPCXX_LOCATION}) +# libsupc++ requires libgcc +target_link_libraries(libsupc++ INTERFACE libgcc) + +add_library(libmingwex STATIC IMPORTED) +execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libmingwex.a OUTPUT_VARIABLE LIBMINGWEX_LOCATION) +string(STRIP ${LIBMINGWEX_LOCATION} LIBMINGWEX_LOCATION) +set_target_properties(libmingwex PROPERTIES IMPORTED_LOCATION ${LIBMINGWEX_LOCATION}) +# libmingwex requires a CRT and imports from kernel32 +target_link_libraries(libmingwex INTERFACE libmsvcrt libkernel32) + +add_library(libstdc++ STATIC IMPORTED GLOBAL) +execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCCXX_LOCATION) +string(STRIP ${LIBSTDCCXX_LOCATION} LIBSTDCCXX_LOCATION) +set_target_properties(libstdc++ PROPERTIES IMPORTED_LOCATION ${LIBSTDCCXX_LOCATION}) +# libstdc++ requires libsupc++ and mingwex provided by GCC +target_link_libraries(libstdc++ INTERFACE libsupc++ libmingwex) +# this is for our SAL annotations +target_compile_definitions(libstdc++ INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:PAL_STDCPP_COMPAT>") + +# Create our alias libraries +add_library(cppstl ALIAS libstdc++) +add_library(cpprt ALIAS libsupc++) + diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake index e1899089a6f..3731ca4d500 100644 --- a/sdk/cmake/msvc.cmake +++ b/sdk/cmake/msvc.cmake @@ -42,7 +42,7 @@ endif() # Disable RTTI, exception handling and buffer security checks by default. # These require run-time support that may not always be available. -add_compile_flags("/GR- /EHs-c- /GS-") +add_compile_flags("/GS-") if(USE_CLANG_CL) set(CMAKE_CL_SHOWINCLUDES_PREFIX "Note: including file: ") @@ -252,14 +252,6 @@ function(set_image_base MODULE IMAGE_BASE) endfunction() function(set_module_type_toolchain MODULE TYPE) - if(CPP_USE_STL) - if((${TYPE} STREQUAL "kernelmodedriver") OR (${TYPE} STREQUAL "wdmdriver")) - message(FATAL_ERROR "Use of STL in kernelmodedriver or wdmdriver type module prohibited") - endif() - target_link_libraries(${MODULE} cpprt stlport oldnames) - elseif(CPP_USE_RT) - target_link_libraries(${MODULE} cpprt) - endif() if((${TYPE} STREQUAL "win32dll") OR (${TYPE} STREQUAL "win32ocx") OR (${TYPE} STREQUAL "cpl")) add_target_link_flags(${MODULE} "/DLL") elseif(${TYPE} STREQUAL "kernelmodedriver") @@ -559,3 +551,17 @@ function(add_linker_script _target _linker_script_file) add_target_property(${_target} LINK_DEPENDS ${_file_full_path}) endif() endfunction() + +# handle C++ options +# disable RTTI unless said so +add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_RTTI>>,/GR,/GR->>") +# disable exceptions unless said so +add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:$<IF:$<BOOL:$<TARGET_PROPERTY:WITH_CXX_EXCEPTIONS>>,/EHsc,/EHs-c->>") + +# Create our interface libraries wrapping the needed library for this compiler +add_library(cppstl INTERFACE) +target_link_libraries(cppstl INTERFACE cpprt stlport oldnames) +# We set this properties through our INTERFACE library +set_target_properties(cppstl PROPERTIES INTERFACE_WITH_CXX_STL TRUE) +# add_library(cpprt INTERFACE) +# Our runtime library is already called cpprt diff --git a/sdk/lib/3rdparty/cardlib/CMakeLists.txt b/sdk/lib/3rdparty/cardlib/CMakeLists.txt index ae2423020eb..1a90575b34b 100644 --- a/sdk/lib/3rdparty/cardlib/CMakeLists.txt +++ b/sdk/lib/3rdparty/cardlib/CMakeLists.txt @@ -1,5 +1,4 @@ -set_cpp() list(APPEND SOURCE cardbitmaps.cpp @@ -15,7 +14,9 @@ list(APPEND SOURCE dropzone.cpp cardlib.h) -add_library(cardlib ${SOURCE}) +add_library(cardlib STATIC ${SOURCE}) +target_link_libraries(cardlib PRIVATE cpprt) +target_include_directories(cardlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) if(NOT MSVC) target_compile_options(cardlib PRIVATE "-Wno-unused-but-set-variable") diff --git a/sdk/lib/3rdparty/stlport/CMakeLists.txt b/sdk/lib/3rdparty/stlport/CMakeLists.txt index 865475f8f1b..b2f245bb62f 100644 --- a/sdk/lib/3rdparty/stlport/CMakeLists.txt +++ b/sdk/lib/3rdparty/stlport/CMakeLists.txt @@ -2,13 +2,6 @@ #uncomment this if you want to test c++ compilation #add_subdirectory(test) -set_cpp(WITH_RTTI WITH_EXCEPTIONS WITH_STL) - -add_definitions( - -D_STLP_USE_EXCEPTIONS - -D_DLL -D__USE_CRTIMP - -D_BUILD_STLPORT) - list(APPEND SOURCE src/allocators.cpp src/bitset.cpp @@ -53,5 +46,14 @@ if(USE_CLANG_CL) target_compile_options(stlport PRIVATE -Wno-tautological-unsigned-zero-compare) endif() +target_include_directories(stlport PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport) +target_compile_definitions(stlport PRIVATE + _STLP_USE_EXCEPTIONS _DLL __USE_CRTIMP + _BUILD_STLPORT NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++) + +target_include_directories(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:${REACTOS_SOURCE_DIR}/sdk/include/c++/stlport>") +target_compile_definitions(stlport INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:NATIVE_CPP_INCLUDE=${REACTOS_SOURCE_DIR}/sdk/include/c++>") +set_target_cpp_properties(stlport WITH_EXCEPTIONS WITH_RTTI) + add_dependencies(stlport xdk) add_pch(stlport src/stlport_prefix.h SOURCE) diff --git a/sdk/lib/comsupp/CMakeLists.txt b/sdk/lib/comsupp/CMakeLists.txt index 52b78314817..885d09832a9 100644 --- a/sdk/lib/comsupp/CMakeLists.txt +++ b/sdk/lib/comsupp/CMakeLists.txt @@ -1,4 +1,6 @@ -set_cpp(WITH_EXCEPTIONS WITH_STL) add_library(comsupp comsupp.cpp) +target_link_libraries(comsupp PRIVATE cppstl) +set_target_cpp_properties(comsupp WITH_EXCEPTIONS) + add_dependencies(comsupp psdk) diff --git a/sdk/lib/cpprt/CMakeLists.txt b/sdk/lib/cpprt/CMakeLists.txt index de120e40423..7db6f5c1ea4 100644 --- a/sdk/lib/cpprt/CMakeLists.txt +++ b/sdk/lib/cpprt/CMakeLists.txt @@ -1,6 +1,4 @@ -set_cpp(WITH_EXCEPTIONS) - include_directories( ${REACTOS_SOURCE_DIR}/sdk/lib/crt/include ${REACTOS_SOURCE_DIR}/sdk/include/c++) @@ -21,4 +19,5 @@ elseif(ARCH STREQUAL "arm") endif() add_library(cpprt ${SOURCE} ${cpprt_asm}) +set_target_cpp_properties(cpprt WITH_EXCEPTIONS) add_dependencies(cpprt xdk) diff --git a/sdk/lib/drivers/sound/stdunk/CMakeLists.txt b/sdk/lib/drivers/sound/stdunk/CMakeLists.txt index b7f8fac0999..5825f84f4f2 100644 --- a/sdk/lib/drivers/sound/stdunk/CMakeLists.txt +++ b/sdk/lib/drivers/sound/stdunk/CMakeLists.txt @@ -1,4 +1,3 @@ -set_cpp() add_library(stdunk cunknown.cpp) add_dependencies(stdunk xdk)
4 years, 2 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200