premake / premake/premake-core

"filter:" + absolute path dosn't work.

Open
#997 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi.

I wrote premake.lua like this.

filter {"files:C:/path/to/library/**.cpp"}
      flags { "NoPCH" }

"C:/path/to/library/" is acquired via environment variable, so it can't be relative path.
But this couses error.

Invalid field prefix 'c'

How to fix it?
Thanks

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 with the filter expression shown in premake.lua and reproduce the failure using the absolute path from the environment variable. Trace how the filter parses the path and its field prefix, then verify that the NoPCH flag applies to the intended .cpp files without the “Invalid field prefix” error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.