gn generated Xcode project of WebRTC does not compile - xcode

This is the first time I am trying to build something from the source codes. I was trying to make a console program out of WebRTC native code.
I followed official guide and checked out the source code.
As the guide says,
To generate IDE project files, pass the --ide flag to the GN command. See the GN reference for more details on the supported IDEs.
I used this command to generate Xcode project:
$ gn gen out/Default --ide=xcode
But the Xcode project generated does not compile. Xcode kept telling me it could not find those files.
Is it because I did not do ninja -C out/Default? I am confused — am I supposed to still compile the whole source codes using ninja while I have generated an Xcode project using gn?

am I supposed to still compile the whole source codes using ninja while I have generated an Xcode project using gn? => yes

See https://dev.chromium.org/developers/how-tos/debugging-on-os-x/building-with-ninja-debugging-with-xcode for further details on building with Ninja and debugging with Xcode.

Related

Generate Makefile using meson build file

In one of our projects we have used Gstreamer good plugins. I see that each element has a Makefile for building.
Now I wanted to upgrade rtpmanager code (https://github.com/GStreamer/gst-plugins-good/tree/master/gst/rtpmanager) inside Gstreamer. But, I see that there are no Makfiles anymore but 'meson.build' file.
Currently our project build does not support meson. So, is there a way to convert the latest rtpmanager code involving meson.build to traditional Makefile kind of build so that I can integrate its latest changes into my project.
Meson does not and never will generate makefiles.
Qemu meson PoC is using a tool to convert ninja files to Makefile:
https://github.com/bonzini/qemu/blob/meson-poc/scripts/ninjatool.py

How to executed Rez utility on OsX using cmake?

I'm building an After Effects plugin on OsX.
The XCode project work fine and now I'm trying to port the XCode projects to Cmake environment.
One of the issues I have:
- The XCode automatically executes Rez utility on .r(esource) files
Any ideas how to build the .r files with cmake?
It seems CMake do not provide automatic resource file support in apple. You should use add_custom_command to run Rez at compile stage.

MQX 4.0.1 program Not Compiled with GCC

I am using TWR-K20D72M and I opened a Sample program which is given in the MQX 4.0.1 Demo examples. When I choose Build tool option as Freescale
the program compiles OK but When I choose Build tool option as GCC It gives me error.The Error is below
error
Description
mingw32-make: *** No rule to make target `C:/Freescale/Freescale_MQX_4_0/lib/twrk20d72m.cw10gcc/debug/bsp/intflash.ld', needed by `explicit-dependencies'.
I read somewhere that The GCC can only work with MQX 4.0.1 and above so I am using MQX 4.0.1 .
Can some suggest me the reason for this error.How I can I remove this error.......
Thanks
You are missing the linker script file for your project intflash.ld.
Normally this file is located on
{mqx_install_dir}\mqx\source\bsp\{your_bsp_name}\gcc_cw
and is copied to
{mqx_install_dir}\lib\{your_bsp_name}.cw10gcc\debug\bsp
and
{mqx_install_dir}\lib\{your_bsp_name}.cw10gcc\release\bsp
after the build process by the scripts for your bsp, located on
{mqx_install_dir}\mqx\build\bat.
Take a look inside your bsp script and verify that intflash.ld is being copied correctly.
My guess is that you compiled your MQX application before compiling the BSP and PSP. With the release of CodeWarrior 4.6, the solution has gotten a bit easier through the use of .wsd files.
If you look at the FSL_MQX_getting_started.pdf, section 2.4 describes how to find a .wsd file which needs to be dragged into your CodeWarrior Project Explorer. Once this is done new projects will be added to your workspace. Compile the bsp_... and psp_... and any other libs that you require (usb, ethernet etc) which will generate binaries and the intflash.ld file in the correct location.
http://cache.freescale.com/files/soft_dev_tools/doc/support_info/FSL_MQX_Getting_Started.pdf

Issue with compiling example code

I'm trying to compile this sample code with XCode 4.2b, here's how my project looks like:
Application type: Command Line Tool. When I'm trying to build the project, I get the following list of errors:
I suppose that I haven't added some frameworks to the project, though I don't know what frameworks should be added...
The imported files probably contain Objective C code, but you're using the C compiler.
Change the file extension of main.c to main.m.

Is it possible to automatically generate Xcode projects?

Simple question. Are there any tools for generating Xcode projects from the command line? We use SCons to build our cross-platform application, but that doesn't support intrinsic Xcode project generation. We'd like to avoid creating the project manually, since this would involve maintaining multiple file lists.
Look at CMake. You can generate XCode projects from it automatically. I found a previous StackOverflow question about its usage here. To get it to generate an XCode project, you use it as such:
CMake -G xcode
You can use premake (http://industriousone.com/premake) to generate Xcode projects. It can also generate Visual Studio projects.
For the benefit of anyone who lands on this question, I’ve actually just pushed an Xcode project file generator for SCons up to Bitbucket.
I think that your question should be "Is there a way to generate an XCode project from a SCons one?". I suppose, by your asking and by reading the others, that the answer is 'no'.
SCons people should know it better. I think they will be happy if you contribute a SCons Xcode project generator.
In the meantime you may choose to switch to CMake or to create your XCode project by hand that, given a good source tree organization, may be the best pragmatic solution.
qmake in the Qt toolchain generates Xcode projects. You can at least download it and take a look at its source here (LGPL).
You can generate a XCode project using the python based build system called waf. You need to download and install waf with the xcode6 extension:
$ curl -o waf-1.9.7.tar.bz2 https://waf.io/waf-1.9.7.tar.bz2
$ tar xjvf waf-1.9.7.tar.bz2
$ cd waf-1.9.7
$ ./waf-light --tools=xcode6
That will create a waf executable which can build your project. You need to configure how to generate your XCode project inside a file called wscript that should reside in your project folder. The wscript file uses Python syntax. Here's an example of how you could configure your project:
def configure(conf):
# Use environment variables to set default project configuration
# settings
conf.env.FRAMEWORK_VERSION = '1.0'
conf.env.ARCHS = 'x86_64'
# This must be called at the end of configure()
conf.load('xcode6')
# This will build a XCode project with one target with type 'framework'
def build(bld):
bld.load('xcode6')
bld.framework(
includes='include',
# Specify source files.
# This will become the groups (folders) inside XCode.
# Pass a dictionary to group by name. Use a list to add everything in one
source_files={
'MyLibSource': bld.path.ant_glob('src/MyLib/*.cpp|*.m|*.mm'),
'Include': bld.path.ant_glob(incl=['include/MyLib/*.h', 'include'], dir=True)
},
# export_headers will put the files in the
# 'Header Build Phase' in Xcode - i.e tell XCode to ship them with your .framework
export_headers=bld.path.ant_glob(incl=['include/MyLib/*.h', 'include/MyLib/SupportLib'], dir=True),
target='MyLib',
install='~/Library/Frameworks'
)
There are a bunch of settings you can use to configure it for your project.
Then to actually generate the XCode project, cd into your project folder where the wscript is and run your waf executable like
$ ./waf configure xcode6
A promising alternative to CMake which can generate Xcode projects is xmake. I haven’t tried it yet, but it looks good from the documentation.
Install xmake, create a simple project file (xmake.lua):
target("test")
add_files("src/*.cpp")
Then you can either do a command-line build:
xmake
or create an Xcode project:
xmake project -k xcode
Note that currently xmake seems to invoke CMake to generate the Xcode project, although they say they plan to add native Xcode project generation at some point.
You could use Automator to generate them for you.
I checked and there is no prebuilt action.
Therefore you would have to record your actions with Automator to do this.

Resources