Skip to content

Commit 16e5ce8

Browse files
committed
[CMAKE] Use C_STANDARD property instead of command line option
Addendum to 64211aa and 19779b3
1 parent 0db79d4 commit 16e5ce8

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

drivers/filesystems/cdfs/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ add_library(cdfs MODULE ${SOURCE} cdfs.rc)
3636
set_module_type(cdfs kernelmodedriver)
3737
target_link_libraries(cdfs ${PSEH_LIB} memcmp)
3838
add_importlibs(cdfs ntoskrnl hal)
39+
set_property(TARGET cdfs PROPERTY C_STANDARD 90)
3940
add_cd_file(TARGET cdfs DESTINATION reactos/system32/drivers NO_CAB FOR all)
4041
add_registry_inf(cdfs_reg.inf)
41-
42-
if (CLANG AND GCC)
43-
# Make __inline work as expected
44-
target_compile_options(cdfs PRIVATE -std=gnu89)
45-
endif()
46-

drivers/filesystems/ext2/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,15 @@ if(CLANG)
113113
-Wno-unused-value -Wno-parentheses-equality
114114
-Wno-incompatible-pointer-types-discards-qualifiers
115115
"-Wno-#pragma-messages;-Wno-cast-calling-convention")
116-
if (GCC)
117-
target_compile_options(ext2fs PRIVATE -std=gnu89)
118-
endif()
119116
endif()
120117

121118
target_link_libraries(ext2fs memcmp ${PSEH_LIB})
122119
add_definitions(-D__KERNEL__ -D_CRT_NO_POSIX_ERROR_CODES)
123120
set_module_type(ext2fs kernelmodedriver)
124121
add_importlibs(ext2fs ntoskrnl hal)
125122

123+
set_property(TARGET ext2fs PROPERTY C_STANDARD 90)
124+
126125
if(NOT USE_CLANG_CL)
127126
# The fallback we have above prevents cl and clang-cl from using the same PCH
128127
add_pch(ext2fs inc/ext2fs.h SOURCE)

drivers/filesystems/nfs/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ if(GCC OR CLANG)
1818
target_compile_options(nfs41_driver PRIVATE "-Wno-switch")
1919
if(CLANG)
2020
target_compile_options(nfs41_driver PRIVATE "-Wno-unused-value")
21-
if(GCC)
22-
# When CLang mimicks GCC, it uses C17 as default, which breaks __inline
23-
target_compile_options(nfs41_driver PRIVATE "-std=gnu89")
24-
endif()
2521
endif()
2622
endif()
23+
set_property(TARGET nfs41_driver PROPERTY C_STANDARD 90)
2724

2825
add_cd_file(TARGET nfs41_driver DESTINATION reactos/system32/drivers FOR all)

sdk/cmake/gcc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
5353
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>")
5454
endif()
5555
else()
56-
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-std=gnu99;-Wno-microsoft>")
56+
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>")
5757
add_compile_options(-Wno-pragma-pack)
5858
add_compile_options(-fno-associative-math)
5959
add_compile_options(-fcommon)

0 commit comments

Comments
 (0)