Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Unrecognized options while linking cmake projects #42

Open
isanae opened this issue May 16, 2019 · 0 comments
Open

Unrecognized options while linking cmake projects #42

isanae opened this issue May 16, 2019 · 0 comments

Comments

@isanae
Copy link
Contributor

isanae commented May 16, 2019

In unibuild/utility/config_utility.py, linker flags are set for optimized builds on line 60:

if config.get('optimize', False):
    cmake_parameters.append("-DOPTIMIZE_LINK_FLAGS=\"/LTCG /INCREMENTAL:NO /OPT:REF /OPT:ICF\"")

This is eventually passed to Popen in unibuild/modules/cmake.py. The documentation is somewhat unclear, but arguments should never be quoted because python also adds double quotes as soon as it sees spaces in the argument. This results in setting this variable in the various CMakeCache.txt files:

OPTIMIZE_LINK_FLAGS:UNINITIALIZED="/LTCG /INCREMENTAL:NO /OPT:REF /OPT:ICF"

This is passed verbatim when compiling, which results in this:

LINK : warning LNK4044: unrecognized option '/LTCG /INCREMENTAL:NO /OPT:REF /OPT:ICF';
ignored [build\modorganizer_super\installer_bain\vsbuild\src\installer_bain.vcxproj]

The code should be:

if config.get('optimize', False):
    cmake_parameters.append("-DOPTIMIZE_LINK_FLAGS=/LTCG /INCREMENTAL:NO /OPT:REF /OPT:ICF")

instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant