https://git.reactos.org/?p=reactos.git;a=commitdiff;h=16e5ce8fb1a2522c796cb…
commit 16e5ce8fb1a2522c796cb05b4039274dd5649543
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Sat Dec 5 13:14:28 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Sat Dec 5 15:35:06 2020 +0300
[CMAKE] Use C_STANDARD property instead of command line option
Addendum to 64211aa6964a8ca1627f2ce7244b8270003e6770 and
19779b3f96dd2905a09c827a871f32a9bfb431c6
---
drivers/filesystems/cdfs/CMakeLists.txt | 7 +------
drivers/filesystems/ext2/CMakeLists.txt | 5 ++---
drivers/filesystems/nfs/CMakeLists.txt | 5 +----
sdk/cmake/gcc.cmake | 2 +-
4 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/drivers/filesystems/cdfs/CMakeLists.txt
b/drivers/filesystems/cdfs/CMakeLists.txt
index 3e35991bfa0..552224c2058 100644
--- a/drivers/filesystems/cdfs/CMakeLists.txt
+++ b/drivers/filesystems/cdfs/CMakeLists.txt
@@ -36,11 +36,6 @@ add_library(cdfs MODULE ${SOURCE} cdfs.rc)
set_module_type(cdfs kernelmodedriver)
target_link_libraries(cdfs ${PSEH_LIB} memcmp)
add_importlibs(cdfs ntoskrnl hal)
+set_property(TARGET cdfs PROPERTY C_STANDARD 90)
add_cd_file(TARGET cdfs DESTINATION reactos/system32/drivers NO_CAB FOR all)
add_registry_inf(cdfs_reg.inf)
-
-if (CLANG AND GCC)
- # Make __inline work as expected
- target_compile_options(cdfs PRIVATE -std=gnu89)
-endif()
-
diff --git a/drivers/filesystems/ext2/CMakeLists.txt
b/drivers/filesystems/ext2/CMakeLists.txt
index dbd8cc84925..dadf04c06b7 100644
--- a/drivers/filesystems/ext2/CMakeLists.txt
+++ b/drivers/filesystems/ext2/CMakeLists.txt
@@ -113,9 +113,6 @@ if(CLANG)
-Wno-unused-value -Wno-parentheses-equality
-Wno-incompatible-pointer-types-discards-qualifiers
"-Wno-#pragma-messages;-Wno-cast-calling-convention")
- if (GCC)
- target_compile_options(ext2fs PRIVATE -std=gnu89)
- endif()
endif()
target_link_libraries(ext2fs memcmp ${PSEH_LIB})
@@ -123,6 +120,8 @@ add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES)
set_module_type(ext2fs kernelmodedriver)
add_importlibs(ext2fs ntoskrnl hal)
+set_property(TARGET ext2fs PROPERTY C_STANDARD 90)
+
if(NOT USE_CLANG_CL)
# The fallback we have above prevents cl and clang-cl from using the same PCH
add_pch(ext2fs inc/ext2fs.h SOURCE)
diff --git a/drivers/filesystems/nfs/CMakeLists.txt
b/drivers/filesystems/nfs/CMakeLists.txt
index 3d05ff676c6..91ad25761d0 100644
--- a/drivers/filesystems/nfs/CMakeLists.txt
+++ b/drivers/filesystems/nfs/CMakeLists.txt
@@ -18,11 +18,8 @@ if(GCC OR CLANG)
target_compile_options(nfs41_driver PRIVATE "-Wno-switch")
if(CLANG)
target_compile_options(nfs41_driver PRIVATE "-Wno-unused-value")
- if(GCC)
- # When CLang mimicks GCC, it uses C17 as default, which breaks __inline
- target_compile_options(nfs41_driver PRIVATE "-std=gnu89")
- endif()
endif()
endif()
+set_property(TARGET nfs41_driver PROPERTY C_STANDARD 90)
add_cd_file(TARGET nfs41_driver DESTINATION reactos/system32/drivers FOR all)
diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake
index acde67d9203..938bc0e2454 100644
--- a/sdk/cmake/gcc.cmake
+++ b/sdk/cmake/gcc.cmake
@@ -53,7 +53,7 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>")
endif()
else()
-
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-std=gnu99;-Wno-microsoft>")
+ add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>")
add_compile_options(-Wno-pragma-pack)
add_compile_options(-fno-associative-math)
add_compile_options(-fcommon)