premake / premake-xcode

BSD 3-Clause "New" or "Revised" License
9 stars 15 forks source link

error while using tokens in *buildcommands #31

Open noresources opened 8 years ago

noresources commented 8 years ago

Example

project ("MyProject")
    postbuildcommands { "{COPY} 'sourcefile'' '%{cfg.targetdir}'" }

Output an error saying that cfg is not declared

However

project ("MyProject")
    configuration "Anything"
        postbuildcommands { "{COPY} 'sourcefile'' '%{cfg.targetdir}'" }

works, because there is a special case for per-configuration commands in xcode.PBXShellScriptBuildPhase(tr)

IMO, *buildcommands should always be treated as per-configuration items since they can contains per-configuration tokens. I do not have enough knowledge on how configs are constructed to submit a pull request for this.

starkos commented 8 years ago

If true, this is actually a bug in the Xcode exporter…it should be pulling from a specific configuration and not the project object.

fzwoch commented 8 years ago

I can confirm the issue. Setting the configuration works around it.