CMake fails on macOS #1750
Replies: 7 comments
|
The languages should be specified in the project command. If an empty new project is created for macOS and cmake fails with that error, then yes, this should be added to the template |
|
Yes, building a newly generated empty project by Axmol fails. Building Axmol itself also fails. I think I've found what triggers the issue. If I comment out lines like these: I've checked how a project using Cocos works, that doesn't specify languages in the project's CMake files. In this case Objective-C/C++ files are passed to C/C++ compiler without indicating a different language. Compiler probably detects the language by file extension in this case. So in this case CMake enables only C and C++ compiler and doesn't know that it actually compiles Objective-C/C++ files, but since compiler detects the language automatically it happens to work. Btw, the language can't be easily specified using or The first one looks a bit cleaner. I'll make a PR later. |
I'm not sure what you mean, because I know for a fact that this works: I wasn't actually implying that all languages be added to |
Ah, ok, then I misunderstood you. :) So now we have 3 ways to fix this, which one should I do? |
It's so strange though, because I just did a test with the following:
No cmake errors at all. Then the project is opened in Xcode 15.0.1 (Mac M1 Mini with MacOS Ventura 13.6.1), and built successfully. Nothing was changed in the Regarding which method to use, either of the following would be the preference, since they're both straightforward: or |
|
I guess you use cmake generate command directly, and not specify the axmol build command will auto set |
|
Yes, you're partially right, I'm using VSCode/ninja setup for development. Just tried it and |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have a weird issue where running CMake for building my project, or Axmol, or Axmol's generated project, targeting macOS fails with this error:
I have to add
enable_language(OBJCXX)to fix the issue like this:I can't figure out if this is a real issue and
enable_language(OBJCXX)should be added to Axmol's and project templates CMakeLists.txt files, or there's something wrong with my setup. Does anyone building for macOS had the same issue?P.S. I'm using brew's CMake version 3.28.1
All reactions