Skip to content

macOS testapp#39

Merged
CedricGuillemet merged 9 commits into
BabylonJS:masterfrom
CedricGuillemet:AppleStub
Sep 16, 2019
Merged

macOS testapp#39
CedricGuillemet merged 9 commits into
BabylonJS:masterfrom
CedricGuillemet:AppleStub

Conversation

@CedricGuillemet

@CedricGuillemet CedricGuillemet commented Aug 29, 2019

Copy link
Copy Markdown
Collaborator

macOS testapp stub for scriptcore/metal
It compiles, links and runs.

cmake .. -GXcode
then open project with xcode

@CedricGuillemet

Copy link
Copy Markdown
Collaborator Author

Apple changed std::filesystem. it's not available any more in experimental. cool.

@CedricGuillemet CedricGuillemet changed the title macOS/iOS testapp macOS testapp Sep 4, 2019
@CedricGuillemet CedricGuillemet marked this pull request as ready for review September 4, 2019 16:51
Comment thread Library/CMakeLists.txt
Comment thread Library/Dependencies/napi/source/env_JavaScriptCore.cc Outdated
Comment thread Library/Include/Babylon/RuntimeApple.h
Comment thread Library/Source/Common.h Outdated
Comment thread Library/Source/CommonApple.cpp
Comment thread Library/Source/Common.h

#include <arcana/threading/dispatcher.h>
#ifndef __APPLE__
#include <filesystem>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like Xcode 11 supports it: https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes

Clang now supports the C++17 library for iOS 13, macOS 10.15, watchOS 6, and tvOS 13. (50988273)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

So, switching to xcode11 as min req?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't have a lot of experience here. What do you think?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I'm still in "finding unknowns" mode. Switching to xcode11 just because of std::filesystem is a bit rough. I'd rather spend some time finding the cocoa equivalent with the appropriate abstraction/if def later.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Still not very happy with the typedef but I removed the #ifdef APPLE in runtime.cpp. So I think it's fine for a 1st iteration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, please file an issue after merging.

Comment thread Library/Source/RuntimeImpl.cpp Outdated
});
};

#ifdef __APPLE__

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should not be spewing __APPLE__ everywhere. The whole point of separating the cpp files is to avoid this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I agree. It's related to std::filesystem. Will remove that once I've found a nice way to replace it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we do this before merging? If not, please make an issue after merging or at least put a comment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Before merging sounds like a good idea

Comment thread TestApp/CMakeLists.txt
Comment thread TestApp/Source/macOS/AppDelegate.h Outdated
Comment thread TestApp/Source/macOS/Base.lproj/Main.storyboard
Comment thread Library/Source/Common.h

#include <arcana/threading/dispatcher.h>
#ifndef __APPLE__
#include <filesystem>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, please file an issue after merging.


#include <Babylon/Runtime.h>
#include <napi/napi.h>
#include <napi/env.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's these for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

env is needed in the header

auto& env = runtime.Env();

@bghgary bghgary left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, couple of minor comments.

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