From 76ab5dcb87379a7e334b6ca1ae23f4aacf9ae935 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 6 Jun 2020 21:45:35 -0500 Subject: [PATCH] Update: add missing handling of defines_all, defines_shared, and defines_static --- level_3/fake/c/private-build.c | 50 ++++++++++++++++++++++++++++++++++++++++++ level_3/fake/c/private-build.h | 5 +++++ 2 files changed, 55 insertions(+) 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" -- 1.8.3.1