https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e3f204e2282f25d9556d9…
commit e3f204e2282f25d9556d9d83f43f31b6578eaa84
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Nov 11 21:38:59 2023 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sun Nov 19 09:19:33 2023 +0200
[CMAKE] Remove "/Gy" option from ML
Reason: VS solution builds pass the compiler options to the assembler. These are usually ignored and result in a warning only, but ML of the latest VS supports /Gy (function level linking), but that requires all functions to be declared with "PROC" and otherwise results in an error.
---
sdk/cmake/msvc.cmake | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index dd3df55021d..8357316a112 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -22,8 +22,9 @@ endif()
# helper macros. Note also that GCC builds use string pooling by default.
add_compile_options(/GF)
-# Enable function level linking and comdat folding
-add_compile_options(/Gy)
+# Enable function level linking and comdat folding (only C/C++, not ASM!)
+add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Gy>)
+add_compile_options($<$<COMPILE_LANGUAGE:C>:/Gy>)
add_link_options(/OPT:REF /OPT:ICF)
if(ARCH STREQUAL "i386")