Setting `/OPT:NOREF` and `/OPT:NOICF` linker options in VS2019

Open
#1,879 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
build-system

Research direction

Reproduce the issue with the shown premake5 linkoptions and inspect the generated Visual Studio project’s linker settings. Determine where Premake emits the default /OPT:REF and /OPT:ICF values, then verify that the requested /OPT:NOREF and /OPT:NOICF settings take effect without being overridden.

Written by the indexing model from the issue text.

Description

support-request vs20xx

I would like to set the following VS linker options in my premake project. They appear as References and Enable COMDAT Folding in VS2019 and default to /OPT:REF and /OPT:ICF, as shown below:

image

I couldn't find a specific option in the premake documentation for changing these values, so I tried to set them using:

linkoptions { "/OPT:NOREF", "/OPT:NOICF" }

This adds the link options to the project, but the original setting does not get changed (the options in the screenshot above are unchanged). VS seems to pick the first instance of the options, so mine are being ignored

image

It's probably also worth mentioning that I am not enabling link time optimizations in my premake files.

> premake5.exe --version
premake5 (Premake Build Script Generator) 5.0.0-dev
Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from premake/premake-core

All issues in premake/premake-core

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.