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

Add os.ios option in xcode4 #1180

Merged
merged 3 commits into from
Oct 18, 2018
Merged

Conversation

tempura-sukiyaki
Copy link
Contributor

No description provided.

-- Register the ios extension
--

local osoption = p.option.get("os")
Copy link
Member

Choose a reason for hiding this comment

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

This should be part of the os option by default, I've used gmake, gmake2 and xcode4 for iOS builds. Same thing goes for the os.systemTags.

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 see. I will do so.


-- add system tags for ios.
if not os.systemTags[p.IOS] then
os.systemTags[p.IOS] = { "ios", "mobile" }
Copy link
Member

Choose a reason for hiding this comment

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

For both this and the p.MACOSX entry, it might be worth adding an "apple" entry? This would allow all of the checks you changed below to be apple instead and they'd work for tvOS and watchOS - and whatever comes next. Thoughts?

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 see. I think that it looks very good.

Copy link
Contributor Author

@tempura-sukiyaki tempura-sukiyaki Oct 18, 2018

Choose a reason for hiding this comment

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

I feel it is better to define darwin instead of apple.
macosx already has that value.

	os.systemTags =
	{
		["aix"]      = { "aix",     "posix" },
		["bsd"]      = { "bsd",     "posix" },
		["haiku"]    = { "haiku",   "posix" },
		["ios"]      = { "ios",     "darwin", "mobile" },
		["linux"]    = { "linux",   "posix" },
		["macosx"]   = { "macosx",  "darwin", "posix" },
		["solaris"]  = { "solaris", "posix" },
		["windows"]  = { "windows", "win32" },
	}

It may be better to include posix.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, perhaps both darwin and posix?

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

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

I think this is getting closer to being flexible for other Darwin-based systems being added! Thanks for this!

src/base/os.lua Outdated
@@ -69,7 +69,7 @@
elseif os.istarget("haiku") then
path = os.getenv("LIBRARY_PATH") or ""
else
if os.istarget("macosx") then
if os.istarget("macosx") or os.istarget("ios") then
Copy link
Member

Choose a reason for hiding this comment

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

This could be os.istarget("darwin") instead. Same goes for other checks like this that you've modified in other files.

@@ -48,7 +48,7 @@
local bundlename = ""
local bundlepath = ""

if cfg.system == p.MACOSX and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
if (cfg.system == p.MACOSX or cfg.system == p.IOS) and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
Copy link
Member

Choose a reason for hiding this comment

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

This could probably use table.contains(os.getSystemTags(cfg.system), "darwin") instead of checking for each OS? Same goes for other checks like this that you've modified in other files.

@samsinsane
Copy link
Member

This is really cool! Thanks for this!

@samsinsane samsinsane merged commit 5354556 into premake:master Oct 18, 2018
@tempura-sukiyaki tempura-sukiyaki deleted the xcode4-os-ios branch October 18, 2018 13:48
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.

2 participants