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

MacOS build #24

Open
Ealrann opened this issue Aug 31, 2020 · 0 comments
Open

MacOS build #24

Ealrann opened this issue Aug 31, 2020 · 0 comments

Comments

@Ealrann
Copy link
Owner

Ealrann commented Aug 31, 2020

Here the steps required to compile under MacOS (thanks a lot to @kvark #23 ) :

1. Clone the repo

git clone --recursive --single-branch --branch root https://github.com/Ealrann/VSand.git
cd VSand/
git checkout 7fa5a9d
git submodule update

Note : The head version appears to be currently broken on MacOS. After some digging, it looks like some bugs inside GLFW. They fixed some stuf recently related to the MacOS support, but the last LWJGL Snapshot is older than these fix. I'll update the macos compilation when LWJGL will be updated.

2. Use the Snapshot version of LWJGL

The last LWJGL Snapshot contains some mandatory fix for GLFW. Edit the file Lily-vulkan/gradle.properties and change the Lwjgl version :

lwjglVersion = 3.2.4-SNAPSHOT

3. Edit the run configuration

Macos requires some UI library to run inside the native thread, so we need to pass a special argument to the JVM. More information here and here.

Edit the file Vsand/VSand/org.sheepy.vsand/build.gradle and add the -XstartOnFirstThread arg :

application {
	mainModule = 'org.sheepy.vsand'
	mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'

        applicationDefaultJvmArgs = ["-XstartOnFirstThread"]
}

4. Run

Go to the directory Vsand/VSand and run :

./gradlew run

5. Extra steps if you don't want to use MoltenVk

You need to specify the path to the library libvulkan.dylib. To do so, an extra jvmarg is required. See this post for more information.

Edit the file Vsand/VSand/org.sheepy.vsand and add the -Dorg.lwjgl.vulkan.libname arg :

application {
	mainModule = 'org.sheepy.vsand'
	mainClass = 'org.sheepy.vsand.VSandApplicationLauncher'

        applicationDefaultJvmArgs = ["-XstartOnFirstThread", "-Dorg.lwjgl.vulkan.libname=<path_to_vulkan_sdk>/macOS/lib/libvulkan.dylib"]
}
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

No branches or pull requests

1 participant