[CMAKE] Replace custom functions to built-in ones
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Thu, 16 Apr 2020 12:59:38 +0000 (15:59 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Thu, 16 Apr 2020 12:59:38 +0000 (15:59 +0300)
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories

93 files changed:
base/services/nfsd/CMakeLists.txt
base/services/rpcss/CMakeLists.txt
base/services/wlansvc/CMakeLists.txt
base/setup/usetup/CMakeLists.txt
boot/freeldr/freeldr/CMakeLists.txt
dll/3rdparty/libtiff/CMakeLists.txt
dll/3rdparty/libtirpc/CMakeLists.txt
dll/3rdparty/libxslt/CMakeLists.txt
dll/3rdparty/mbedtls/CMakeLists.txt
dll/apisets/CMakeLists.txt
dll/apisets/CMakeLists.txt.in
dll/directx/wine/ddraw/CMakeLists.txt
dll/nls/idndl/CMakeLists.txt
dll/opengl/glu32/CMakeLists.txt
dll/win32/browseui/CMakeLists.txt
dll/win32/browseui/shellbars/CMakeLists.txt
dll/win32/browseui/shellfind/CMakeLists.txt
dll/win32/fltlib/CMakeLists.txt
dll/win32/mciseq/CMakeLists.txt
dll/win32/mciwave/CMakeLists.txt
dll/win32/winmm/CMakeLists.txt
drivers/bluetooth/fbtusb/CMakeLists.txt
drivers/filesystems/ext2/CMakeLists.txt
drivers/filesystems/ffs/CMakeLists.txt
drivers/filesystems/nfs/CMakeLists.txt
drivers/filesystems/reiserfs/CMakeLists.txt
drivers/filesystems/udfs/CMakeLists.txt
drivers/filters/fltmgr/CMakeLists.txt
drivers/storage/class/cdrom_new/CMakeLists.txt
drivers/storage/class/disk_new/CMakeLists.txt
drivers/storage/ide/uniata/CMakeLists.txt
drivers/wdm/audio/backpln/portcls/CMakeLists.txt
drivers/wdm/audio/drivers/CMIDriver/CMakeLists.txt
hal/halx86/minihal/CMakeLists.txt
hal/halx86/xbox.cmake
modules/rosapps/applications/devutils/symdump/CMakeLists.txt
modules/rosapps/applications/fraginator/CMakeLists.txt
modules/rosapps/applications/net/ncftp/CMakeLists.txt
modules/rosapps/applications/sysutils/logevent/CMakeLists.txt
modules/rosapps/applications/sysutils/pedump/CMakeLists.txt
modules/rosapps/applications/sysutils/utils/rosperf/CMakeLists.txt
modules/rosapps/applications/winfile/CMakeLists.txt
modules/rosapps/templates/dialog/CMakeLists.txt
modules/rostests/apitests/crt/crtdll_crt_apitest.cmake
modules/rostests/apitests/crt/msvcrt_crt_apitest.cmake
modules/rostests/apitests/crt/ntdll_crt_apitest.cmake
modules/rostests/kmtests/CMakeLists.txt
modules/rostests/kmtests/example/CMakeLists.txt
modules/rostests/kmtests/fltmgr/fltmgr_create/CMakeLists.txt
modules/rostests/kmtests/fltmgr/fltmgr_load/CMakeLists.txt
modules/rostests/kmtests/fltmgr/fltmgr_register/CMakeLists.txt
modules/rostests/kmtests/hidparse/CMakeLists.txt
modules/rostests/kmtests/kernel32/CMakeLists.txt
modules/rostests/kmtests/ntos_cc/CMakeLists.txt
modules/rostests/kmtests/ntos_io/CMakeLists.txt
modules/rostests/kmtests/ntos_mm/CMakeLists.txt
modules/rostests/kmtests/ntos_po/CMakeLists.txt
modules/rostests/kmtests/tcpip/CMakeLists.txt
modules/rostests/tests/pseh2/CMakeLists.txt
modules/rostests/winetests/advapi32/CMakeLists.txt
modules/rostests/winetests/comctl32/CMakeLists.txt
modules/rostests/winetests/kernel32/CMakeLists.txt
modules/rostests/winetests/msvcrt/CMakeLists.txt
modules/rostests/winetests/ntdll/CMakeLists.txt
modules/rostests/winetests/rpcrt4/CMakeLists.txt
modules/rostests/winetests/winmm/CMakeLists.txt
modules/rostests/winetests/ws2_32/CMakeLists.txt
ntoskrnl/ntkrnlmp/CMakeLists.txt
sdk/cmake/CMakeMacros.cmake
sdk/cmake/compilerflags.cmake
sdk/cmake/gcc.cmake
sdk/lib/3rdparty/adns/CMakeLists.txt
sdk/lib/3rdparty/cardlib/CMakeLists.txt
sdk/lib/3rdparty/freetype/CMakeLists.txt
sdk/lib/3rdparty/libxml2/CMakeLists.txt
sdk/lib/3rdparty/stlport/CMakeLists.txt
sdk/lib/3rdparty/zlib/CMakeLists.txt
sdk/lib/cmlib/CMakeLists.txt
sdk/lib/crt/CMakeLists.txt
sdk/lib/crt/crt.cmake
sdk/lib/crt/libcntpr.cmake
sdk/lib/crt/msvcrtex.cmake
sdk/lib/inflib/CMakeLists.txt
sdk/lib/lsalib/CMakeLists.txt
sdk/tools/hhpcomp/CMakeLists.txt
sdk/tools/hpp/CMakeLists.txt
sdk/tools/mkhive/CMakeLists.txt
sdk/tools/mkisofs/CMakeLists.txt
sdk/tools/unicode/CMakeLists.txt
sdk/tools/widl/CMakeLists.txt
sdk/tools/xml2sdb/CMakeLists.txt
win32ss/printing/base/spoolsv/CMakeLists.txt
win32ss/user/winsrv/consrv.cmake

index f045152..d92ff83 100644 (file)
@@ -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)
index 2ed8b49..a0dd144 100644 (file)
@@ -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)
index f62b8ec..0ac4617 100644 (file)
@@ -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)
index 8989171..1c6c85d 100644 (file)
@@ -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)
index 254dfa0..41d4ab6 100644 (file)
@@ -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
index 1c8255a..c8c388b 100644 (file)
@@ -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()
index 128fccc..207ccb8 100644 (file)
@@ -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)
index 1ff2571..8105fdd 100644 (file)
@@ -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()
index dcc0a7c..a67e183 100644 (file)
@@ -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()
index 4e65858..27b82d2 100644 (file)
@@ -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)
index 1a12f9e..69aaa9f 100644 (file)
@@ -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)
index cd501d5..4ac3ca2 100644 (file)
@@ -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()
 
index efbd71e..a65540c 100644 (file)
@@ -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)
index 791cf2d..b0caa74 100644 (file)
@@ -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)
index d3787d2..5626932 100644 (file)
@@ -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")
index 64cc9b5..12b5a84 100644 (file)
@@ -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)
index 1e3acdd..0d7fd02 100644 (file)
@@ -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)
index 7b4320a..6c65cd3 100644 (file)
@@ -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)
index 62b3f54..8f1dd4c 100644 (file)
@@ -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()
index e4b06aa..569b91f 100644 (file)
@@ -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()
index 8d697b4..fd746a2 100644 (file)
@@ -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)
index 3ac3f89..20c8d7b 100644 (file)
@@ -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)
index 13c6960..b362a60 100644 (file)
@@ -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()
 
index 3f0b56d..b2e5135 100644 (file)
@@ -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()
 
index 455d301..9845ef7 100644 (file)
@@ -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()
 
index 51d1cdd..cd939d4 100644 (file)
@@ -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})
index 66ce8d5..8c13bf7 100644 (file)
@@ -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)
index 92f86b2..3a07ff2 100644 (file)
@@ -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)
index 3417176..0d4e472 100644 (file)
@@ -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()
 
index 82136b8..252f673 100644 (file)
@@ -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)
index 72e729f..1631748 100644 (file)
@@ -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()
 
index b438197..60742e4 100644 (file)
@@ -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})
index f992fa4..29202ba 100644 (file)
@@ -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)
index 2d772d1..eb80a8e 100644 (file)
@@ -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)
index c3604e7..4d16aaa 100644 (file)
@@ -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)
index 14c5346..0e0bd3b 100644 (file)
@@ -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)
index 1d66dc1..7526d90 100644 (file)
@@ -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
index 58e794c..41ad22b 100644 (file)
@@ -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)
index b737ad2..7b5aba3 100644 (file)
@@ -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)
index b2805cb..ca2eade 100644 (file)
@@ -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)
index 92d9621..748d0f0 100644 (file)
@@ -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)
index 8b52282..863ffd2 100644 (file)
@@ -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()
index 6102bb4..16aed4a 100644 (file)
@@ -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)
index 6aa52ef..8361b7b 100644 (file)
@@ -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)
index 49c965d..619fcdf 100644 (file)
@@ -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)
index 7042887..b9ffc61 100644 (file)
@@ -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)
index 087bb31..4c03a27 100644 (file)
@@ -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)
index a1a9b51..824fccb 100644 (file)
@@ -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)
index cc700c5..8d244b2 100644 (file)
@@ -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)
index 1f41dd9..2095a38 100644 (file)
@@ -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)
index 5faa8bf..3c1c4a5 100644 (file)
@@ -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)
index 9106464..9ecd64b 100644 (file)
@@ -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)
index 6dd07ed..529074e 100644 (file)
@@ -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)
index b31a1e5..600e010 100644 (file)
@@ -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)
index f1c142e..cdcbe72 100644 (file)
@@ -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)
index 6610bba..9072c8c 100644 (file)
@@ -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)
index 26258ad..bc5510a 100644 (file)
@@ -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)
index be094fa..94691d5 100644 (file)
@@ -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)
index e737a97..fe5ee66 100644 (file)
@@ -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()
index 5d9cb9c..5df0f3b 100644 (file)
@@ -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)
index 9212bc0..42d37d7 100644 (file)
@@ -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)
index f591e0c..1194e45 100644 (file)
@@ -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)
index f63fa63..9086673 100644 (file)
@@ -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)
index c0e90fe..2262afe 100644 (file)
@@ -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)
index e92f9bb..f764a4b 100644 (file)
@@ -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()
 
index 58cc1eb..c30a6b2 100644 (file)
@@ -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)
index 8e0946d..2229f57 100644 (file)
@@ -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)
index 2853f45..0c6e0a8 100644 (file)
@@ -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)
index 99a12b2..a3be90b 100644 (file)
@@ -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
index 669a4ff..b89023e 100644 (file)
@@ -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'.
index c6bfb95..5f0ea13 100644 (file)
@@ -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_COMPILER> ${CMAKE_C_FLAGS} <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>"
         "${RSYM} -s ${REACTOS_SOURCE_DIR} <TARGET> <TARGET>")
@@ -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 <OBJECTS> --kill-at --output-lib=<TARGET>")
 set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def <OBJECTS> --kill-at --output-delaylib=<TARGET>")
 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)
index ff18daf..d46b9e4 100644 (file)
@@ -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)
index 224d8d3..ae24230 100644 (file)
@@ -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)
index f7e3313..f14ed5c 100644 (file)
@@ -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()
index cbf577f..855d45f 100644 (file)
@@ -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)
index 17c902f..865475f 100644 (file)
@@ -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)
index c68a46e..a10936e 100644 (file)
@@ -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()
index c94674f..d69202b 100644 (file)
@@ -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)
index 6659b0b..03a366c 100644 (file)
@@ -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)
 
 
index 91f1860..b200145 100644 (file)
@@ -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_
index aa3b1d4..1a49be5 100644 (file)
@@ -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_
index 3da70e6..3d68ce5 100644 (file)
@@ -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)
index 1688d69..df44bf1 100644 (file)
@@ -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)
index acf1c28..ca3316c 100644 (file)
@@ -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)
index fa8a7c6..50fd03c 100644 (file)
@@ -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()
index 3ca527e..72ff8b0 100644 (file)
@@ -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()
index 7f1845d..eb840ba 100644 (file)
@@ -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)
index 82704df..0caa8c8 100644 (file)
@@ -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()
index 85c668d..424fcd7 100644 (file)
@@ -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()
index 51e7356..22fa084 100644 (file)
@@ -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()
index 8c302ce..739e48a 100644 (file)
@@ -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()
index da7f7b8..d2e8ed1 100644 (file)
@@ -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)
index 9f421ca..48fb96d 100644 (file)
@@ -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()