for (uint8_t i = 0; i < 2; ++i) {
+ if (!lengths[i]) continue;
+
*status = fll_execute_arguments_add(values[i], lengths[i], arguments);
if (F_status_is_error(*status)) break;
} // for
f_array_length_t i = 0;
for (i = 0; i < data_build.setting.build_libraries.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.build_libraries.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.build_libraries.array[i].string, data_build.setting.build_libraries.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.build_libraries_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.build_libraries_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.build_libraries_shared.array[i].string, data_build.setting.build_libraries_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.build_libraries_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.build_libraries_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.build_libraries_static.array[i].string, data_build.setting.build_libraries_static.array[i].used, arguments);
} // for
}
for (i = 0; i < data_build.setting.flags.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags.array[i].string, data_build.setting.flags.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.flags_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_shared.array[i].string, data_build.setting.flags_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.flags_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_static.array[i].string, data_build.setting.flags_static.array[i].used, arguments);
} // for
}
if (is_library) {
for (i = 0; i < data_build.setting.flags_library.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_library.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_library.array[i].string, data_build.setting.flags_library.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.flags_library_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_library_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_library_shared.array[i].string, data_build.setting.flags_library_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.flags_library_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_library_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_library_static.array[i].string, data_build.setting.flags_library_static.array[i].used, arguments);
} // for
}
}
else {
for (i = 0; i < data_build.setting.flags_program.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_program.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_program.array[i].string, data_build.setting.flags_program.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.flags_program_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_program_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_program_shared.array[i].string, data_build.setting.flags_program_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.flags_program_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.flags_program_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.flags_program_static.array[i].string, data_build.setting.flags_program_static.array[i].used, arguments);
} // for
}
}
for (i = 0; i < data_build.setting.defines.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines.array[i].string, data_build.setting.defines.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.defines_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used, arguments);
} // for
}
if (is_library) {
for (i = 0; i < data_build.setting.defines_library.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_library.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_library.array[i].string, data_build.setting.defines_library.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.defines_library_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_library_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_library_shared.array[i].string, data_build.setting.defines_library_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.defines_library_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_library_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_library_static.array[i].string, data_build.setting.defines_library_static.array[i].used, arguments);
} // for
}
}
else {
for (i = 0; i < data_build.setting.defines_program.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_program.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_program.array[i].string, data_build.setting.defines_program.array[i].used, arguments);
} // for
if (is_shared) {
for (i = 0; i < data_build.setting.defines_program_shared.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_program_shared.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_program_shared.array[i].string, data_build.setting.defines_program_shared.array[i].used, arguments);
} // for
}
else {
for (i = 0; i < data_build.setting.defines_program_static.used && F_status_is_error_not(*status); ++i) {
+
+ if (!data_build.setting.defines_program_static.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.defines_program_static.array[i].string, data_build.setting.defines_program_static.array[i].used, arguments);
} // for
}
}
for (i = 0; i < main.define.used && F_status_is_error_not(*status); ++i) {
+
+ if (!main.define.array[i].used) continue;
+
*status = fll_execute_arguments_add(main.define.array[i].string, main.define.array[i].used, arguments);
} // for
}
for (j = 0; j < sources[i]->used; ++j) {
+ if (!sources[i]->array[j].used) continue;
+
source_length = path_sources->used + sources[i]->array[j].used;
char source[source_length + 1];
for (uint8_t i = 0; i < 4; ++i) {
+ if (!lengths[i]) continue;
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
for (; i < data_build.setting.build_indexer_arguments.used; ++i) {
+ if (!data_build.setting.build_indexer_arguments.array[i].used) continue;
+
*status = fll_execute_arguments_add(data_build.setting.build_indexer_arguments.array[i].string, data_build.setting.build_indexer_arguments.array[i].used, &arguments);
if (F_status_is_error(*status)) break;
} // for
fll_error_print(main.error, F_status_set_fine(*status), "fl_fss_apply_delimit", F_true);
}
else {
- fake_build_load_setting_process(main, setting_file.used ? path_file : main.file_data_build_settings.string, buffer, objects, contents, setting, status);
+ fake_build_load_setting_process(main, F_true, setting_file.used ? path_file : main.file_data_build_settings.string, buffer, objects, contents, setting, status);
}
}
#endif // _di_fake_build_load_setting_
#ifndef _di_fake_build_load_setting_process_
- void fake_build_load_setting_process(const fake_main_t main, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) {
+ void fake_build_load_setting_process(const fake_main_t main, const bool checks, const f_string_t path_file, const f_string_static_t buffer, const f_fss_objects_t objects, const f_fss_contents_t contents, fake_build_setting_t *setting, f_status_t *status) {
if (F_status_is_error(*status) && buffer.used) return;
if (main.error.verbosity != f_console_verbosity_quiet) {
funlockfile(main.error.to.stream);
- // @todo update FSS functions to return which setting index the problem happened on.
- fl_print_format("%c%[%SA setting in the build setting file '%]", main.error.to.stream, f_string_eol_s[0], main.error.context, main.error.prefix, main.error.context);
+ fl_print_format("%c%[%SA setting in the file '%]", main.error.to.stream, f_string_eol_s[0], main.error.context, main.error.prefix, main.error.context);
fl_print_format("%[%S%]", main.error.to.stream, main.error.notable, path_file, main.error.notable);
fl_print_format("%[' is too long.%]%c", main.error.to.stream, main.error.context, main.error.context, f_string_eol_s[0]);
} // for
if (F_status_is_error_not(*status)) {
- if (!setting->version_file) {
+ if (checks && !setting->version_file) {
setting->version_file = fake_build_version_type_micro;
if (main.warning.verbosity == f_console_verbosity_verbose) {
}
}
- if (!setting->version_target) {
+ if (checks && !setting->version_target) {
setting->version_target = fake_build_version_type_major;
if (main.warning.verbosity == f_console_verbosity_verbose) {
}
}
}
- else {
+ else if (checks) {
prefix[i]->used = 0;
for (j = 0; j < 2; ++j) {
for (uint8_t k = 0; k < 5; ++k) {
+ if (!lengths[k]) continue;
+
*status = fll_execute_arguments_add(values[k], lengths[k], &arguments);
if (F_status_is_error(*status)) break;
} // for
for (uint8_t i = 0; i < 2; ++i) {
+ if (!lengths[i]) continue;
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
for (uint8_t i = 0; i < 4; ++i) {
+ if (!lengths[i]) continue;
+
*status = fll_execute_arguments_add(values[i], lengths[i], &arguments);
if (F_status_is_error(*status)) break;
} // for
}
}
}
- else if (fl_string_dynamic_partial_compare_string(fake_make_setting_indexer_arguments_s, data_make->buffer, fake_make_setting_indexer_arguments_s_length, settings.objects.array[i]) == F_equal_to) {
- f_array_length_t j = 0;
-
- // clear all existing indexer arguments.
- for (; j < data_make->setting_build.build_indexer_arguments.used; ++j) {
- data_make->setting_build.build_indexer_arguments.array[j].used = 0;
- } // for
-
- data_make->setting_build.build_indexer_arguments.used = 0;
-
- if (settings.contents.array[i].used > data_make->setting_build.build_indexer_arguments.size) {
- *status = f_string_dynamics_increase_by(F_memory_default_allocation_small_d, &data_make->setting_build.build_indexer_arguments);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
- break;
- }
- }
-
- for (j = 0; j < settings.contents.array[i].used; ++j) {
-
- *status = f_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &data_make->setting_build.build_indexer_arguments.array[data_make->setting_build.build_indexer_arguments.used]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamic_partial_append_nulless", F_true);
- break;
- }
-
- *status = f_string_dynamic_terminate_after(&data_make->setting_build.build_indexer_arguments.array[data_make->setting_build.build_indexer_arguments.used]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main.error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
- break;
- }
-
- ++data_make->setting_build.build_indexer_arguments.used;
- } // for
-
- if (F_status_is_error(*status)) break;
-
- *status = F_none;
- }
else if (fl_string_dynamic_partial_compare_string(fake_make_setting_load_build_s, data_make->buffer, fake_make_setting_load_build_s_length, settings.objects.array[i]) == F_equal_to) {
if (unmatched_load) {
if (settings.contents.array[i].used) {
return;
}
- // if either compiler or linker is specified, each will replace any existing build_compiler or build_indexer, respectively.
+ // if either compiler or indexer is specified, each will replace any existing build_compiler or build_indexer, respectively.
if (range_compiler) {
data_make->setting_build.build_compiler.used = 0;
*status = f_string_dynamic_partial_append(data_make->buffer, *range_compiler, &data_make->setting_build.build_compiler);
*status = F_status_set_error(F_signal);
}
else {
- fake_build_load_setting_process(main, main.file_data_build_fakefile.string, data_make->buffer, settings.objects, settings.contents, &data_make->setting_build, status);
+
+ // load the fakefile "settings" as if they are build "settings".
+ fake_build_load_setting_process(main, F_false, main.file_data_build_fakefile.string, data_make->buffer, settings.objects, settings.contents, &data_make->setting_build, status);
}
if (F_status_is_error_not(*status) && settings.objects.used) {
} // for
f_print_character(f_string_space_s[0], main->output.to.stream);
+ f_print_character(f_string_eol_s[0], main->output.to.stream);
funlockfile(main->output.to.stream);