casual-build-executable

Builds a causal-executable. That is, an executable with XA-resources linked in that will be initialized on boot.

The provided entrypoint will be invoked after casual has done some initialization magic for the XA-resources. Hence, your entrypoint is your main, and you can start using your `XA-resources’ from there.

prerequisite

casual is installed and CASUAL_HOME is set to the install path.

example

We have our main.cpp, which defines the entrypoint start

extern "C"
{
   int start( int argc, char** argv)
   {
      // do stuff with your xa-resources 
      return 0;
   }
}

We use a executable-definition-file to define the resources and entrypoint. We name this my-executable.yaml, See missing link? casual/middleware/configuration/example for more information.

executable:

  resources:
      # key of the resource (defined in resource-properties)
    - key: rm-mockup
      # a logical name that this server will use to get the proper runtime configuration.
      # it's probably a good idea to have names like <resource-type>/<application>, ex: db/my-application
      # to make it easier to configure correctly. Can be any name though.
      # If the domain does not have resource-configuration for the defined name, the executable will not boot.
      name: resource-1
      
  entrypoint: start

see build-executable-example for further details.

  • We want the server to be named my-executable

  • Use the definition-file to define the executable (which adds a dependency to a resource with the name resource-1 and the key rm-mockup )

  • Pass the source file main.cpp to casual-build-executable to be compiled at the same time as building the server.

$ casual-build-executable --output my-executable --definition my-executable.yaml --build-directives main.cpp 

custom

casual-build-executable assumes gcc/g++ option compatibility for default stuff. If you use another compiler you can opt in not to use default include/library-paths and so on.

note: you need to provide all paths, libraries and such

$ casual-build-executable --no-defaults --output my-executable --definition my-executable.yaml --build-directives main.cpp <all other stuff your compiler needs>

options

$ casual-build-executable --help
NAME
   casual-build-executable

DESCRIPTION
  builds a casual executable

OPTIONS                         c  value    vc  description
------------------------------  -  -------  --  -----------------------------------------------
-o, --output                    ?  <value>   1  name of executable to be built
-d, --definition                ?  <value>   1  path of the definition file
-c, --compiler                  ?  <value>   1  compiler to use
-cl, --compile-link-directives  *  <value>   +  additional compile & link directives
-k, --keep                      ?               keep the intermediate file
--no-defaults                   ?               do not add any default compiler/link directives
--source                        ?  <value>   1  explicit name of the intermediate file
-v, --verbose                   ?               verbose output
--help                          ?  <value>   *  use --help <option> to see further details