Skip to content

Commit 25e0120

Browse files
committed
get rid of MSVC Release linker fallback with /LTCG due to /GL - manually specify the flag
1 parent eda05ee commit 25e0120

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cmake/adjust/template/vendor/impl/MSVC.cmake

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ endif()
99
if(NBL_REQUEST_SSE_4_2)
1010
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS
1111
/arch:SSE4.2 # https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170
12-
) # TODO: (****) optional but then adjust 3rdparty options on fail
12+
) # TODO: (****) should be (?) optional but then adjust 3rdparty options on fail
1313
endif()
1414

1515
if(NBL_REQUEST_SSE_AVX2)
1616
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS
1717
/arch:AVX2 # https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170
18-
) # TODO: (****) optional but then adjust 3rdparty options on fail
18+
) # TODO: (****) should be (?) optional but then adjust 3rdparty options on fail
1919
endif()
2020

2121
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} COMPILE_OPTIONS
@@ -57,6 +57,7 @@ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELEASE COMPILE_OPTIONS
5757

5858
LINK_OPTIONS
5959
/INCREMENTAL:NO # https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170
60+
/LTCG # https://learn.microsoft.com/en-us/cpp/build/reference/ltcg-link-time-code-generation?view=msvc-170 (note: /GL implies fallback with LTCG)
6061
)
6162

6263
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELWITHDEBINFO COMPILE_OPTIONS
@@ -69,6 +70,6 @@ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELWITHDEBINFO COMPILE_OP
6970
/sdl- # https://learn.microsoft.com/en-us/cpp/build/reference/sdl-enable-additional-security-checks?view=msvc-170
7071

7172
LINK_OPTIONS
72-
/INCREMENTAL:NO # https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170 (note: cannot use with /LTCG:incremental)
73-
/LTCG:incremental # https://learn.microsoft.com/en-us/cpp/build/reference/ltcg-link-time-code-generation?view=msvc-170
73+
/INCREMENTAL:NO # https://learn.microsoft.com/en-us/cpp/build/reference/incremental-link-incrementally?view=msvc-170 (note: cannot use /INCREMENTAL with /LTCG:incremental, would cause fallback)
74+
/LTCG:incremental # https://learn.microsoft.com/en-us/cpp/build/reference/ltcg-link-time-code-generation?view=msvc-170
7475
)

0 commit comments

Comments
 (0)