premake / premake/premake-core

Supporting search paths for headers and libraries

Open
#2,589 2 comments 0 reactions 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

gcc and clang honor C_INLCUDE_PATH CPLUS_INCLUDE_PATH (OBJC_INCLUDE_PATH and OBJCPLUS_INCLUDE_PATH) environment variables to search for c,cxx, (objc, objcxx) headers.

Similarly LIBRARY_PATH can be used to specify a search path for libraries.

EDIT: For msvc appearently there are INLCUDE and LIB environment variables doing the same thing.

What problem will this solve?

A header that is in C_INCLUDE_PATH or a library in LIBRARY_PATH can be found by the compiler/linker.

os.findheader and os.findlib will currently fail to find them.

What might be a solution?

Extend os.findheader and os.findlib to recognise these values.

What other alternatives have you already considered?

Rather than searching through a list of search paths manually let the compiler/linker do it with small test programs.

Anything else we should know?
Add any other context or screenshots about the feature request here.

(You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!)

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 at the os.findheader and os.findlib entry points. Review how they currently search paths, then compare handling of C_INCLUDE_PATH, CPLUS_INCLUDE_PATH, OBJC_INCLUDE_PATH, OBJCPLUS_INCLUDE_PATH, LIBRARY_PATH, and MSVC's INCLUDE/LIB variables. Done means headers and libraries in those paths are found for the relevant compiler environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.