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

Can't build with CMake nightly for Xcode #344

Closed
meshula opened this issue Oct 3, 2020 · 10 comments
Closed

Can't build with CMake nightly for Xcode #344

meshula opened this issue Oct 3, 2020 · 10 comments

Comments

@meshula
Copy link

meshula commented Oct 3, 2020

CMake nightly removes support for the old Xcode build system, and the CMake script for libpng now fails as shown below.

A hacky workaround is to comment out the line that searches for awk.

#find_program(AWK NAMES gawk awk)
CMake Error in CMakeLists.txt:
  The custom command generating

    /Users/nporcino/dev/usd-dev-install/build/libpng-1.6.37/pnglibconf.out

  is attached to multiple targets:

    genfiles
    gensym
    genvers

  but none of these is a common dependency of the other(s).  This is not
  allowed by the Xcode "new build system".


CMake Generate step failed.  Build files cannot be regenerated correctly.
@vespakoen
Copy link

Adding some search keywords: macOS, Apple

This is indeed a problem right now, I worked around this by using

cmake_policy(SET CMP0048 OLD)

Or by not using XCode generator.

One of the too, or both, I don't remember.

mooch443 pushed a commit to mooch443/trex that referenced this issue Feb 17, 2021
* libpng does not support the new macOS build system yet (see pnggroup/libpng#344 (comment))
@AndyMender
Copy link

I ran into the same issue recently when updating to libpng 1.6.36. Unfortunately, setting cmake_policy(SET CMP0048 OLD) alone doesn't help and it looks like the only viable solution is to use Ninja or Makefile as the cmake generator.

@meshula
Copy link
Author

meshula commented Jul 2, 2021

My opinion is that if eliding a search for awk allows successful Xcode project generation, then the cmake script can be changed to not search for awk when generating Xcode files. I would have submitted a PR, but I did not have time to search for the reason awk is a requirement in the first place, and whether it is somehow in some circumstances required for Xcode project file generation. I would consider fixing the Cmake script a viable solution, if indeed not searching for awk is a fix.

@AJenbo
Copy link

AJenbo commented Dec 3, 2021

I wonder if this is the same issue as we also encountered with Android builds recently: 5cfc165 / #391

@glebm
Copy link
Contributor

glebm commented Dec 4, 2021

The "multiple targets" warning is correct, the targets that depend on the custom command must also depend on the custom target.

From CMake documentation:

Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use add_custom_target to drive the command and make the other targets depend on that one).

This is a bug relevant to all generators, even though the new XCode is currently the only one that turns it into an error.

I've sent a fix for this in #403.

@ctruta
Copy link
Member

ctruta commented Sep 10, 2022

Fixed. Many thanks to @glebm for contributing #403.

@ctruta ctruta closed this as completed Sep 10, 2022
@meshula
Copy link
Author

meshula commented Sep 10, 2022

Thanks so much!

Any possibility of tagging a point release? Our build automation prefers to fetch against point release tags.

@ctruta
Copy link
Member

ctruta commented Sep 11, 2022

I have a few more contributions to integrate, and I'd like to give it an extra week for extra testing. If all goes well, I should be able to publish a point release by next weekend.

@ctruta
Copy link
Member

ctruta commented Sep 16, 2022

@meshula it's done. Enjoy our latest and greatest libpng-1.6.38.

@meshula
Copy link
Author

meshula commented Sep 16, 2022

Sweet!!

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 a pull request may close this issue.

6 participants