diff --git a/base/services/nfsd/CMakeLists.txt b/base/services/nfsd/CMakeLists.txt index f0451522686..d92ff83d858 100644 --- a/base/services/nfsd/CMakeLists.txt +++ b/base/services/nfsd/CMakeLists.txt @@ -56,7 +56,7 @@ add_executable(nfsd ${SOURCE} nfsd.rc) if(MSVC AND (NOT USE_CLANG_CL)) else() # FIXME: Tons of warnings. - add_target_compile_flags(nfsd "-w") + target_compile_options(nfsd PRIVATE "-w") endif() set_module_type(nfsd win32cui) diff --git a/base/services/rpcss/CMakeLists.txt b/base/services/rpcss/CMakeLists.txt index 2ed8b49df35..a0dd14487df 100644 --- a/base/services/rpcss/CMakeLists.txt +++ b/base/services/rpcss/CMakeLists.txt @@ -17,7 +17,7 @@ include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos/wine) add_executable(rpcss ${SOURCE} rpcss.rc) if(USE_CLANG_CL) - add_target_compile_flags(rpcss "-Wno-cast-calling-convention") + target_compile_options(rpcss PRIVATE "-Wno-cast-calling-convention") endif() target_link_libraries(rpcss ${PSEH_LIB} wine) diff --git a/base/services/wlansvc/CMakeLists.txt b/base/services/wlansvc/CMakeLists.txt index f62b8eca9eb..0ac461728e5 100644 --- a/base/services/wlansvc/CMakeLists.txt +++ b/base/services/wlansvc/CMakeLists.txt @@ -11,7 +11,7 @@ list(APPEND SOURCE add_executable(wlansvc ${SOURCE} wlansvc.rc) if(USE_CLANG_CL) - add_target_compile_flags(wlansvc "-Wno-cast-calling-convention") + target_compile_options(wlansvc PRIVATE "-Wno-cast-calling-convention") endif() if(NOT MSVC) diff --git a/base/setup/usetup/CMakeLists.txt b/base/setup/usetup/CMakeLists.txt index 89891713ffd..1c6c85d1dcf 100644 --- a/base/setup/usetup/CMakeLists.txt +++ b/base/setup/usetup/CMakeLists.txt @@ -31,7 +31,7 @@ list(APPEND SOURCE add_executable(usetup ${SOURCE} usetup.rc) if(USE_CLANG_CL) - add_target_compile_flags(usetup "-Wno-invalid-source-encoding") + target_compile_options(usetup PRIVATE "-Wno-invalid-source-encoding") endif() add_pch(usetup usetup.h SOURCE) diff --git a/boot/freeldr/freeldr/CMakeLists.txt b/boot/freeldr/freeldr/CMakeLists.txt index 254dfa073ef..41d4ab68c86 100644 --- a/boot/freeldr/freeldr/CMakeLists.txt +++ b/boot/freeldr/freeldr/CMakeLists.txt @@ -222,7 +222,7 @@ add_library(freeldr_common if(USE_CLANG_CL) # We need to reduce the binary size - add_target_compile_flags(freeldr_common "/Os") + target_compile_options(freeldr_common PRIVATE "/Os") endif() if(NOT MSVC AND ARCH STREQUAL "i386" AND SARCH STREQUAL "xbox") # Prevent a warning when doing a memcmp with address 0 diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index 1c8255a9990..c8c388ba702 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -70,5 +70,5 @@ add_pch(libtiff precomp.h SOURCE) add_cd_file(TARGET libtiff DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(libtiff "-Wno-unused-but-set-variable") + 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 128fccc7a05..207ccb87a98 100644 --- a/dll/3rdparty/libtirpc/CMakeLists.txt +++ b/dll/3rdparty/libtirpc/CMakeLists.txt @@ -103,10 +103,10 @@ add_library(libtirpc MODULE if(MSVC AND (NOT USE_CLANG_CL)) replace_compile_flags("/we4101" " ") - add_target_compile_flags(libtirpc "/wd4101 /wd4133 /wd4473 /wd4477") + target_compile_options(libtirpc PRIVATE /wd4101 /wd4133 /wd4473 /wd4477) else() # FIXME: Tons of warnings. - add_target_compile_flags(libtirpc "-w") + target_compile_options(libtirpc PRIVATE "-w") endif() set_module_type(libtirpc win32dll) diff --git a/dll/3rdparty/libxslt/CMakeLists.txt b/dll/3rdparty/libxslt/CMakeLists.txt index 1ff2571361b..8105fdde4a9 100644 --- a/dll/3rdparty/libxslt/CMakeLists.txt +++ b/dll/3rdparty/libxslt/CMakeLists.txt @@ -51,5 +51,5 @@ add_pch(libxslt precomp.h SOURCE) add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(libxslt "-Wno-pointer-sign -Wno-unused-function") + target_compile_options(libxslt PRIVATE -Wno-pointer-sign -Wno-unused-function) endif() diff --git a/dll/3rdparty/mbedtls/CMakeLists.txt b/dll/3rdparty/mbedtls/CMakeLists.txt index dcc0a7c2b74..a67e183b003 100644 --- a/dll/3rdparty/mbedtls/CMakeLists.txt +++ b/dll/3rdparty/mbedtls/CMakeLists.txt @@ -94,7 +94,7 @@ add_definitions(-DMINGW_HAS_SECURE_API -DCRTDLL) add_cd_file(TARGET mbedtls DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(mbedtls "-Wno-pointer-sign -Wno-unused-function") + target_compile_options(mbedtls PRIVATE -Wno-pointer-sign -Wno-unused-function) elseif(USE_CLANG_CL) - add_target_compile_flags(mbedtls "-Wno-tautological-constant-compare") + target_compile_options(mbedtls PRIVATE -Wno-tautological-constant-compare) endif() diff --git a/dll/apisets/CMakeLists.txt b/dll/apisets/CMakeLists.txt index 4e658584755..27b82d2a281 100644 --- a/dll/apisets/CMakeLists.txt +++ b/dll/apisets/CMakeLists.txt @@ -25,9 +25,9 @@ function (add_apiset apiset_name baseaddress) set_module_type(${apiset_name} win32dll ENTRYPOINT 0 UNICODE IMAGEBASE ${baseaddress}) if(NOT MSVC) - add_target_compile_flags(${apiset_name} "-fno-builtin") + target_compile_options(${apiset_name} PRIVATE -fno-builtin) else() - add_target_compile_flags(${apiset_name} "/wd4026 /wd4273") + target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273) endif() add_importlibs(${apiset_name} ${ARGN} ntdll) diff --git a/dll/apisets/CMakeLists.txt.in b/dll/apisets/CMakeLists.txt.in index 1a12f9e89aa..69aaa9fa38d 100644 --- a/dll/apisets/CMakeLists.txt.in +++ b/dll/apisets/CMakeLists.txt.in @@ -25,9 +25,9 @@ function (add_apiset apiset_name baseaddress) set_module_type(${apiset_name} win32dll ENTRYPOINT 0 UNICODE IMAGEBASE ${baseaddress}) if(NOT MSVC) - add_target_compile_flags(${apiset_name} "-fno-builtin") + target_compile_options(${apiset_name} PRIVATE -fno-builtin) else() - add_target_compile_flags(${apiset_name} "/wd4026 /wd4273") + target_compile_options(${apiset_name} PRIVATE /wd4026 /wd4273) endif() add_importlibs(${apiset_name} ${ARGN} ntdll) diff --git a/dll/directx/wine/ddraw/CMakeLists.txt b/dll/directx/wine/ddraw/CMakeLists.txt index cd501d5d19b..4ac3ca28690 100644 --- a/dll/directx/wine/ddraw/CMakeLists.txt +++ b/dll/directx/wine/ddraw/CMakeLists.txt @@ -26,7 +26,7 @@ list(APPEND SOURCE if(MSVC) # FIXME: http://www.cmake.org/Bug/view.php?id=12998 - #add_target_compile_flags(ddraw "/FIwine/typeof.h") + #target_compile_options(ddraw PRIVATE "/FIwine/typeof.h") set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "/FIwine/typeof.h") endif() diff --git a/dll/nls/idndl/CMakeLists.txt b/dll/nls/idndl/CMakeLists.txt index efbd71ed0fd..a65540c0beb 100644 --- a/dll/nls/idndl/CMakeLists.txt +++ b/dll/nls/idndl/CMakeLists.txt @@ -11,7 +11,7 @@ add_library(idndl MODULE set_entrypoint(idndl 0) if(NOT MSVC) - add_target_compile_flags(idndl "-fno-exceptions -fno-rtti") + target_compile_options(idndl PRIVATE -fno-exceptions -fno-rtti) endif() add_importlibs(idndl kernel32) diff --git a/dll/opengl/glu32/CMakeLists.txt b/dll/opengl/glu32/CMakeLists.txt index 791cf2df1ea..b0caa74fabf 100644 --- a/dll/opengl/glu32/CMakeLists.txt +++ b/dll/opengl/glu32/CMakeLists.txt @@ -120,12 +120,12 @@ add_library(glu32 MODULE set_module_type(glu32 win32dll) if(NOT MSVC) - add_target_compile_flags(glu32 "-Wno-write-strings -Wno-unused-but-set-variable") + target_compile_options(glu32 PRIVATE -Wno-write-strings -Wno-unused-but-set-variable) # Prevent a warning when comparing 'this' against 0 set_source_files_properties(src/libnurbs/internals/arc.cc PROPERTIES COMPILE_FLAGS "-Wno-nonnull-compare") elseif(USE_CLANG_CL) - add_target_compile_flags(glu32 "-Wno-self-assign -Wno-unused-function -Wno-microsoft-include") - add_target_compile_flags(glu32 "-Wno-deprecated-register -Wno-tautological-undefined-compare") + target_compile_options(glu32 PRIVATE -Wno-self-assign -Wno-unused-function -Wno-microsoft-include) + target_compile_options(glu32 PRIVATE -Wno-deprecated-register -Wno-tautological-undefined-compare) endif() add_importlibs(glu32 opengl32 gdi32 msvcrt kernel32 ntdll) diff --git a/dll/win32/browseui/CMakeLists.txt b/dll/win32/browseui/CMakeLists.txt index d3787d2704e..562693288de 100644 --- a/dll/win32/browseui/CMakeLists.txt +++ b/dll/win32/browseui/CMakeLists.txt @@ -53,7 +53,7 @@ add_pch(browseui precomp.h SOURCE) add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(browseui "-Wno-unused-but-set-variable") + target_compile_options(browseui PRIVATE "-Wno-unused-but-set-variable") # Binutils linker bug if(LTCG) add_target_link_flags(browseui "-Wl,--allow-multiple-definition") diff --git a/dll/win32/browseui/shellbars/CMakeLists.txt b/dll/win32/browseui/shellbars/CMakeLists.txt index 64cc9b55f21..12b5a84a019 100644 --- a/dll/win32/browseui/shellbars/CMakeLists.txt +++ b/dll/win32/browseui/shellbars/CMakeLists.txt @@ -19,7 +19,7 @@ list(APPEND SOURCE add_library(shellbars ${SOURCE}) if(NOT MSVC) - add_target_compile_flags(shellbars "-Wno-unused-but-set-variable") + target_compile_options(shellbars PRIVATE "-Wno-unused-but-set-variable") endif() add_pch(shellbars shellbars.h SOURCE) diff --git a/dll/win32/browseui/shellfind/CMakeLists.txt b/dll/win32/browseui/shellfind/CMakeLists.txt index 1e3acddb288..0d7fd02d398 100644 --- a/dll/win32/browseui/shellfind/CMakeLists.txt +++ b/dll/win32/browseui/shellfind/CMakeLists.txt @@ -16,7 +16,7 @@ list(APPEND SOURCE add_library(shellfind ${SOURCE}) if(NOT MSVC) - add_target_compile_flags(shellfind "-Wno-unused-but-set-variable") + target_compile_options(shellfind PRIVATE "-Wno-unused-but-set-variable") endif() add_pch(shellfind shellfind.h SOURCE) diff --git a/dll/win32/fltlib/CMakeLists.txt b/dll/win32/fltlib/CMakeLists.txt index 7b4320ad692..6c65cd3ae5c 100644 --- a/dll/win32/fltlib/CMakeLists.txt +++ b/dll/win32/fltlib/CMakeLists.txt @@ -16,6 +16,6 @@ list(APPEND SOURCE add_library(fltlib MODULE ${SOURCE} rsrc.rc) set_module_type(fltlib win32dll) target_link_libraries(fltlib wine) -add_target_compile_definitions(fltlib NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(fltlib PRIVATE NTDDI_VERSION=NTDDI_WS03SP1) add_importlibs(fltlib msvcrt kernel32 ntdll) add_cd_file(TARGET fltlib DESTINATION reactos/system32 FOR all) diff --git a/dll/win32/mciseq/CMakeLists.txt b/dll/win32/mciseq/CMakeLists.txt index 62b3f54b341..8f1dd4ca5a3 100644 --- a/dll/win32/mciseq/CMakeLists.txt +++ b/dll/win32/mciseq/CMakeLists.txt @@ -14,5 +14,5 @@ add_importlibs(mciseq winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(mciseq "-Wno-overflow") + target_compile_options(mciseq PRIVATE "-Wno-overflow") endif() diff --git a/dll/win32/mciwave/CMakeLists.txt b/dll/win32/mciwave/CMakeLists.txt index e4b06aa0d2e..569b91f212c 100644 --- a/dll/win32/mciwave/CMakeLists.txt +++ b/dll/win32/mciwave/CMakeLists.txt @@ -17,5 +17,5 @@ add_importlibs(mciwave user32 winmm msvcrt kernel32 ntdll) add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(mciwave "-Wno-overflow") + target_compile_options(mciwave PRIVATE "-Wno-overflow") endif() diff --git a/dll/win32/winmm/CMakeLists.txt b/dll/win32/winmm/CMakeLists.txt index 8d697b4e6df..fd746a2bafb 100644 --- a/dll/win32/winmm/CMakeLists.txt +++ b/dll/win32/winmm/CMakeLists.txt @@ -33,7 +33,7 @@ add_pch(winmm winemm.h SOURCE) add_cd_file(TARGET winmm DESTINATION reactos/system32 FOR all) if(NOT MSVC) - add_target_compile_flags(winmm "-Wno-unused-but-set-variable") + target_compile_options(winmm PRIVATE "-Wno-unused-but-set-variable") endif() add_subdirectory(midimap) diff --git a/drivers/bluetooth/fbtusb/CMakeLists.txt b/drivers/bluetooth/fbtusb/CMakeLists.txt index 3ac3f8941dc..20c8d7bfd12 100644 --- a/drivers/bluetooth/fbtusb/CMakeLists.txt +++ b/drivers/bluetooth/fbtusb/CMakeLists.txt @@ -13,7 +13,7 @@ list(APPEND SOURCE add_library(fbtusb MODULE ${SOURCE} fbtusb.rc) if(NOT MSVC) - add_target_compile_flags(fbtusb "-Wno-unused-but-set-variable") + target_compile_options(fbtusb PRIVATE "-Wno-unused-but-set-variable") endif() set_module_type(fbtusb kernelmodedriver) diff --git a/drivers/filesystems/ext2/CMakeLists.txt b/drivers/filesystems/ext2/CMakeLists.txt index 13c6960e73b..b362a60f56d 100644 --- a/drivers/filesystems/ext2/CMakeLists.txt +++ b/drivers/filesystems/ext2/CMakeLists.txt @@ -96,16 +96,16 @@ 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" " ") - add_target_compile_flags(ext2fs "/wd4189 /wd4142 /wd4101") + target_compile_options(ext2fs PRIVATE /wd4189 /wd4142 /wd4101) else() - add_target_compile_flags(ext2fs "-Wno-pointer-sign -Wno-unused-function") - add_target_compile_flags(ext2fs "-Wno-unused-variable -Wno-missing-braces") + target_compile_options(ext2fs PRIVATE -Wno-pointer-sign -Wno-unused-function) + target_compile_options(ext2fs PRIVATE -Wno-unused-variable -Wno-missing-braces) if(USE_CLANG_CL) - add_target_compile_flags(ext2fs "-Wno-unused-value -Wno-parentheses-equality") - add_target_compile_flags(ext2fs "-Wno-incompatible-pointer-types-discards-qualifiers") - add_target_compile_flags(ext2fs "-Wno-#pragma-messages -Wno-cast-calling-convention") + target_compile_options(ext2fs PRIVATE -Wno-unused-value -Wno-parentheses-equality) + target_compile_options(ext2fs PRIVATE -Wno-incompatible-pointer-types-discards-qualifiers) + target_compile_options(ext2fs PRIVATE "-Wno-#pragma-messages;-Wno-cast-calling-convention") else() - add_target_compile_flags(ext2fs "-Wno-unused-but-set-variable") + target_compile_options(ext2fs PRIVATE -Wno-unused-but-set-variable) endif() endif() diff --git a/drivers/filesystems/ffs/CMakeLists.txt b/drivers/filesystems/ffs/CMakeLists.txt index 3f0b56d9423..b2e5135b84a 100644 --- a/drivers/filesystems/ffs/CMakeLists.txt +++ b/drivers/filesystems/ffs/CMakeLists.txt @@ -31,12 +31,12 @@ list(APPEND SOURCE add_library(ffs MODULE ${SOURCE} src/ffsdrv.rc) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(ffs "-Wno-pointer-sign -Wno-unused-function") - add_target_compile_flags(ffs "-Wno-unused-variable -Wno-missing-braces") + target_compile_options(ffs PRIVATE -Wno-pointer-sign -Wno-unused-function) + target_compile_options(ffs PRIVATE -Wno-unused-variable -Wno-missing-braces) if(USE_CLANG_CL) - add_target_compile_flags(ffs "-Wno-empty-body") + target_compile_options(ffs PRIVATE -Wno-empty-body) else() - add_target_compile_flags(ffs "-Wno-unused-but-set-variable") + target_compile_options(ffs PRIVATE -Wno-unused-but-set-variable) endif() endif() diff --git a/drivers/filesystems/nfs/CMakeLists.txt b/drivers/filesystems/nfs/CMakeLists.txt index 455d30127ec..9845ef76814 100644 --- a/drivers/filesystems/nfs/CMakeLists.txt +++ b/drivers/filesystems/nfs/CMakeLists.txt @@ -15,9 +15,9 @@ target_link_libraries(nfs41_driver ntoskrnl_vista rdbsslib rxce copysup memcmp $ add_importlibs(nfs41_driver ntoskrnl hal) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(nfs41_driver "-Wno-switch") + target_compile_options(nfs41_driver PRIVATE "-Wno-switch") if(USE_CLANG_CL) - add_target_compile_flags(nfs41_driver "-Wno-unused-value") + target_compile_options(nfs41_driver PRIVATE "-Wno-unused-value") endif() endif() diff --git a/drivers/filesystems/reiserfs/CMakeLists.txt b/drivers/filesystems/reiserfs/CMakeLists.txt index 51d1cddc462..cd939d40b85 100644 --- a/drivers/filesystems/reiserfs/CMakeLists.txt +++ b/drivers/filesystems/reiserfs/CMakeLists.txt @@ -79,16 +79,17 @@ list(APPEND SOURCE add_library(reiserfs MODULE ${SOURCE} src/rfsd.rc) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(reiserfs "-Wno-missing-braces -Wno-pointer-sign") - add_target_compile_flags(reiserfs "-Wno-unused-function -Wno-unused-variable") + target_compile_options(reiserfs PRIVATE -Wno-missing-braces -Wno-pointer-sign) + target_compile_options(reiserfs PRIVATE -Wno-unused-function -Wno-unused-variable) if(NOT USE_CLANG_CL) - add_target_compile_flags(reiserfs "-Wno-unused-but-set-variable -D__GCC__") + target_compile_options(reiserfs PRIVATE -Wno-unused-but-set-variable) + target_compile_definitions(reiserfs PRIVATE __GCC__) endif() else() #disable warnings: "unreferenced local variable", "initialized, but not used variable", "benign include" replace_compile_flags("/we4101" " ") replace_compile_flags("/we4189" " ") - add_target_compile_flags(reiserfs "/wd4189 /wd4142 /wd4101") + target_compile_options(reiserfs PRIVATE /wd4189 /wd4142 /wd4101) endif() target_link_libraries(reiserfs memcmp ${PSEH_LIB}) diff --git a/drivers/filesystems/udfs/CMakeLists.txt b/drivers/filesystems/udfs/CMakeLists.txt index 66ce8d5ec4c..8c13bf7d861 100644 --- a/drivers/filesystems/udfs/CMakeLists.txt +++ b/drivers/filesystems/udfs/CMakeLists.txt @@ -45,15 +45,15 @@ add_library(udfs MODULE ${SOURCE} udffs.rc) if(MSVC) # FIXME: Make sure we marked all what needs to be marked with stdcall before removing this. - add_target_compile_flags(udfs "/Gz") + target_compile_options(udfs PRIVATE "/Gz") if(USE_CLANG_CL) - add_target_compile_flags(udfs "-Wno-extern-c-compat -Wno-unused-value") - add_target_compile_flags(udfs "-Wno-tautological-constant-out-of-range-compare") - add_target_compile_flags(udfs "-Wno-tautological-unsigned-zero-compare -Wno-self-assign") - add_target_compile_flags(udfs "-Wno-sometimes-uninitialized -Wno-parentheses-equality") + target_compile_options(udfs PRIVATE -Wno-extern-c-compat -Wno-unused-value) + target_compile_options(udfs PRIVATE -Wno-tautological-constant-out-of-range-compare) + target_compile_options(udfs PRIVATE -Wno-tautological-unsigned-zero-compare -Wno-self-assign) + target_compile_options(udfs PRIVATE -Wno-sometimes-uninitialized -Wno-parentheses-equality) endif() else() - add_target_compile_flags(udfs "-Wno-unused-but-set-variable") + target_compile_options(udfs PRIVATE "-Wno-unused-but-set-variable") endif() set_module_type(udfs kernelmodedriver) diff --git a/drivers/filters/fltmgr/CMakeLists.txt b/drivers/filters/fltmgr/CMakeLists.txt index 92f86b20608..3a07ff28215 100644 --- a/drivers/filters/fltmgr/CMakeLists.txt +++ b/drivers/filters/fltmgr/CMakeLists.txt @@ -26,6 +26,6 @@ add_library(fltmgr MODULE set_module_type(fltmgr kernelmodedriver) target_link_libraries(fltmgr ${PSEH_LIB}) add_importlibs(fltmgr ntoskrnl hal) -add_target_compile_definitions(fltmgr NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(fltmgr PRIVATE NTDDI_VERSION=NTDDI_WS03SP1) add_pch(fltmgr fltmgr.h SOURCE) add_cd_file(TARGET fltmgr DESTINATION reactos/system32/drivers NO_CAB FOR all) diff --git a/drivers/storage/class/cdrom_new/CMakeLists.txt b/drivers/storage/class/cdrom_new/CMakeLists.txt index 34171764575..0d4e472eb28 100644 --- a/drivers/storage/class/cdrom_new/CMakeLists.txt +++ b/drivers/storage/class/cdrom_new/CMakeLists.txt @@ -13,9 +13,9 @@ add_library(cdrom_new MODULE ${SOURCE}) target_link_libraries(cdrom_new libcntpr wdmguid) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(cdrom_new "-Wno-format -Wno-unused-variable -Wno-pointer-sign") + target_compile_options(cdrom_new PRIVATE -Wno-format -Wno-unused-variable -Wno-pointer-sign) if(USE_CLANG_CL) - add_target_compile_flags(cdrom_new "-Wno-enum-conversion -Wno-tautological-constant-compare") + target_compile_options(cdrom_new PRIVATE -Wno-enum-conversion -Wno-tautological-constant-compare) endif() endif() diff --git a/drivers/storage/class/disk_new/CMakeLists.txt b/drivers/storage/class/disk_new/CMakeLists.txt index 82136b8f02a..252f6735ff2 100644 --- a/drivers/storage/class/disk_new/CMakeLists.txt +++ b/drivers/storage/class/disk_new/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(disk_new MODULE ${SOURCE} disk.rc) target_link_libraries(disk_new libcntpr wdmguid) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(disk_new "-Wno-format -Wno-pointer-sign") + target_compile_options(disk_new PRIVATE -Wno-format -Wno-pointer-sign) endif() set_module_type(disk_new kernelmodedriver) diff --git a/drivers/storage/ide/uniata/CMakeLists.txt b/drivers/storage/ide/uniata/CMakeLists.txt index 72e729ff506..163174825a4 100644 --- a/drivers/storage/ide/uniata/CMakeLists.txt +++ b/drivers/storage/ide/uniata/CMakeLists.txt @@ -23,11 +23,11 @@ list(APPEND SOURCE add_library(uniata MODULE ${SOURCE} idedma.rc) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(uniata "-Wno-narrowing") + target_compile_options(uniata PRIVATE "-Wno-narrowing") if(USE_CLANG_CL) - add_target_compile_flags(uniata "-Wno-unused-const-variable") + target_compile_options(uniata PRIVATE "-Wno-unused-const-variable") else() - add_target_compile_flags(uniata "-Wno-unused-but-set-variable") + target_compile_options(uniata PRIVATE "-Wno-unused-but-set-variable") endif() endif() diff --git a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt index b438197e941..60742e4626b 100644 --- a/drivers/wdm/audio/backpln/portcls/CMakeLists.txt +++ b/drivers/wdm/audio/backpln/portcls/CMakeLists.txt @@ -56,7 +56,7 @@ add_library(portcls MODULE ${CMAKE_CURRENT_BINARY_DIR}/portcls.def) if(USE_CLANG_CL) - add_target_compile_flags(portcls "-Wno-missing-braces") + target_compile_options(portcls PRIVATE "-Wno-missing-braces") endif() target_link_libraries(portcls libcntpr ${PSEH_LIB}) diff --git a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt index f992fa463e3..29202ba0933 100644 --- a/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt +++ b/drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt @@ -25,7 +25,7 @@ set_module_type(cmipci wdmdriver UNICODE) add_importlibs(cmipci portcls hal ntoskrnl) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(cmipci "-Wno-write-strings -Wno-switch") + target_compile_options(cmipci PRIVATE -Wno-write-strings -Wno-switch) endif() add_pch(cmipci precomp.h SOURCE) diff --git a/hal/halx86/minihal/CMakeLists.txt b/hal/halx86/minihal/CMakeLists.txt index 2d772d1205d..eb80a8ea0a1 100644 --- a/hal/halx86/minihal/CMakeLists.txt +++ b/hal/halx86/minihal/CMakeLists.txt @@ -27,6 +27,6 @@ list(APPEND MINI_HAL_SOURCE add_asm_files(mini_hal_asm ../generic/systimer.S) add_library(mini_hal ${MINI_HAL_SOURCE} ${mini_hal_asm}) -add_target_compile_definitions(mini_hal _BLDR_ _MINIHAL_) +target_compile_definitions(mini_hal PRIVATE _BLDR_ _MINIHAL_) add_dependencies(mini_hal psdk bugcodes asm) add_pch(mini_hal ../include/hal.h MINI_HAL_SOURCE) diff --git a/hal/halx86/xbox.cmake b/hal/halx86/xbox.cmake index c3604e70dfe..4d16aaa4834 100644 --- a/hal/halx86/xbox.cmake +++ b/hal/halx86/xbox.cmake @@ -39,7 +39,7 @@ list(APPEND HAL_XBOX_SOURCE add_asm_files(lib_hal_xbox_asm ${HAL_XBOX_ASM_SOURCE}) add_object_library(lib_hal_xbox ${HAL_XBOX_SOURCE} ${lib_hal_xbox_asm}) if(NOT SARCH STREQUAL "xbox") - add_target_compile_definitions(lib_hal_xbox SARCH_XBOX) + target_compile_definitions(lib_hal_xbox PRIVATE SARCH_XBOX) endif() add_dependencies(lib_hal_xbox bugcodes xdk asm) #add_pch(lib_hal_xbox xbox/halxbox.h) diff --git a/modules/rosapps/applications/devutils/symdump/CMakeLists.txt b/modules/rosapps/applications/devutils/symdump/CMakeLists.txt index 14c53460d04..0e0bd3b2adf 100644 --- a/modules/rosapps/applications/devutils/symdump/CMakeLists.txt +++ b/modules/rosapps/applications/devutils/symdump/CMakeLists.txt @@ -5,6 +5,6 @@ set_module_type(symdump win32cui) target_link_libraries(symdump wine) add_importlibs(symdump dbghelp shlwapi msvcrt kernel32 ntdll) if(NOT MSVC) - add_target_compile_flags(symdump "-Wno-unused-but-set-variable") + target_compile_options(symdump PRIVATE "-Wno-unused-but-set-variable") endif() add_cd_file(TARGET symdump DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/fraginator/CMakeLists.txt b/modules/rosapps/applications/fraginator/CMakeLists.txt index 1d66dc1671a..7526d90bd8b 100644 --- a/modules/rosapps/applications/fraginator/CMakeLists.txt +++ b/modules/rosapps/applications/fraginator/CMakeLists.txt @@ -17,7 +17,7 @@ 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}) -add_target_compile_definitions(unfrag "_CUI_") +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 diff --git a/modules/rosapps/applications/net/ncftp/CMakeLists.txt b/modules/rosapps/applications/net/ncftp/CMakeLists.txt index 58e794cdc94..41ad22bd30e 100644 --- a/modules/rosapps/applications/net/ncftp/CMakeLists.txt +++ b/modules/rosapps/applications/net/ncftp/CMakeLists.txt @@ -70,10 +70,9 @@ list(APPEND SOURCE add_executable(ncftp ${SOURCE} ncftp.rc) set_module_type(ncftp win32cui) +target_compile_definitions(ncftp PRIVATE HAVE_UTIME_H HAVE_UNISTD_H) if(NOT MSVC) - add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H -Wno-unused-but-set-variable") -else() - add_target_compile_flags(ncftp "-DHAVE_UTIME_H -DHAVE_UNISTD_H") + target_compile_options(ncftp PRIVATE -Wno-unused-but-set-variable) endif() add_importlibs(ncftp advapi32 user32 ws2_32 msvcrt kernel32) add_cd_file(TARGET ncftp DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/logevent/CMakeLists.txt b/modules/rosapps/applications/sysutils/logevent/CMakeLists.txt index b737ad2022f..7b5aba3b6cb 100644 --- a/modules/rosapps/applications/sysutils/logevent/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/logevent/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(logevent logevent.c logevent.rc) set_module_type(logevent win32cui) if(NOT MSVC) - add_target_compile_flags(logevent "-Wno-unused-but-set-variable") + target_compile_options(logevent PRIVATE "-Wno-unused-but-set-variable") endif() add_importlibs(logevent advapi32 msvcrt kernel32) add_cd_file(TARGET logevent DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/pedump/CMakeLists.txt b/modules/rosapps/applications/sysutils/pedump/CMakeLists.txt index b2805cbc346..ca2eade1876 100644 --- a/modules/rosapps/applications/sysutils/pedump/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/pedump/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(pedump pedump.c pedump.rc) set_module_type(pedump win32cui) if(NOT MSVC) - add_target_compile_flags(pedump "-Wno-unused-but-set-variable") + target_compile_options(pedump PRIVATE "-Wno-unused-but-set-variable") endif() add_importlibs(pedump msvcrt kernel32 ntdll) add_cd_file(TARGET pedump DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt b/modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt index 92d9621eadc..748d0f03544 100644 --- a/modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt @@ -12,7 +12,7 @@ list(APPEND SOURCE add_executable(rosperf ${SOURCE} rosperf.rc) set_module_type(rosperf win32cui UNICODE) if(NOT MSVC) - add_target_compile_flags(rosperf "-Wno-unused-but-set-variable") + target_compile_options(rosperf PRIVATE "-Wno-unused-but-set-variable") endif() add_importlibs(rosperf version msimg32 gdi32 shell32 advapi32 user32 ntdll msvcrt kernel32) add_cd_file(TARGET rosperf DESTINATION reactos/system32 FOR all) diff --git a/modules/rosapps/applications/winfile/CMakeLists.txt b/modules/rosapps/applications/winfile/CMakeLists.txt index 8b5228201c5..863ffd2fcdc 100644 --- a/modules/rosapps/applications/winfile/CMakeLists.txt +++ b/modules/rosapps/applications/winfile/CMakeLists.txt @@ -9,5 +9,5 @@ add_cd_file(TARGET winefile DESTINATION reactos/system32 FOR all) #if(NOT MSVC) # FIXME: http://www.cmake.org/Bug/view.php?id=12998 -# add_target_compile_flags(winefile "-Wno-format") +# target_compile_options(winefile PRIVATE "-Wno-format") #endif() diff --git a/modules/rosapps/templates/dialog/CMakeLists.txt b/modules/rosapps/templates/dialog/CMakeLists.txt index 6102bb4bfb4..16aed4a4261 100644 --- a/modules/rosapps/templates/dialog/CMakeLists.txt +++ b/modules/rosapps/templates/dialog/CMakeLists.txt @@ -10,7 +10,7 @@ list(APPEND SOURCE add_executable(template_dialog ${SOURCE} dialog.rc) set_module_type(template_dialog win32cui) if(NOT MSVC) - add_target_compile_flags(template_dialog "-Wno-unused-but-set-variable") + target_compile_options(template_dialog PRIVATE "-Wno-unused-but-set-variable") endif() add_importlibs(template_dialog user32 gdi32 comctl32 msvcrt kernel32 ntdll) add_cd_file(TARGET template_dialog DESTINATION reactos/system32 FOR all) diff --git a/modules/rostests/apitests/crt/crtdll_crt_apitest.cmake b/modules/rostests/apitests/crt/crtdll_crt_apitest.cmake index 6aa52ef6773..8361b7b1105 100644 --- a/modules/rostests/apitests/crt/crtdll_crt_apitest.cmake +++ b/modules/rostests/apitests/crt/crtdll_crt_apitest.cmake @@ -553,7 +553,7 @@ endif() add_executable(crtdll_crt_apitest testlist.c ${SOURCE_CRTDLL}) -add_target_compile_definitions(crtdll_crt_apitest TEST_CRTDLL) +target_compile_definitions(crtdll_crt_apitest PRIVATE TEST_CRTDLL) target_link_libraries(crtdll_crt_apitest wine ${PSEH_LIB}) set_module_type(crtdll_crt_apitest win32cui) add_importlibs(crtdll_crt_apitest crtdll msvcrt kernel32 ntdll) diff --git a/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake b/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake index 49c965dbac5..619fcdfa780 100644 --- a/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake +++ b/modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake @@ -1375,7 +1375,7 @@ endif() # Startup code doesn't go together well with the static CRT... too much __imp_ #add_executable(static_crt_apitest testlist.c ${SOURCE_MSVCRT}) -#add_target_compile_definitions(static_crt_apitest TEST_STATIC_CRT) +#target_compile_definitions(static_crt_apitest PRIVATE TEST_STATIC_CRT) #target_link_libraries(static_crt_apitest ${PSEH_LIB} crt wine) #set_module_type(static_crt_apitest win32cui) #add_importlibs(static_crt_apitest kernel32 ntdll) @@ -1391,7 +1391,7 @@ endif() #add_rostests_file(TARGET static_crt_dll_startup) add_executable(msvcrt_crt_apitest testlist.c ${SOURCE_MSVCRT}) -add_target_compile_definitions(msvcrt_crt_apitest TEST_MSVCRT) +target_compile_definitions(msvcrt_crt_apitest PRIVATE TEST_MSVCRT) target_link_libraries(msvcrt_crt_apitest wine ${PSEH_LIB}) set_module_type(msvcrt_crt_apitest win32cui) add_importlibs(msvcrt_crt_apitest msvcrt kernel32 ntdll) diff --git a/modules/rostests/apitests/crt/ntdll_crt_apitest.cmake b/modules/rostests/apitests/crt/ntdll_crt_apitest.cmake index 704288786fc..b9ffc61c5f4 100644 --- a/modules/rostests/apitests/crt/ntdll_crt_apitest.cmake +++ b/modules/rostests/apitests/crt/ntdll_crt_apitest.cmake @@ -152,7 +152,7 @@ elseif(ARCH STREQUAL "amd64") endif() add_executable(ntdll_crt_apitest testlist.c ${SOURCE_NTDLL}) -add_target_compile_definitions(ntdll_crt_apitest TEST_NTDLL) +target_compile_definitions(ntdll_crt_apitest PRIVATE TEST_NTDLL) target_link_libraries(ntdll_crt_apitest wine ${PSEH_LIB}) set_module_type(ntdll_crt_apitest win32cui) add_importlibs(ntdll_crt_apitest ntdll msvcrt kernel32) diff --git a/modules/rostests/kmtests/CMakeLists.txt b/modules/rostests/kmtests/CMakeLists.txt index 087bb31c704..4c03a27d58f 100644 --- a/modules/rostests/kmtests/CMakeLists.txt +++ b/modules/rostests/kmtests/CMakeLists.txt @@ -106,7 +106,7 @@ set_module_type(kmtest_drv kernelmodedriver) target_link_libraries(kmtest_drv kmtest_printf chkstk memcmp ntoskrnl_vista ${PSEH_LIB}) add_importlibs(kmtest_drv ntoskrnl hal) add_dependencies(kmtest_drv bugcodes xdk) -add_target_compile_definitions(kmtest_drv KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(kmtest_drv PRIVATE KMT_KERNEL_MODE NTDDI_VERSION=NTDDI_WS03SP1) #add_pch(kmtest_drv include/kmt_test.h) add_rostests_file(TARGET kmtest_drv) @@ -115,8 +115,8 @@ add_library(kmtest_printf ${REACTOS_SOURCE_DIR}/sdk/lib/crt/string/strnlen.c ${REACTOS_SOURCE_DIR}/sdk/lib/crt/string/wcsnlen.c ${REACTOS_SOURCE_DIR}/sdk/lib/crt/printf/streamout.c) -add_target_compile_definitions(kmtest_printf _LIBCNT_ _USER32_WSPRINTF wctomb=KmtWcToMb) -add_target_include_directories(kmtest_printf ${REACTOS_SOURCE_DIR}/sdk/lib/crt/include) +target_compile_definitions(kmtest_printf PRIVATE _LIBCNT_ _USER32_WSPRINTF wctomb=KmtWcToMb) +target_include_directories(kmtest_printf PRIVATE ${REACTOS_SOURCE_DIR}/sdk/lib/crt/include) # # kmtest.exe loader application @@ -159,7 +159,7 @@ add_executable(kmtest ${KMTEST_SOURCE}) set_module_type(kmtest win32cui) target_link_libraries(kmtest ${PSEH_LIB}) add_importlibs(kmtest fltlib advapi32 ws2_32 msvcrt kernel32 ntdll) -add_target_compile_definitions(kmtest KMT_USER_MODE NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(kmtest PRIVATE KMT_USER_MODE NTDDI_VERSION=NTDDI_WS03SP1) #add_pch(kmtest include/kmt_test.h) set_target_properties(kmtest PROPERTIES OUTPUT_NAME "kmtest_") add_rostests_file(TARGET kmtest) diff --git a/modules/rostests/kmtests/example/CMakeLists.txt b/modules/rostests/kmtests/example/CMakeLists.txt index a1a9b51db2b..824fccb29ca 100644 --- a/modules/rostests/kmtests/example/CMakeLists.txt +++ b/modules/rostests/kmtests/example/CMakeLists.txt @@ -9,6 +9,6 @@ add_library(example_drv MODULE ${EXAMPLE_DRV_SOURCE}) set_module_type(example_drv kernelmodedriver) target_link_libraries(example_drv kmtest_printf ${PSEH_LIB}) add_importlibs(example_drv ntoskrnl hal) -add_target_compile_definitions(example_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(example_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(example_drv ../include/kmt_test.h) add_rostests_file(TARGET example_drv) diff --git a/modules/rostests/kmtests/fltmgr/fltmgr_create/CMakeLists.txt b/modules/rostests/kmtests/fltmgr/fltmgr_create/CMakeLists.txt index cc700c52465..8d244b28323 100644 --- a/modules/rostests/kmtests/fltmgr/fltmgr_create/CMakeLists.txt +++ b/modules/rostests/kmtests/fltmgr/fltmgr_create/CMakeLists.txt @@ -9,6 +9,6 @@ add_library(fltmgr_create MODULE ${FLTMGR_TEST_DRV_SOURCE}) set_module_type(fltmgr_create kernelmodedriver) target_link_libraries(fltmgr_create kmtest_printf ${PSEH_LIB}) add_importlibs(fltmgr_create fltmgr ntoskrnl hal) -add_target_compile_definitions(fltmgr_create KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(fltmgr_create PRIVATE KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) #add_pch(example_drv ../include/kmt_test.h) add_rostests_file(TARGET fltmgr_create) diff --git a/modules/rostests/kmtests/fltmgr/fltmgr_load/CMakeLists.txt b/modules/rostests/kmtests/fltmgr/fltmgr_load/CMakeLists.txt index 1f41dd938c7..2095a385b4d 100644 --- a/modules/rostests/kmtests/fltmgr/fltmgr_load/CMakeLists.txt +++ b/modules/rostests/kmtests/fltmgr/fltmgr_load/CMakeLists.txt @@ -9,6 +9,6 @@ add_library(FltMgrLoad_drv MODULE ${FLTMGR_TEST_DRV_SOURCE}) set_module_type(FltMgrLoad_drv kernelmodedriver) target_link_libraries(FltMgrLoad_drv kmtest_printf ${PSEH_LIB}) add_importlibs(FltMgrLoad_drv fltmgr ntoskrnl hal) -add_target_compile_definitions(FltMgrLoad_drv KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(FltMgrLoad_drv PRIVATE KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) #add_pch(example_drv ../include/kmt_test.h) add_rostests_file(TARGET FltMgrLoad_drv) diff --git a/modules/rostests/kmtests/fltmgr/fltmgr_register/CMakeLists.txt b/modules/rostests/kmtests/fltmgr/fltmgr_register/CMakeLists.txt index 5faa8bf7a06..3c1c4a54d57 100644 --- a/modules/rostests/kmtests/fltmgr/fltmgr_register/CMakeLists.txt +++ b/modules/rostests/kmtests/fltmgr/fltmgr_register/CMakeLists.txt @@ -10,6 +10,6 @@ add_library(fltmgrreg_drv MODULE ${FLTMGR_TEST_DRV_SOURCE}) set_module_type(fltmgrreg_drv kernelmodedriver) target_link_libraries(fltmgrreg_drv kmtest_printf ${PSEH_LIB}) add_importlibs(fltmgrreg_drv fltmgr ntoskrnl hal) -add_target_compile_definitions(fltmgrreg_drv KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) +target_compile_definitions(fltmgrreg_drv PRIVATE KMT_STANDALONE_DRIVER KMT_FILTER_DRIVER NTDDI_VERSION=NTDDI_WS03SP1) #add_pch(example_drv ../include/kmt_test.h) add_rostests_file(TARGET fltmgrreg_drv) diff --git a/modules/rostests/kmtests/hidparse/CMakeLists.txt b/modules/rostests/kmtests/hidparse/CMakeLists.txt index 91064640adf..9ecd64bf340 100644 --- a/modules/rostests/kmtests/hidparse/CMakeLists.txt +++ b/modules/rostests/kmtests/hidparse/CMakeLists.txt @@ -13,6 +13,6 @@ add_library(hidp_drv MODULE ${HIDP_DRV_SOURCE}) set_module_type(hidp_drv kernelmodedriver) target_link_libraries(hidp_drv kmtest_printf ${PSEH_LIB}) add_importlibs(hidp_drv hidparse ntoskrnl hal) -add_target_compile_definitions(hidp_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(hidp_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(hidp_drv ../include/kmt_test.h) add_rostests_file(TARGET hidp_drv) diff --git a/modules/rostests/kmtests/kernel32/CMakeLists.txt b/modules/rostests/kmtests/kernel32/CMakeLists.txt index 6dd07ed60ca..529074e640c 100644 --- a/modules/rostests/kmtests/kernel32/CMakeLists.txt +++ b/modules/rostests/kmtests/kernel32/CMakeLists.txt @@ -9,6 +9,6 @@ add_library(kernel32_drv MODULE ${KERNEL32_DRV_SOURCE}) set_module_type(kernel32_drv kernelmodedriver) target_link_libraries(kernel32_drv kmtest_printf ${PSEH_LIB}) add_importlibs(kernel32_drv ntoskrnl hal) -add_target_compile_definitions(kernel32_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(kernel32_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(kernel32_drv ../include/kmt_test.h) add_rostests_file(TARGET kernel32_drv) diff --git a/modules/rostests/kmtests/ntos_cc/CMakeLists.txt b/modules/rostests/kmtests/ntos_cc/CMakeLists.txt index b31a1e50588..600e0106dd5 100644 --- a/modules/rostests/kmtests/ntos_cc/CMakeLists.txt +++ b/modules/rostests/kmtests/ntos_cc/CMakeLists.txt @@ -12,7 +12,7 @@ add_library(cccopyread_drv MODULE ${CCCOPYREAD_DRV_SOURCE}) set_module_type(cccopyread_drv kernelmodedriver) target_link_libraries(cccopyread_drv kmtest_printf ${PSEH_LIB}) add_importlibs(cccopyread_drv ntoskrnl hal) -add_target_compile_definitions(cccopyread_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(cccopyread_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(cccopyread_drv ../include/kmt_test.h) add_rostests_file(TARGET cccopyread_drv) @@ -27,7 +27,7 @@ add_library(cccopywrite_drv MODULE ${CCCOPYWRITE_DRV_SOURCE}) set_module_type(cccopywrite_drv kernelmodedriver) target_link_libraries(cccopywrite_drv kmtest_printf ${PSEH_LIB}) add_importlibs(cccopywrite_drv ntoskrnl hal) -add_target_compile_definitions(cccopywrite_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(cccopywrite_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(cccopyread_drv ../include/kmt_test.h) add_rostests_file(TARGET cccopywrite_drv) @@ -42,7 +42,7 @@ add_library(ccmapdata_drv MODULE ${CCMAPDATA_DRV_SOURCE}) set_module_type(ccmapdata_drv kernelmodedriver) target_link_libraries(ccmapdata_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ccmapdata_drv ntoskrnl hal) -add_target_compile_definitions(ccmapdata_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ccmapdata_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ccmapdata_drv ../include/kmt_test.h) add_rostests_file(TARGET ccmapdata_drv) @@ -57,7 +57,7 @@ add_library(ccpinmappeddata_drv MODULE ${CCPINMAPPEDDATA_DRV_SOURCE}) set_module_type(ccpinmappeddata_drv kernelmodedriver) target_link_libraries(ccpinmappeddata_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ccpinmappeddata_drv ntoskrnl hal) -add_target_compile_definitions(ccpinmappeddata_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ccpinmappeddata_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ccpinmappeddata_drv ../include/kmt_test.h) add_rostests_file(TARGET ccpinmappeddata_drv) @@ -72,7 +72,7 @@ add_library(ccpinread_drv MODULE ${CCPINREAD_DRV_SOURCE}) set_module_type(ccpinread_drv kernelmodedriver) target_link_libraries(ccpinread_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ccpinread_drv ntoskrnl hal) -add_target_compile_definitions(ccpinread_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ccpinread_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ccmapdata_drv ../include/kmt_test.h) add_rostests_file(TARGET ccpinread_drv) @@ -87,6 +87,6 @@ add_library(ccsetfilesizes_drv MODULE ${CCSETFILESIZES_DRV_SOURCE}) set_module_type(ccsetfilesizes_drv kernelmodedriver) target_link_libraries(ccsetfilesizes_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ccsetfilesizes_drv ntoskrnl hal) -add_target_compile_definitions(ccsetfilesizes_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ccsetfilesizes_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ccsetfilesizes_drv ../include/kmt_test.h) add_rostests_file(TARGET ccsetfilesizes_drv) diff --git a/modules/rostests/kmtests/ntos_io/CMakeLists.txt b/modules/rostests/kmtests/ntos_io/CMakeLists.txt index f1c142efcc2..cdcbe728f68 100644 --- a/modules/rostests/kmtests/ntos_io/CMakeLists.txt +++ b/modules/rostests/kmtests/ntos_io/CMakeLists.txt @@ -12,7 +12,7 @@ add_library(iocreatefile_drv MODULE ${IOCREATEFILE_DRV_SOURCE}) set_module_type(iocreatefile_drv kernelmodedriver) target_link_libraries(iocreatefile_drv kmtest_printf ${PSEH_LIB}) add_importlibs(iocreatefile_drv ntoskrnl hal) -add_target_compile_definitions(iocreatefile_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(iocreatefile_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(iocreatefile_drv ../include/kmt_test.h) add_rostests_file(TARGET iocreatefile_drv) @@ -27,7 +27,7 @@ add_library(iodeviceobject_drv MODULE ${IODEVICEOBJECT_DRV_SOURCE}) set_module_type(iodeviceobject_drv kernelmodedriver) target_link_libraries(iodeviceobject_drv kmtest_printf ${PSEH_LIB}) add_importlibs(iodeviceobject_drv ntoskrnl hal) -add_target_compile_definitions(iodeviceobject_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(iodeviceobject_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(iodeviceobject_drv ../include/kmt_test.h) add_rostests_file(TARGET iodeviceobject_drv) @@ -42,7 +42,7 @@ add_library(iohelper_drv MODULE ${IOHELPER_DRV_SOURCE}) set_module_type(iohelper_drv kernelmodedriver) target_link_libraries(iohelper_drv kmtest_printf ${PSEH_LIB}) add_importlibs(iohelper_drv ntoskrnl hal) -add_target_compile_definitions(iohelper_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(iohelper_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(iohelper_drv ../include/kmt_test.h) add_rostests_file(TARGET iohelper_drv) @@ -57,6 +57,6 @@ add_library(ioreadwrite_drv MODULE ${IOREADWRITE_DRV_SOURCE}) set_module_type(ioreadwrite_drv kernelmodedriver) target_link_libraries(ioreadwrite_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ioreadwrite_drv ntoskrnl hal) -add_target_compile_definitions(ioreadwrite_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ioreadwrite_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ioreadwrite_drv ../include/kmt_test.h) add_rostests_file(TARGET ioreadwrite_drv) diff --git a/modules/rostests/kmtests/ntos_mm/CMakeLists.txt b/modules/rostests/kmtests/ntos_mm/CMakeLists.txt index 6610bba053a..9072c8c05a7 100644 --- a/modules/rostests/kmtests/ntos_mm/CMakeLists.txt +++ b/modules/rostests/kmtests/ntos_mm/CMakeLists.txt @@ -12,7 +12,7 @@ add_library(ntcreatesection_drv MODULE ${NTCREATESECTION_DRV_SOURCE}) set_module_type(ntcreatesection_drv kernelmodedriver) target_link_libraries(ntcreatesection_drv kmtest_printf ${PSEH_LIB}) add_importlibs(ntcreatesection_drv ntoskrnl hal) -add_target_compile_definitions(ntcreatesection_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(ntcreatesection_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(ntcreatesection_drv ../include/kmt_test.h) add_rostests_file(TARGET ntcreatesection_drv) @@ -27,6 +27,6 @@ add_library(mmmaplockedpagesspecifycache_drv MODULE ${MMMAPLOCKEDPAGESSPECIFYCAC set_module_type(mmmaplockedpagesspecifycache_drv kernelmodedriver) target_link_libraries(mmmaplockedpagesspecifycache_drv kmtest_printf ${PSEH_LIB}) add_importlibs(mmmaplockedpagesspecifycache_drv ntoskrnl hal) -add_target_compile_definitions(mmmaplockedpagesspecifycache_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(mmmaplockedpagesspecifycache_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(mmmaplockedpagesspecifycache_drv ../include/kmt_test.h) add_rostests_file(TARGET mmmaplockedpagesspecifycache_drv) diff --git a/modules/rostests/kmtests/ntos_po/CMakeLists.txt b/modules/rostests/kmtests/ntos_po/CMakeLists.txt index 26258ad6160..bc5510af97e 100644 --- a/modules/rostests/kmtests/ntos_po/CMakeLists.txt +++ b/modules/rostests/kmtests/ntos_po/CMakeLists.txt @@ -12,6 +12,6 @@ add_library(poirp_drv MODULE ${POIRP_DRV_SOURCE}) set_module_type(poirp_drv kernelmodedriver) target_link_libraries(poirp_drv kmtest_printf ${PSEH_LIB}) add_importlibs(poirp_drv ntoskrnl hal) -add_target_compile_definitions(poirp_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(poirp_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(poirp_drv ../include/kmt_test.h) add_rostests_file(TARGET poirp_drv) diff --git a/modules/rostests/kmtests/tcpip/CMakeLists.txt b/modules/rostests/kmtests/tcpip/CMakeLists.txt index be094fa0ebe..94691d5f38b 100644 --- a/modules/rostests/kmtests/tcpip/CMakeLists.txt +++ b/modules/rostests/kmtests/tcpip/CMakeLists.txt @@ -11,6 +11,6 @@ add_library(tcpip_drv MODULE ${TCPIP_TEST_DRV_SOURCE}) set_module_type(tcpip_drv kernelmodedriver) target_link_libraries(tcpip_drv kmtest_printf ${PSEH_LIB}) add_importlibs(tcpip_drv ntoskrnl hal) -add_target_compile_definitions(tcpip_drv KMT_STANDALONE_DRIVER) +target_compile_definitions(tcpip_drv PRIVATE KMT_STANDALONE_DRIVER) #add_pch(example_drv ../include/kmt_test.h) add_rostests_file(TARGET tcpip_drv) diff --git a/modules/rostests/tests/pseh2/CMakeLists.txt b/modules/rostests/tests/pseh2/CMakeLists.txt index e737a974a09..fe5ee66e0b0 100644 --- a/modules/rostests/tests/pseh2/CMakeLists.txt +++ b/modules/rostests/tests/pseh2/CMakeLists.txt @@ -6,7 +6,7 @@ add_importlibs(pseh2_test msvcrt kernel32 ntdll) add_rostests_file(TARGET pseh2_test) if(NOT MSVC) - add_target_compile_flags(pseh2_test "-Wno-format") + target_compile_options(pseh2_test PRIVATE "-Wno-format") endif() @@ -17,5 +17,5 @@ add_importlibs(pseh2_test_cpp msvcrt kernel32 ntdll) add_rostests_file(TARGET pseh2_test_cpp) if(NOT MSVC) - add_target_compile_flags(pseh2_test_cpp "-Wno-format") + target_compile_options(pseh2_test_cpp PRIVATE "-Wno-format") endif() diff --git a/modules/rostests/winetests/advapi32/CMakeLists.txt b/modules/rostests/winetests/advapi32/CMakeLists.txt index 5d9cb9c3bde..5df0f3bf3f1 100644 --- a/modules/rostests/winetests/advapi32/CMakeLists.txt +++ b/modules/rostests/winetests/advapi32/CMakeLists.txt @@ -18,7 +18,7 @@ list(APPEND SOURCE add_executable(advapi32_winetest ${SOURCE} testlist.c) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(advapi32_winetest "-Wno-format") + target_compile_options(advapi32_winetest PRIVATE "-Wno-format") endif() set_module_type(advapi32_winetest win32cui) diff --git a/modules/rostests/winetests/comctl32/CMakeLists.txt b/modules/rostests/winetests/comctl32/CMakeLists.txt index 9212bc0fe14..42d37d7b02c 100644 --- a/modules/rostests/winetests/comctl32/CMakeLists.txt +++ b/modules/rostests/winetests/comctl32/CMakeLists.txt @@ -41,7 +41,7 @@ add_executable(comctl32_winetest rsrc.rc) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(comctl32_winetest "-Wno-format") + target_compile_options(comctl32_winetest PRIVATE "-Wno-format") endif() set_module_type(comctl32_winetest win32cui) diff --git a/modules/rostests/winetests/kernel32/CMakeLists.txt b/modules/rostests/winetests/kernel32/CMakeLists.txt index f591e0c1ee1..1194e45989b 100644 --- a/modules/rostests/winetests/kernel32/CMakeLists.txt +++ b/modules/rostests/winetests/kernel32/CMakeLists.txt @@ -49,7 +49,7 @@ add_executable(kernel32_winetest resource.rc) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(kernel32_winetest "-Wno-format") + target_compile_options(kernel32_winetest PRIVATE "-Wno-format") endif() set_module_type(kernel32_winetest win32cui) diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt b/modules/rostests/winetests/msvcrt/CMakeLists.txt index f63fa637a9b..90866735d1b 100644 --- a/modules/rostests/winetests/msvcrt/CMakeLists.txt +++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt @@ -28,7 +28,7 @@ list(APPEND SOURCE add_executable(msvcrt_winetest ${SOURCE} testlist.c) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(msvcrt_winetest "-Wno-format") + target_compile_options(msvcrt_winetest PRIVATE "-Wno-format") endif() set_module_type(msvcrt_winetest win32cui) diff --git a/modules/rostests/winetests/ntdll/CMakeLists.txt b/modules/rostests/winetests/ntdll/CMakeLists.txt index c0e90fe99d4..2262afe975d 100644 --- a/modules/rostests/winetests/ntdll/CMakeLists.txt +++ b/modules/rostests/winetests/ntdll/CMakeLists.txt @@ -33,7 +33,7 @@ endif() add_executable(ntdll_winetest ${SOURCE} testlist.c) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(ntdll_winetest "-Wno-format") + target_compile_options(ntdll_winetest PRIVATE "-Wno-format") endif() set_module_type(ntdll_winetest win32cui) diff --git a/modules/rostests/winetests/rpcrt4/CMakeLists.txt b/modules/rostests/winetests/rpcrt4/CMakeLists.txt index e92f9bbfad0..f764a4b89c7 100644 --- a/modules/rostests/winetests/rpcrt4/CMakeLists.txt +++ b/modules/rostests/winetests/rpcrt4/CMakeLists.txt @@ -41,9 +41,9 @@ endif() add_executable(rpcrt4_winetest ${SOURCE}) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(rpcrt4_winetest "-Wno-format") + target_compile_options(rpcrt4_winetest PRIVATE "-Wno-format") if(USE_CLANG_CL) - add_target_compile_flags(rpcrt4_winetest "-Wno-cast-calling-convention") + target_compile_options(rpcrt4_winetest PRIVATE "-Wno-cast-calling-convention") endif() endif() diff --git a/modules/rostests/winetests/winmm/CMakeLists.txt b/modules/rostests/winetests/winmm/CMakeLists.txt index 58cc1eb8072..c30a6b2a565 100644 --- a/modules/rostests/winetests/winmm/CMakeLists.txt +++ b/modules/rostests/winetests/winmm/CMakeLists.txt @@ -15,7 +15,7 @@ list(APPEND SOURCE add_executable(winmm_winetest ${SOURCE}) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(winmm_winetest "-Wno-format") + target_compile_options(winmm_winetest PRIVATE "-Wno-format") endif() target_link_libraries(winmm_winetest dxguid) diff --git a/modules/rostests/winetests/ws2_32/CMakeLists.txt b/modules/rostests/winetests/ws2_32/CMakeLists.txt index 8e0946d609e..2229f5787aa 100644 --- a/modules/rostests/winetests/ws2_32/CMakeLists.txt +++ b/modules/rostests/winetests/ws2_32/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(BEFORE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) add_executable(ws2_32_winetest protocol.c sock.c testlist.c) if(USE_CLANG_CL OR (NOT MSVC)) - add_target_compile_flags(ws2_32_winetest "-Wno-format") + target_compile_options(ws2_32_winetest PRIVATE "-Wno-format") endif() set_module_type(ws2_32_winetest win32cui) diff --git a/ntoskrnl/ntkrnlmp/CMakeLists.txt b/ntoskrnl/ntkrnlmp/CMakeLists.txt index 2853f45fe75..0c6e0a8edc3 100644 --- a/ntoskrnl/ntkrnlmp/CMakeLists.txt +++ b/ntoskrnl/ntkrnlmp/CMakeLists.txt @@ -18,7 +18,7 @@ add_executable(ntkrnlmp ${CMAKE_CURRENT_BINARY_DIR}/ntkrnlmp.def) set_property(TARGET ntkrnlmp PROPERTY ENABLE_EXPORTS TRUE) -add_target_compile_definitions(ntkrnlmp CONFIG_SMP) +target_compile_definitions(ntkrnlmp PRIVATE CONFIG_SMP) if(ARCH STREQUAL "i386") set_entrypoint(ntkrnlmp KiSystemStartup 4) diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index 99a12b2f554..a3be90baa74 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -608,7 +608,7 @@ function(add_importlibs _module) add_dependency_node(${_module}) foreach(LIB ${ARGN}) if("${LIB}" MATCHES "msvcrt") - add_target_compile_definitions(${_module} _DLL __USE_CRTIMP) + target_compile_definitions(${_module} PRIVATE _DLL __USE_CRTIMP) target_link_libraries(${_module} msvcrtex) endif() target_link_libraries(${_module} lib${LIB}) @@ -657,7 +657,7 @@ function(set_module_type MODULE TYPE) # Set unicode definitions if(__module_UNICODE) - add_target_compile_definitions(${MODULE} UNICODE _UNICODE) + target_compile_definitions(${MODULE} PRIVATE UNICODE _UNICODE) endif() # Set entry point diff --git a/sdk/cmake/compilerflags.cmake b/sdk/cmake/compilerflags.cmake index 669a4ff1df5..b89023e3565 100644 --- a/sdk/cmake/compilerflags.cmake +++ b/sdk/cmake/compilerflags.cmake @@ -31,16 +31,7 @@ endfunction() # arguments, all of which will be added to the list # # Examples: -# add_target_compile_flags(mymodule "-pedantic -O5") # add_target_link_flags(mymodule "-s --fatal-warnings") -# add_target_compile_definitions(mymodule WIN32 _WIN32 INLINE=inline) -# add_target_include_directories(mymodule include ../include) -function(add_target_compile_flags _module _flags) - if(${ARGC} GREATER 2) - message(FATAL_ERROR "Excess arguments to add_target_compile_flags! Module ${_module}, args ${ARGN}") - endif() - add_target_property(${_module} COMPILE_FLAGS ${_flags}) -endfunction() function(add_target_link_flags _module _flags) if(${ARGC} GREATER 2) @@ -49,14 +40,6 @@ function(add_target_link_flags _module _flags) add_target_property(${_module} LINK_FLAGS ${_flags}) endfunction() -function(add_target_compile_definitions _module) - add_target_property(${_module} COMPILE_DEFINITIONS ${ARGN}) -endfunction() - -function(add_target_include_directories _module) - add_target_property(${_module} INCLUDE_DIRECTORIES ${ARGN}) -endfunction() - # replace_compiler_option # (taken from LLVM) # Replaces a compiler option or switch `_old' in `_var' by `_new'. diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index c6bfb95d41a..5f0ea13b23a 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -231,7 +231,7 @@ elseif(NO_ROSSYM) else() # Normal rsym build get_target_property(RSYM native-rsym IMPORTED_LOCATION_NOCONFIG) - + set(CMAKE_C_LINK_EXECUTABLE " ${CMAKE_C_FLAGS} -o " "${RSYM} -s ${REACTOS_SOURCE_DIR} ") @@ -323,7 +323,7 @@ function(set_module_type_toolchain MODULE TYPE) #Disabled due to LD bug: ROSBE-154 #add_linker_script(${MODULE} ${REACTOS_SOURCE_DIR}/sdk/cmake/init-section.lds) endif() - + if(STACK_PROTECTOR) target_link_libraries(${MODULE} gcc_ssp) endif() @@ -366,7 +366,7 @@ endfunction() set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-lib=") set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-delaylib=") function(spec2def _dllname _spec_file) - + cmake_parse_arguments(__spec2def "ADD_IMPORTLIB;NO_PRIVATE_WARNINGS;WITH_RELAY" "VERSION" "" ${ARGN}) # Get library basename @@ -396,7 +396,7 @@ function(spec2def _dllname _spec_file) if(__spec2def_NO_PRIVATE_WARNINGS) set(_extraflags --no-private-warnings) endif() - + generate_import_lib(lib${_file} ${_dllname} ${_spec_file} ${_extraflags}) endif() endfunction() @@ -467,7 +467,7 @@ endfunction() function(allow_warnings __module) # We don't allow warnings in trunk, this needs to be reworked. See CORE-6959. - #add_target_compile_flags(${__module} "-Wno-error") + #target_compile_options(${__module} PRIVATE "-Wno-error") endfunction() macro(add_asm_files _target) diff --git a/sdk/lib/3rdparty/adns/CMakeLists.txt b/sdk/lib/3rdparty/adns/CMakeLists.txt index ff18daf5db4..d46b9e4cdfa 100644 --- a/sdk/lib/3rdparty/adns/CMakeLists.txt +++ b/sdk/lib/3rdparty/adns/CMakeLists.txt @@ -25,7 +25,7 @@ list(APPEND SOURCE add_library(adns ${SOURCE}) if(NOT MSVC) - add_target_compile_flags(adns "-Wno-unused-but-set-variable") + target_compile_options(adns PRIVATE "-Wno-unused-but-set-variable") endif() add_dependencies(adns psdk) diff --git a/sdk/lib/3rdparty/cardlib/CMakeLists.txt b/sdk/lib/3rdparty/cardlib/CMakeLists.txt index 224d8d396c7..ae2423020eb 100644 --- a/sdk/lib/3rdparty/cardlib/CMakeLists.txt +++ b/sdk/lib/3rdparty/cardlib/CMakeLists.txt @@ -18,7 +18,7 @@ list(APPEND SOURCE add_library(cardlib ${SOURCE}) if(NOT MSVC) - add_target_compile_flags(cardlib "-Wno-unused-but-set-variable") + target_compile_options(cardlib PRIVATE "-Wno-unused-but-set-variable") endif() add_dependencies(cardlib psdk) diff --git a/sdk/lib/3rdparty/freetype/CMakeLists.txt b/sdk/lib/3rdparty/freetype/CMakeLists.txt index f7e3313c5cd..f14ed5c47f5 100644 --- a/sdk/lib/3rdparty/freetype/CMakeLists.txt +++ b/sdk/lib/3rdparty/freetype/CMakeLists.txt @@ -61,5 +61,5 @@ list(APPEND SOURCE add_library(freetype ${SOURCE}) if(USE_CLANG_CL) - add_target_compile_flags(freetype "-Wno-tautological-constant-compare") + target_compile_options(freetype PRIVATE "-Wno-tautological-constant-compare") endif() diff --git a/sdk/lib/3rdparty/libxml2/CMakeLists.txt b/sdk/lib/3rdparty/libxml2/CMakeLists.txt index cbf577fc7d6..855d45ff9cd 100644 --- a/sdk/lib/3rdparty/libxml2/CMakeLists.txt +++ b/sdk/lib/3rdparty/libxml2/CMakeLists.txt @@ -67,11 +67,11 @@ add_library(libxml2 ${SOURCE}) if(MSVC AND (NOT USE_CLANG_CL)) # Unreferenced local variable replace_compile_flags("/we4101" " ") - add_target_compile_flags(libxml2 "/wd4101") + target_compile_options(libxml2 PRIVATE "/wd4101") # Local variable initialized but not referenced replace_compile_flags("/we4189" " ") else() - add_target_compile_flags(libxml2 "-w") + target_compile_options(libxml2 PRIVATE "-w") endif() target_link_libraries(libxml2 oldnames) diff --git a/sdk/lib/3rdparty/stlport/CMakeLists.txt b/sdk/lib/3rdparty/stlport/CMakeLists.txt index 17c902fdd34..865475f8f1b 100644 --- a/sdk/lib/3rdparty/stlport/CMakeLists.txt +++ b/sdk/lib/3rdparty/stlport/CMakeLists.txt @@ -48,9 +48,9 @@ add_library(stlport src/c_locale.c) if(USE_CLANG_CL) - add_target_compile_flags(stlport "-Wno-missing-braces -Wno-unused-local-typedef") - add_target_compile_flags(stlport "-Wno-infinite-recursion -Wno-deprecated-register") - add_target_compile_flags(stlport "-Wno-tautological-unsigned-zero-compare") + target_compile_options(stlport PRIVATE -Wno-missing-braces -Wno-unused-local-typedef) + target_compile_options(stlport PRIVATE -Wno-infinite-recursion -Wno-deprecated-register) + target_compile_options(stlport PRIVATE -Wno-tautological-unsigned-zero-compare) endif() add_dependencies(stlport xdk) diff --git a/sdk/lib/3rdparty/zlib/CMakeLists.txt b/sdk/lib/3rdparty/zlib/CMakeLists.txt index c68a46ee90c..a10936ea05a 100644 --- a/sdk/lib/3rdparty/zlib/CMakeLists.txt +++ b/sdk/lib/3rdparty/zlib/CMakeLists.txt @@ -36,13 +36,13 @@ if(CMAKE_CROSSCOMPILING) add_library(zlib ${SOURCE} ${SOLO_SOURCE}) target_include_directories(zlib PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) add_library(zlib_solo ${SOLO_SOURCE}) - add_target_compile_definitions(zlib_solo Z_SOLO) + target_compile_definitions(zlib_solo PRIVATE Z_SOLO) target_include_directories(zlib_solo PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) add_library(minizip ${MINIZIP_SOURCE}) add_dependencies(minizip psdk) target_include_directories(minizip PRIVATE ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) else() add_library(zlibhost ${SOLO_SOURCE}) - add_target_compile_definitions(zlibhost Z_SOLO) + target_compile_definitions(zlibhost PRIVATE Z_SOLO) target_include_directories(zlibhost PUBLIC ${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs/zlib) endif() diff --git a/sdk/lib/cmlib/CMakeLists.txt b/sdk/lib/cmlib/CMakeLists.txt index c94674f0cf8..d69202ba12d 100644 --- a/sdk/lib/cmlib/CMakeLists.txt +++ b/sdk/lib/cmlib/CMakeLists.txt @@ -29,7 +29,7 @@ else() target_include_directories(cmlibhost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if(NOT MSVC) - add_target_compile_flags(cmlibhost "-fshort-wchar -Wno-multichar") + target_compile_options(cmlibhost PRIVATE -fshort-wchar -Wno-multichar) endif() target_link_libraries(cmlibhost PRIVATE host_includes) diff --git a/sdk/lib/crt/CMakeLists.txt b/sdk/lib/crt/CMakeLists.txt index 6659b0b8581..03a366ce372 100644 --- a/sdk/lib/crt/CMakeLists.txt +++ b/sdk/lib/crt/CMakeLists.txt @@ -47,13 +47,13 @@ add_library(user32_wsprintf string/wcstombs_nt.c) add_dependencies(user32_wsprintf psdk) -add_target_compile_definitions(user32_wsprintf _USER32_WSPRINTF) +target_compile_definitions(user32_wsprintf PRIVATE _USER32_WSPRINTF) add_library(memcmp mem/memcmp.c) add_dependencies(memcmp psdk) add_library(getopt misc/getopt.c) -add_target_compile_definitions(getopt _DLL __USE_CRTIMP) +target_compile_definitions(getopt PRIVATE _DLL __USE_CRTIMP) add_dependencies(getopt psdk) add_library(strtol @@ -64,7 +64,7 @@ add_library(strtol string/strtoul.c string/strtoull.c string/wctype.c) -add_target_compile_definitions(strtol _LIBCNT_) +target_compile_definitions(strtol PRIVATE _LIBCNT_) add_dependencies(strtol psdk) diff --git a/sdk/lib/crt/crt.cmake b/sdk/lib/crt/crt.cmake index 91f186013b6..b200145c0d6 100644 --- a/sdk/lib/crt/crt.cmake +++ b/sdk/lib/crt/crt.cmake @@ -604,8 +604,8 @@ endif() add_library(crt ${CRT_SOURCE} ${CRT_WINE_SOURCE} ${crt_asm}) target_link_libraries(crt chkstk) -add_target_compile_definitions(crt - __MINGW_IMPORT=extern +target_compile_definitions(crt + PRIVATE __MINGW_IMPORT=extern USE_MSVCRT_PREFIX _MSVCRT_LIB_ _MSVCRT_ diff --git a/sdk/lib/crt/libcntpr.cmake b/sdk/lib/crt/libcntpr.cmake index aa3b1d4fa67..1a49be53d75 100644 --- a/sdk/lib/crt/libcntpr.cmake +++ b/sdk/lib/crt/libcntpr.cmake @@ -241,8 +241,8 @@ set_source_files_properties(${LIBCNTPR_ASM_SOURCE} PROPERTIES COMPILE_DEFINITION add_asm_files(libcntpr_asm ${LIBCNTPR_ASM_SOURCE}) add_library(libcntpr ${LIBCNTPR_SOURCE} ${libcntpr_asm}) -add_target_compile_definitions(libcntpr - NO_RTL_INLINES +target_compile_definitions(libcntpr + PRIVATE NO_RTL_INLINES _NTSYSTEM_ _NTDLLBUILD_ _LIBCNT_ diff --git a/sdk/lib/crt/msvcrtex.cmake b/sdk/lib/crt/msvcrtex.cmake index 3da70e6b10b..3d68ce5189f 100644 --- a/sdk/lib/crt/msvcrtex.cmake +++ b/sdk/lib/crt/msvcrtex.cmake @@ -102,7 +102,7 @@ set_source_files_properties(${MSVCRTEX_ASM_SOURCE} PROPERTIES COMPILE_DEFINITION add_asm_files(msvcrtex_asm ${MSVCRTEX_ASM_SOURCE}) add_library(msvcrtex ${MSVCRTEX_SOURCE} ${msvcrtex_asm}) -add_target_compile_definitions(msvcrtex _DLL _MSVCRTEX_) +target_compile_definitions(msvcrtex PRIVATE _DLL _MSVCRTEX_) 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) diff --git a/sdk/lib/inflib/CMakeLists.txt b/sdk/lib/inflib/CMakeLists.txt index 1688d691b3e..df44bf18794 100644 --- a/sdk/lib/inflib/CMakeLists.txt +++ b/sdk/lib/inflib/CMakeLists.txt @@ -26,7 +26,7 @@ else() target_include_directories(inflibhost INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) if(NOT MSVC) - add_target_compile_flags(inflibhost "-fshort-wchar -Wpointer-arith -Wwrite-strings") + target_compile_options(inflibhost PRIVATE -fshort-wchar -Wpointer-arith -Wwrite-strings) endif() target_link_libraries(inflibhost PRIVATE host_includes) diff --git a/sdk/lib/lsalib/CMakeLists.txt b/sdk/lib/lsalib/CMakeLists.txt index acf1c285f10..ca3316c43ad 100644 --- a/sdk/lib/lsalib/CMakeLists.txt +++ b/sdk/lib/lsalib/CMakeLists.txt @@ -5,5 +5,5 @@ add_library(lsalib lsa.c) add_dependencies(lsalib xdk) add_library(ntlsalib lsa.c) -add_target_compile_definitions(ntlsalib _NTSYSTEM_) +target_compile_definitions(ntlsalib PRIVATE _NTSYSTEM_) add_dependencies(ntlsalib xdk) diff --git a/sdk/tools/hhpcomp/CMakeLists.txt b/sdk/tools/hhpcomp/CMakeLists.txt index fa8a7c6f00e..50fd03c94ef 100644 --- a/sdk/tools/hhpcomp/CMakeLists.txt +++ b/sdk/tools/hhpcomp/CMakeLists.txt @@ -17,8 +17,8 @@ target_link_libraries(hhpcomp) if(MSVC) # Disable warning "'x': unreferenced local variable" - add_target_compile_flags(hhpcomp "/wd4101") + target_compile_options(hhpcomp PRIVATE "/wd4101") # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" - add_target_compile_flags(hhpcomp "/wd4244") + target_compile_options(hhpcomp PRIVATE "/wd4244") endif() diff --git a/sdk/tools/hpp/CMakeLists.txt b/sdk/tools/hpp/CMakeLists.txt index 3ca527e44fd..72ff8b02414 100644 --- a/sdk/tools/hpp/CMakeLists.txt +++ b/sdk/tools/hpp/CMakeLists.txt @@ -3,5 +3,5 @@ add_host_tool(hpp hpp.c) if(MSVC) # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" - add_target_compile_flags(hpp "/wd4244") + target_compile_options(hpp PRIVATE "/wd4244") endif() diff --git a/sdk/tools/mkhive/CMakeLists.txt b/sdk/tools/mkhive/CMakeLists.txt index 7f1845d6387..eb840ba9dab 100644 --- a/sdk/tools/mkhive/CMakeLists.txt +++ b/sdk/tools/mkhive/CMakeLists.txt @@ -11,7 +11,7 @@ add_host_tool(mkhive ${SOURCE}) target_include_directories(mkhive PRIVATE ${REACTOS_SOURCE_DIR}/sdk/lib/rtl) target_compile_definitions(mkhive PRIVATE -DMKHIVE_HOST) if(NOT MSVC) - add_target_compile_flags(mkhive "-fshort-wchar") + target_compile_options(mkhive PRIVATE "-fshort-wchar") endif() target_link_libraries(mkhive PRIVATE host_includes unicode cmlibhost inflibhost) diff --git a/sdk/tools/mkisofs/CMakeLists.txt b/sdk/tools/mkisofs/CMakeLists.txt index 82704df3066..0caa8c8bc79 100644 --- a/sdk/tools/mkisofs/CMakeLists.txt +++ b/sdk/tools/mkisofs/CMakeLists.txt @@ -83,27 +83,27 @@ target_link_libraries(mkisofs libmdigest libschily libsiconv) if(MSVC) # mkisofs uses K&R-style function definitions to support very old compilers. # MSVC complains about the resulting foo() vs. foo(void) mismatches. - add_target_compile_flags(mkisofs "/wd4113") + target_compile_options(mkisofs PRIVATE "/wd4113") if (ARCH STREQUAL "amd64") # Disable warning "conversion from 'size_t' to 'int', possible loss of data" - add_target_compile_flags(mkisofs "/wd4267") + target_compile_options(mkisofs PRIVATE "/wd4267") # Disable warning "'type cast': pointer truncation from 'const char *' to 'long'" - add_target_compile_flags(libschily "/wd4311") + target_compile_options(libschily PRIVATE "/wd4311") endif() # Disable warning "'<': signed/unsigned mismatch" - add_target_compile_flags(mkisofs "/wd4018") + target_compile_options(mkisofs PRIVATE "/wd4018") # Disable warning "'nchar': unreferenced local variable" - add_target_compile_flags(mkisofs "/wd4101") + target_compile_options(mkisofs PRIVATE "/wd4101") # Disable warning "'+=': conversion from 'x' to 'y', possible loss of data" - add_target_compile_flags(libschily "/wd4244") - add_target_compile_flags(mkisofs "/wd4244") + target_compile_options(libschily PRIVATE "/wd4244") + target_compile_options(mkisofs PRIVATE "/wd4244") else() # libschily implements an own printf function with support for the %r formatter. # Silence compilers checking for invalid formatting sequences. - add_target_compile_flags(libschily "-Wno-format") + target_compile_options(libschily PRIVATE "-Wno-format") endif() diff --git a/sdk/tools/unicode/CMakeLists.txt b/sdk/tools/unicode/CMakeLists.txt index 85c668dead7..424fcd715dd 100644 --- a/sdk/tools/unicode/CMakeLists.txt +++ b/sdk/tools/unicode/CMakeLists.txt @@ -89,11 +89,11 @@ target_link_libraries(unicode PRIVATE host_includes) if(MSVC) # Disable warning "'<': signed/unsigned mismatch" - add_target_compile_flags(unicode "/wd4018") + target_compile_options(unicode PRIVATE "/wd4018") # Disable warning "unary minus operator applied to unsigned type, result still unsigned" - add_target_compile_flags(unicode "/wd4146") + target_compile_options(unicode PRIVATE "/wd4146") # Disable warning "conversion from 'const WCHAR' to 'char', possible loss of data" - add_target_compile_flags(unicode "/wd4244") + target_compile_options(unicode PRIVATE "/wd4244") endif() diff --git a/sdk/tools/widl/CMakeLists.txt b/sdk/tools/widl/CMakeLists.txt index 51e7356ee74..22fa0846602 100644 --- a/sdk/tools/widl/CMakeLists.txt +++ b/sdk/tools/widl/CMakeLists.txt @@ -38,11 +38,11 @@ target_link_libraries(widl PRIVATE host_includes wpphost) if(MSVC) # Disable warning "'>': signed/unsigned mismatch" - add_target_compile_flags(widl "/wd4018") + target_compile_options(widl PRIVATE "/wd4018") # Disable warning "unary minus operator applied to unsigned type, result still unsigned" - add_target_compile_flags(widl "/wd4146") + target_compile_options(widl PRIVATE "/wd4146") # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" - add_target_compile_flags(widl "/wd4244") + target_compile_options(widl PRIVATE "/wd4244") endif() diff --git a/sdk/tools/xml2sdb/CMakeLists.txt b/sdk/tools/xml2sdb/CMakeLists.txt index 8c302ced7dc..739e48a9b7e 100644 --- a/sdk/tools/xml2sdb/CMakeLists.txt +++ b/sdk/tools/xml2sdb/CMakeLists.txt @@ -17,7 +17,7 @@ target_link_libraries(xml2sdb PRIVATE host_includes) if(MSVC) # Disable warning "'=': conversion from 'a' to 'b', possible loss of data" - add_target_compile_flags(xml2sdb "/wd4244") + target_compile_options(xml2sdb PRIVATE "/wd4244") else() - add_target_compile_flags(xml2sdb "-fshort-wchar") + target_compile_options(xml2sdb PRIVATE "-fshort-wchar") endif() diff --git a/win32ss/printing/base/spoolsv/CMakeLists.txt b/win32ss/printing/base/spoolsv/CMakeLists.txt index da7f7b8bf5c..d2e8ed1026c 100644 --- a/win32ss/printing/base/spoolsv/CMakeLists.txt +++ b/win32ss/printing/base/spoolsv/CMakeLists.txt @@ -24,7 +24,7 @@ list(APPEND SOURCE add_executable(spoolsv ${SOURCE} spoolsv.rc) if(USE_CLANG_CL) - add_target_compile_flags(spoolsv "-Wno-cast-calling-convention") + target_compile_options(spoolsv PRIVATE "-Wno-cast-calling-convention") endif() set_module_type(spoolsv win32cui UNICODE) diff --git a/win32ss/user/winsrv/consrv.cmake b/win32ss/user/winsrv/consrv.cmake index 9f421ca8f1d..48fb96d2de2 100644 --- a/win32ss/user/winsrv/consrv.cmake +++ b/win32ss/user/winsrv/consrv.cmake @@ -45,10 +45,10 @@ list(APPEND CONSRV_SOURCE # FIXME: http://www.cmake.org/Bug/view.php?id=12998 if(MSVC) ## NOTE: No need to specify it as we use MSVC :) - ##add_target_compile_flags(consrv "/Ze") + ##target_compile_options(consrv PRIVATE "/Ze") #set_source_files_properties(${CONSRV_SOURCE} PROPERTIES COMPILE_FLAGS "/Ze") else() - #add_target_compile_flags(consrv "-fms-extensions") + #target_compile_options(consrv PRIVATE "-fms-extensions") set_source_files_properties(${CONSRV_SOURCE} PROPERTIES COMPILE_FLAGS "-fms-extensions") endif()