We need help to structure our project to start using apple standard way to create Xcode project.
let me first express how currently we are creating Xcode project.
As of today, we are using CMake to generate our xcode project which we can open in XCODE IDE and build/debug/run/etc. XCode IDE can open those project but we notice that some build setting does not seem to have correct value while looking into XCODE IDE but it somehow builds. There are some other issues also. Along with those issues, we also could not share this xcodeproject generated via CMake to AppleDTS support team as Apple does not support project created via some third party tool (like CMake or others).
Let me also express why we decided to use CMake at first place to generate Xcode projects. Our project is layered architecture project where in upper layers uses lower layer artifacts. Each layer has its own set of build targets . And each layer can have both C++ and Swift files. And each layer would have most of the compiler flag common, but we could also have compiler flag specific to each layer also. To achieve all these, we have developed our own tool, which basically creates CMakeLists.txt (for project model- all targets, dependency, etc) and CMakePresets.json (for all compiler and linker flags). Now this tool scans through repos/source folders on each layer and then creates these files (CMakeLists.txt and CMakePresets.json). This tool uses inputs to decide compiler/linker/other properties from one centralized location. Which means every developer would use these same input files and thus they all can have same compiler/linker/other properties set consistent. This makes generated build system consistent on all developer machine and it allows confidence of saying if build works on one developer's machine would also work on other developer’s machine and if build does NOT work on one developer's machine, it would NOT work on other developer’s machine also. So, it’s consistent. That was the main reason to use CMake to generate xcode project. So, our internal tools creates meta data for CMake (which is CMakeLists and CMakePresets) and then CMake generates Xcode build system using XCode generator.
Now we want to move to xcode native way to create projects but at the same time we also want this consistency that each of my developer would use exact same compiler/linker/other properties. If we ask developer to use XCode IDE to create xcode project, we cannot guarantee that they all will use same compiler/linker/etc flags and thus we would end up having inconsistent behaviour on different developer machines. We need your help to figure out how we can achive this ? We read some ways that we can create some template project and then we can create some .xcconfig files and use them to set target properties but honestly, we are able to stich them together. So please help us directionally on this , how should we proceed ?
Basically we need to know how can we have all my developer use same xcodeproject.
I was also thinking how would I be setting my CI for apple builds if I have to use XCode IDE to create xcode project and since CI environments are non interactive and it can happen n number of times in day (if I have setup to run sanity for all Pull Requests).
Any help/direction on this is highly appreciated.