Setting Project-Wide Build Properties and Compiler Directives

Project Settings

All directives specified are used when a project compiles, apart from those overridden by settings for individual files or build configurations.

  1. Click Project > Properties.
  2. Expand Micro Focus.
  3. Expand Project Settings.
  4. Use the dialog boxes to choose your settings:
    COBOL
    1. Click COBOL.
    2. Type the directives into the Additional directives value cell. Separate each directive with a space.
    3. If you do not require SQL Preprocessor compiler directives, click OK; otherwise, click Apply.
    COBOL > SQL Preprocessor
    Enables you to choose an SQL Preprocessor and the compiler directives you want to use.
    1. Expand COBOL; then click SQL Preprocessor.
    2. Check Use SQL Preprocessor.

      You can only specify an SQL preprocessor at file level, if no preprocessor is enabled for the project or for the build configuration. In this case, the preprocessor that is available at file level is the last one used at project level.

    3. From the Preprocessor Type drop-down list, choose a preprocessor.
    4. On the Directives grid, complete the Value field for each directive you want to set; then click Apply.

      The SQL Compiler directives you have selected appear in the SQL Directives text box.

    5. Click OK.

Build Configurations

Enables you to configure the output of the build process, including names and locations of output files and whether the build is for debugging purposes. You can also specify further directives for linking and command line processing. Build configurations override project settings:

  1. Click Project > Properties.
  2. Expand Micro Focus.
  3. Click Build Configurations and choose a configuration, or create a new one by clicking Manage Configurations, then Add Build Configuration.
  4. To override directives set in Project Settings, use the COBOL and SQL Preprocessor entries under Build Configurations:
    COBOL
    1. Click COBOL.
    2. Expand Override project COBOL settings.
    3. Check Enable configuration specific settings.
    4. Type the directives into the Additional directives value cell. Separate each directive with a space.
    5. If you do not require SQL Preprocessor compiler directives, click OK; otherwise, click Apply.
    COBOL > SQL Preprocessor
    1. Expand COBOL; then click SQL Prepocessor.
    2. Check Enable configuration specific settings and Use SQL Preprocessor.
    3. From the Preprocessor Type drop-down list, choose a preprocessor.
    4. On the Directives grid, complete the Value field for each directive you want to set; then click Apply.

      The SQL Compiler directives you have selected appear in the SQL Directives text box.

    5. Click Apply.
    6. Build configurations can use further directives for linking and command line processing. Use the following dialog boxes to choose your settings, otherwise, click OK:
    Events
    Enables you to write command line entries to be run before and after the build takes place. Include directives as part of any command line instruction you enter in the Pre-build event command line and Post-build event command line text boxes.
    Note:

    If you reference path variables within Events, you must prefix any variable with ${pathVar. and terminate the variable with }, for example - you must code PROJECT_LOC as ${pathVar.PROJECT_LOC}.

    To use environment variables in events you must set export the variables in the operating system, before starting Eclipse. The scope of a changed environment variable is limited to the build event in which it is made and lasts for the duration of that event.

    Link
    Enables you to configure how the application links to the run-time system, including resource files and other items to be linked. Expand Additional Link Directives and enter the directives in the text box.

The Compiler directives are saved with the project, so that they are used on all files in the project the next time you build the project.

Most directives are overridden by directives specified for individual source files. You can only specify an SQL preprocessor at file level, if no preprocessor is enabled for the project or for the build configuration. In this case, the preprocessor that is available at file level is the last one used at project level.