Setting `/OPT:NOREF` and `/OPT:NOICF` linker options in VS2019
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
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:

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

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from premake/premake-core
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
premake/premake-core#2753 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
premake/premake-core#2741 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
premake/premake-core#2798 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 70/100
premake/premake-core#2788 · 3 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 55/100
premake/premake-core#2786 · 10 comments ·
All issues in premake/premake-core
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100