Skip to content

Commit

Permalink
[CMAKE] Remove "/Gy" option from ML
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tkreuzer committed Nov 18, 2023
1 parent a2a063a commit e826cec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sdk/cmake/msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit e826cec

Please sign in to comment.