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

won't generate *.dylib on macOS with Xcode #267

Closed
dingzeyuli opened this issue Oct 4, 2017 · 5 comments
Closed

won't generate *.dylib on macOS with Xcode #267

dingzeyuli opened this issue Oct 4, 2017 · 5 comments

Comments

@dingzeyuli
Copy link

dingzeyuli commented Oct 4, 2017

I tried to compile nanogui library on my mac. I use cmake to generate an Xcode project. The libglfw_objects and nanogui-obj can be generated. But the final nanogui does not show up.

After some digging, I think this might be the reason.

Some native build systems may not like targets that have only object files, so consider adding at least one real source file to any target that references $<TARGET_OBJECTS:objlib>.

Sources: [1] [2]

My workaround is to add a blank.c file in the nanogui src and modify the CMakeLists.txt:

add_library(nanogui
${NANOGUI_LIBRARY_TYPE}
blank.c
$<TARGET_OBJECTS:nanogui-obj>
$<TARGET_OBJECTS:glfw_objects>
)

The blank.c file is empty, just there to activate the Xcode building system. With this modification, nanogui now compiles with Xcode.

@svenevs
Copy link
Collaborator

svenevs commented Oct 4, 2017

Thanks for the detailed report @dingzeyuli, is this the same as #220? That one kind of disappeared into the fold, but I believe it achieves the same fix.

@dingzeyuli
Copy link
Author

Yeah, thanks @svenevs. That pull request has not yet been accepted. So the current nanogui code still fails with Xcode+cmake. That one seems to pass the integration test. Is there any plan to accept it? Thank you.

@wjakob
Copy link
Owner

wjakob commented Oct 4, 2017

That PR failed the CI tests, so I never seriously looked at it. I'll write some comments on #220.

@liminchen
Copy link

Hi Liding, Is the problem you encountered the one below?
I tried your fix but it still doesn't work...
screenshot 2018-01-25 10 53 31

@svenevs
Copy link
Collaborator

svenevs commented May 19, 2019

Fixed in #304.

@svenevs svenevs closed this as completed May 19, 2019
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

4 participants