premake / premake/premake-core

Implicit Linking for non-Visual Studio Exporters

Open
#2,344 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
3.6k
Forks
654
Avg merge
1d 1h
Merged PRs (30d)
13

Description

What problem will this solve?
Currently, dependencies on projects will resolve in different behaviors between Visual Studio and other exporters. Currently, only VS support implicit transitive linking based on project dependencies. I propose that we expose that behavior across other exporters.

What might be a solution?
From a user perspective, I propose adding an API such as:

implicitlinks "On"
implicitlinks "Off"
implicitlinks "Default"

This would allow the user to specify whether or not to use the implicit linking functionality. By default, I would propose turning this on. Visual Studio already turns this on by default (see the NoImplicitLinks flag).

In the generator, this would equate to performing a walk of the dependencies to get all static libraries and shared libraries to link to based on if they allow for implicit links. If implicit links are allowed on platforms that don't support implicit links directly, we would then emit rules in the generated files that specify the binary files to link against (and the appropriate linker search directories).

What other alternatives have you already considered?
Currently, the manual approach to this is to add all linkages manually to each project, ensuring that the behavior is consistent.

Anything else we should know?
Talking with various users across the community, this is something that would be useful to unify behavior across exporters.

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.

Research direction

Start by comparing the existing Visual Studio implicit-link behavior, including the NoImplicitLinks flag, with dependency handling in the other exporters. Trace how the generator walks dependencies and emits linker inputs, then define how the proposed implicitlinks "On", "Off", and "Default" settings should affect generated files and platform-specific linker search directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.