From e3f204e2282f25d9556d9d83f43f31b6578eaa84 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 11 Nov 2023 21:38:59 +0200 Subject: [PATCH] [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($<$:/Gy>) +add_compile_options($<$:/Gy>) add_link_options(/OPT:REF /OPT:ICF) if(ARCH STREQUAL "i386")