Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Native XCode project generator plugin #4810

Open
JX-Master opened this issue Mar 8, 2024 · 1 comment
Open

Native XCode project generator plugin #4810

JX-Master opened this issue Mar 8, 2024 · 1 comment

Comments

@JX-Master
Copy link

Is your feature request related to a problem? Please describe.

The current version of xmake (2.8.8) does not support XCode project generation directly, it generates XCode project files by translating xmake scripts to CMake scripts, then uses CMake genrator to generate XCode project files. In practice, I found at least two problems caused by this translation process:

  1. All custom building functions used in xmake scripts (like before_build, after_build, before_install, after_install, etc) will not be called when performing building actions in XCode, since they are lua functions and cannot be processed by CMake building system.
  2. For some reasons, if we need to change the building options (options added by target:add_options) in xmake, we don't get these option changes applied in XCode projects until we delete all CMake/XCode files and regenerate them from scrach (simply regenerating XCode project files by xmake project -k xcode won't take effect if we don't delete all existing CMake and XCode files).

These problems can be solved by implementing a native XCode project generator, just like we have already done for Visual Studio (vsxmake2019). As the documentation says:

After we have time, we will re-implement each more complete xcode output plugin by ourselves, and welcome everyone to contribute.

I wonder if we currently have any plan on implementing a native XCode project generator, and if not, this issue can be used to track this feature if somebody has time to development such generator later.

Describe the solution you'd like

We want a native XCode project generator that generates XCode project files directly from xmake.lua project scripts. When performing building, installing and cleaning actions in XCode, this project file will call xmake to perform real building tasks, so that all custom building functions can be used, and changes to xmake options will take effect immediately in XCode projects.

Describe alternatives you've considered

No response

Additional context

No response

@JX-Master
Copy link
Author

Hi,
just to notify that I'm starting working on this issue. The following features will be included in the first release of this new generator (Milestone 1):

  1. Generate Xcode projects from xmake.lua directly, without the need of CMake installation.
  2. Map files, builds rules and targets to corresponding Xcode concepts (files, groups, configurations, targets, etc).
  3. Triggering build in Xcode invokes xmake to build targets by using custom building phases of Xcode. xmake callbacks like before_build, after_build, before_install, after_install, etc will be called as expected.
  4. Redirect xmake build directory to Xcode BUILD_DIR, so that invoking Clean build folder in Xcode will remove all xmake intermediate and output files as expected.
  5. Running & debugging in Xcode is supported, with additional graphics debugging support if the application uses Metal.

The following known features may be deferred to Milestone 2 or later:

  1. Currently only MacOS targets are supported. iOS, watchOS, tvOS, visionOS targets are not tested and may require additional refinement of the generator. I plan to test and support iOS targets on Milestone 2, other platforms may require community contributions to be supported (since I don't have corresponding test devices).
  2. Custom options specified in xmake.lua is currently ignored in Xcode build actions. I plan to support this in Milestone 2.
  3. Currently only Xcode build and run actions are supported. test, profile and deploy actions are currently not supported, and may require community contributions to support.

The first release of the new Xcode project generator plugin will be published in the mid of 2025. Stay tuned while I'm working on this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants