Domanda

I found this very helpful example about MenuLayers and it works very well. In this line it is said that the method was defined in another file.

showDetail(cell_index); // Defined in detailView.c

As i compile and run, everything get´s called correctly. But im wondering how the compiler knows when to include this file?

I can see no include instruction, so my idea was that all files in the src/ folder will automatically be included. But if that is so, in which order?

È stato utile?

Soluzione

Pebble SDK uses waf as its build tool. It is configured in the wscript file.

If you look at the wscript file of your Pebble project you will see the following lines:

def build(ctx):
    ctx.load('pebble_sdk')

    ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
                    target='pebble-app.elf')

This tells the compiler to compile and link together all the ".c" files in src/ and all of its sub-directories.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top