Open NukeBird opened 6 years ago
I recall having multiple long sessions fine-tuning the compilation and linker flags on MSVC. Back then, we majorly tested MSVC 2013 and 2015, probably we have to reconsider the flags for 2017. Thanks for reporting.
Update: What I wrote holds for glbinding (I misread the project name). For globjects there may be an actual mismatch of compiler options. We'll investigate.
Thank you for reply, hope this behavior of MSVC will be fixed soon ^^
As for the /GL
option, see here: https://docs.microsoft.com/en-us/cpp/build/reference/gl-whole-program-optimization. It enables compiler optimizations across compilation units and implies /LTCG
, which is not currently supplied, hence the warning.
IMHO, this is a cmake-init issue, that probably stems from the fact that adding a linker flag is a bit cumbersome in cmake, as there is no target_link_options
. To fix this, append the following to CompileOptions.cmake
:
# MSVC linker options
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
set(DEFAULT_LINKER_OPTIONS ${DEFAULT_LINKER_OPTIONS}
"$<$<CONFIG:Release>:-LTCG>"
)
endif()
This might reduce compile time (as per warning message), but won't affect output file size.
Thanks for investigating.
When I'm trying to compile a project in Visual Studio 2017 I getting an warning "founded .netmodule MSIL or module, compiled with parameter /GL, restarting a linkage with parameter /LTCG"
Compilation time and output file size are big...