2 Replies Latest reply on Oct 1, 2014 2:53 PM by seyhan

    Build Step needs to generate C files before App is compiled. How do I do this?

    aiyerk

      I'm using protocol buffers and I need to generate C files in my build step which need to be added into my Application make targets. What would be the best way to do this? How can I create a pre application build target that will generate the extra source files and then add it to the main applications targets dependency ?

        • 1. Re: Build Step needs to generate C files before App is compiled. How do I do this?
          aiyerk

          Any update on this ?

           

          Thanks

          Kartik

          • 2. Re: Build Step needs to generate C files before App is compiled. How do I do this?
            seyhan

            Hi,

             

            Perhaps it would be beneficial for your project to create a script. In this script, first call a make to generate protobuf c/h files then call Wiced make to build your app. You may use your favorite scripting language.


            The same script could be used on your build server to generate nightly builds as well. Script could be used by other developers as they join to generate protobuf files.


            Below batch file is for Windows environment to build but if your server is running Linux, it could be replaced with a script running on Linux.

             

            =====================================================

            echo off

             

            echo “Go to Protobuf project directory”

            echo "cd ....."

            echo “Create c/h files based on proto file(s).”

            echo “protoc-c --c_out=. MyProtoFile.proto”

            echo "copy *.pb-c.c and *.pb-c.h files to your app in Wiced"

             

            echo “Go to Wiced SDK”

            cd c:\WICED-SDK-2.4.1

            echo “Build Wiced application”

            make snip.scan-BCM943362WCD4

            echo “Done building Wiced application”

            =====================================================

             

            For your normal build and debugging process, you can use the Wiced IDE to build and debug.

             

            Thanks,

            Seyhan Akkoyun

            1 of 1 people found this helpful