From: Kevin Day Date: Sun, 7 Jun 2020 02:45:35 +0000 (-0500) Subject: Update: add missing handling of defines_all, defines_shared, and defines_static X-Git-Tag: 0.5.0~199 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=76ab5dcb87379a7e334b6ca1ae23f4aacf9ae935;p=fll Update: add missing handling of defines_all, defines_shared, and defines_static --- diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index 2f734f3..3e91b11 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -118,6 +118,56 @@ extern "C" { if (F_status_is_error(*status)) break; } // for } + + { + f_string_length length = 0; + f_array_length i = 0; + + for (; i < data_build.setting.defines_all.used && F_status_is_fine(*status); i++) { + length = fake_build_parameter_define_prefix_length + data_build.setting.defines_all.array[i].used; + + char string[length + 1]; + + memcpy(string, fake_build_parameter_define_prefix, fake_build_parameter_define_prefix_length); + memcpy(string + fake_build_parameter_define_prefix_length, data_build.setting.defines_all.array[i].string, data_build.setting.defines_all.array[i].used); + + string[length] = 0; + + *status = fll_execute_arguments_add(string, length, arguments); + if (F_status_is_error(*status)) break; + } // for + + if (is_shared) { + for (i = 0; i < data_build.setting.defines_shared.used && F_status_is_fine(*status); i++) { + length = fake_build_parameter_define_prefix_length + data_build.setting.defines_shared.array[i].used; + + char string[length + 1]; + + memcpy(string, fake_build_parameter_define_prefix, fake_build_parameter_define_prefix_length); + memcpy(string + fake_build_parameter_define_prefix_length, data_build.setting.defines_shared.array[i].string, data_build.setting.defines_shared.array[i].used); + + string[length] = 0; + + *status = fll_execute_arguments_add(string, length, arguments); + if (F_status_is_error(*status)) break; + } // for + } + else { + for (i = 0; i < data_build.setting.defines_static.used && F_status_is_fine(*status); i++) { + length = fake_build_parameter_define_prefix_length + data_build.setting.defines_static.array[i].used; + + char string[length + 1]; + + memcpy(string, fake_build_parameter_define_prefix, fake_build_parameter_define_prefix_length); + memcpy(string + fake_build_parameter_define_prefix_length, data_build.setting.defines_static.array[i].string, data_build.setting.defines_static.array[i].used); + + string[length] = 0; + + *status = fll_execute_arguments_add(string, length, arguments); + if (F_status_is_error(*status)) break; + } // for + } + } } #endif // _di_fake_build_arguments_standard_add_ diff --git a/level_3/fake/c/private-build.h b/level_3/fake/c/private-build.h index 252923d..ddb6630 100644 --- a/level_3/fake/c/private-build.h +++ b/level_3/fake/c/private-build.h @@ -355,6 +355,11 @@ extern "C" { #endif // _di_fake_build_data_ #ifndef _di_fake_build_parameter_ + + #define fake_build_parameter_define_prefix "-D" + + #define fake_build_parameter_define_prefix_length 2 + #define fake_build_parameter_library_include "-I" #define fake_build_parameter_library_link_file "-l" #define fake_build_parameter_library_link_path "-L"