bvschaik / julius

An open source re-implementation of Caesar III
GNU Affero General Public License v3.0
2.85k stars 317 forks source link

Add LTCG support for MSVC #673

Closed feiyunw closed 1 year ago

feiyunw commented 1 year ago

libpng16.lib for x64 platform (Copy settings from Win32 in MSVC Configuration Manager) will use /GL option for LTCG by default. It causes some LTCG message:

2>------ Rebuild All started: Project: julius, Configuration: Release x64 ------
...
2>editor.c
2>libpng16.lib(pngwrite.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance

This PR is to get julius ready for MSVC x64 platform.

Check "cmake.exe --help-policy CMP0069" output too.

FYI: CheckIPOSupported IPO: INTERPROCEDURAL_OPTIMIZATION (LTCG) for VS

feiyunw commented 1 year ago

It does not require LTCG when using Release|x64 version of libpng (DLL). Using static library version of libpng may need this.