Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect native source files. #685

Merged
merged 1 commit into from
Jun 20, 2017
Merged

Conversation

TurkeyMan
Copy link
Contributor

Separated the concept of 'native' languages from language detection.
There is code that assumes native code == c/c++ code.
I also feel it's weird to conflate asm and obj-c... I can imagine myself writing code to detect those languages with the intent to do something language-specific that's probably not applicable to asm or whatever.

@TurkeyMan
Copy link
Contributor Author

My gmake fixes depend on this...

end

function path.iscppfile(fname)
return path.hasextension(fname, { ".cc", ".cpp", ".cxx", ".c", ".s", ".m", ".mm" })
return path.hasextension(fname, { ".cc", ".cpp", ".cxx" })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're changing this, can you throw .c++ in as per #612?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i gueeeeess... although that's a really weird file extension :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't disagree, it's completely valid (I tested it on Windows lol) and it seems to be used by things. I think @starkos has a better idea though.

@starkos
Copy link
Member

starkos commented Jan 31, 2017

A good idea. A couple of thoughts, if you don't mind considering them while you're in the code:

  • If we move the file extension lists out of the functions themselves, people and modules would be able to add/remove new entries to suit.

  • Perhaps this would be better as a toolset function i.e. isbuildablefile()? Clang can build Objective C, for instance, but MSC cannot.

-- better suggestions.
--

function path.isnativefile(fname)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with @starkos on this one... this should move to toolset, and rename to "isbuildablefile".

@tvandijck
Copy link
Contributor

I'm going to merge this, it's better then what we currently have, even though I still think some of this behavior should move to toolset.

@tvandijck tvandijck merged commit 3e4ebb8 into premake:master Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants