]> Kevux Git Server - fll/commitdiff
Update: add missing handling of defines_all, defines_shared, and defines_static
authorKevin Day <thekevinday@gmail.com>
Sun, 7 Jun 2020 02:45:35 +0000 (21:45 -0500)
committerKevin Day <thekevinday@gmail.com>
Sun, 7 Jun 2020 02:45:35 +0000 (21:45 -0500)
level_3/fake/c/private-build.c
level_3/fake/c/private-build.h

index 2f734f3811808183a5ea6240eb6c821354a01b59..3e91b11b19022f22a45bc8222fe8a27c8af5f534 100644 (file)
@@ -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_
 
index 252923d4cb883008946ede2561c4c6d5c7ba7438..ddb66304434de7a566f4228bb211460659b0afa1 100644 (file)
@@ -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"