def set_build_vars
    warning_flags = ' -W -Wall'
    if 'release' == @config.release
      optimization_flags = " #{@config.optimization_release} -DRELEASE"
    else
      optimization_flags = " #{@config.optimization_dbg} -g"
    end

    # we could make these also arrays of source directories ...
    @settings['APP_SRC_DIR'] = 'src/app'
    @settings['LIB_SRC_DIR'] = 'src/lib'

    # derived settings
    @settings['BUILD_DIR'] = "#{build_dir}"
    @settings['LIB_OUT'] = "#{@settings['BUILD_DIR']}/libs"
    @settings['APP_OUT'] = "#{@settings['BUILD_DIR']}/apps"
    unless @settings['OECORE_TARGET_SYSROOT'].nil? || @settings['OECORE_TARGET_SYSROOT'].empty?
      @settings['SYS_LFLAGS'] = "-L#{@settings['OECORE_TARGET_SYSROOT']}/lib -L#{@settings['OECORE_TARGET_SYSROOT']}/usr/lib"
    end

    # set LD_LIBRARY_PATH
    @settings['LD_LIBRARY_PATH'] = @settings['LIB_OUT']

    # standard settings
    @settings['CXXFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_cpp}"
    @settings['CFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_c}"
    if @settings['PRJ_TYPE'] == 'SOLIB'
      @settings['CXXFLAGS'] += ' -fPIC'
      @settings['CFLAGS'] += ' -fPIC'
    end
    # !! don't change order of the following string components without care !!
    @settings['LDFLAGS'] = @settings['LDFLAGS'] + " -L #{@settings['LIB_OUT']} #{@settings['SYS_LFLAGS']} -Wl,--no-as-needed -Wl,--start-group"
  end
def set_build_vars
    warning_flags = ' -W -Wall'
    if 'release' == @config.release
      optimization_flags = " #{@config.optimization_release} -DRELEASE"
    else
      optimization_flags = " #{@config.optimization_dbg} -g"
    end

    # we could make these also arrays of source directories ...
    @settings['APP_SRC_DIR'] = 'src/app'
    @settings['LIB_SRC_DIR'] = 'src/lib'

    # derived settings
    @settings['BUILD_DIR'] = "#{build_dir}"
    @settings['LIB_OUT'] = "#{@settings['BUILD_DIR']}/libs"
    @settings['APP_OUT'] = "#{@settings['BUILD_DIR']}/apps"
    unless @settings['OECORE_TARGET_SYSROOT'].nil? || @settings['OECORE_TARGET_SYSROOT'].empty?
      @settings['SYS_LFLAGS'] = "-L#{@settings['OECORE_TARGET_SYSROOT']}/lib -L#{@settings['OECORE_TARGET_SYSROOT']}/usr/lib"
    end

    # set LD_LIBRARY_PATH
    @settings['LD_LIBRARY_PATH'] = @settings['LIB_OUT']

    # standard settings
    @settings['CXXFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_cpp}"
    @settings['CFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_c}"
    if @settings['PRJ_TYPE'] == 'SOLIB'
      @settings['CXXFLAGS'] += ' -fPIC'
      @settings['CFLAGS'] += ' -fPIC'
    end
    # !! don't change order of the following string components without care !!
    @settings['LDFLAGS'] = @settings['LDFLAGS'] + " -L #{@settings['LIB_OUT']} #{@settings['SYS_LFLAGS']} -Wl,--no-as-needed -Wl,--start-group"
  end
Set common build variables