premake / premake-core

Premake
https://premake.github.io/
BSD 3-Clause "New" or "Revised" License
3.13k stars 611 forks source link

How can I add files to projects but not compile them? #2166

Closed luizfernandonb closed 7 months ago

luizfernandonb commented 7 months ago

What's your question? I have these files from the screenshot below that I want to add to the project, but I don't want to compile them, what I want to compile is in another folder, is this possible to do? I looked in the documentation and didn't find anything image

What I tried was this, but it didn't change anything image

Jarod42 commented 7 months ago

Which generator do you use? as .w is not a known extension, I expect none of the generator run anything for it.

You might create project for this directory with kind "None".

luizfernandonb commented 7 months ago

Which generator do you use? as .w is not a known extension, I expect none of the generator run anything for it.

You might create project for this directory with kind "None".

VS2022

luizfernandonb commented 7 months ago

@Jarod42 Will I have to create two projects, one to actually compile the files and another to just edit? Isn't there the possibility of being just one?

Jarod42 commented 7 months ago

You filter is simply wrong.

filter {"files:" .. PRJ_GROUP .. "/**.*"}
  buildaction "None"
filter {} -- reset filter

Especially / instead of \\.

Once done correctly, in file property, its "item type" would be "Does not participate to build".

Notice that buildaction might only be supported by vs* actions, whereas project of kind "None" is supported by more generators.

Jarod42 commented 7 months ago

As alternative to buildaction "None", there is flags { "ExcludeFromBuild" } (which is better supported by other generators).

Created #2169 to better support buildaction "None".