aboutsummaryrefslogblamecommitdiff
path: root/www/chromium/files/patch-base_BUILD.gn
blob: 61aca5553be53d82803b58d6efaf4f9b61da8da8 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                               
                 
                                               


                                             

                                            
                   

                                 
                                                


                                            
 
                  






                                           
                                                 

                                                                       

                                                                       
                                                                                  
                                                         
                         
    
 






                      







                                     
                                               
        
                                                                          





                                                                  
                                               
 

                                                                       

                                                                          


                                        
                                                
      

    
                
                 
                                            
                                  
                                    
                                 

                                  

                                           
                                        

                 
                                 

                                           












                                             


                                             
                                    
      




                 
                                              
      
    
 




                                              
                                              







                                                         
                                              
 

                                                                       

                                                                          


                                        
                                              







                                                            
--- base/BUILD.gn.orig	2022-06-17 14:20:10 UTC
+++ base/BUILD.gn
@@ -1004,7 +1004,7 @@ mixed_component("base") {
       "timer/hi_res_timer_manager_posix.cc",
     ]
 
-    if (!is_nacl && !is_apple) {
+    if (!is_nacl && !is_apple && !is_bsd) {
       sources += [
         "cpu_affinity_posix.cc",
         "cpu_affinity_posix.h",
@@ -1015,6 +1015,12 @@ mixed_component("base") {
         "profiler/thread_delegate_posix.h",
       ]
     }
+
+    if (is_bsd) {
+      sources += [
+        "profiler/stack_sampler_posix.cc",
+      ]
+    }
   }
 
   if (is_win) {
@@ -1496,11 +1502,23 @@ mixed_component("base") {
   # building inside the cros_sdk environment - use host_toolchain as a
   # more robust check for this.
   if (!use_sysroot &&
-      (is_android || ((is_linux || is_chromeos) && !is_chromecast)) &&
+      (is_android || ((is_linux || is_chromeos) && !is_chromecast && !is_bsd)) &&
       host_toolchain != "//build/toolchain/cros:host") {
     libs += [ "atomic" ]
   }
 
+  # *BSD needs libkvm
+  if (is_bsd) {
+    libs += [ "kvm" ]
+  }
+
+  if (is_freebsd) {
+    libs += [
+      "execinfo",
+      "util",
+    ]
+  }
+
   if (use_allocator_shim) {
     sources += [
       "allocator/allocator_shim.cc",
@@ -1528,7 +1546,7 @@ mixed_component("base") {
       ]
       configs += [ "//base/allocator:mac_no_default_new_delete_symbols" ]
     }
-    if (is_chromeos || is_linux) {
+    if (is_chromeos || (is_linux && !is_bsd)) {
       sources += [
         "allocator/allocator_shim_override_cpp_symbols.h",
         "allocator/allocator_shim_override_glibc_weak_symbols.h",
@@ -1584,7 +1602,7 @@ mixed_component("base") {
 
   # Allow more direct string conversions on platforms with native utf8
   # strings
-  if (is_apple || is_chromeos || is_chromecast || is_fuchsia) {
+  if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) {
     defines += [ "SYSTEM_NATIVE_UTF8" ]
   }
 
@@ -2158,6 +2176,42 @@ mixed_component("base") {
     }
   }
 
+  if (is_bsd) {
+    sources -= [
+      "files/file_path_watcher_inotify.cc",
+      "files/file_util_linux.cc",
+      "files/scoped_file_linux.cc",
+      "process/memory_linux.cc",
+      "process/process_linux.cc",
+      "system/sys_info_linux.cc",
+      "process/process_iterator_linux.cc",
+      "process/process_metrics_linux.cc",
+      "process/process_handle_linux.cc"
+    ]
+    sources += [
+      "process/memory_stubs.cc",
+      "files/file_path_watcher_kqueue.cc",
+      "files/file_path_watcher_kqueue.h",
+      "files/file_path_watcher_bsd.cc",
+    ]
+  }
+
+  if (is_openbsd) {
+    sources += [
+      "process/process_handle_openbsd.cc",
+      "process/process_iterator_openbsd.cc",
+      "process/process_metrics_openbsd.cc",
+      "system/sys_info_openbsd.cc",
+    ]
+  } else if (is_freebsd) {
+    sources += [
+      "process/process_handle_freebsd.cc",
+      "process/process_iterator_freebsd.cc",
+      "process/process_metrics_freebsd.cc",
+      "system/sys_info_freebsd.cc",
+    ]
+  }
+
   # iOS
   if (is_ios) {
     sources -= [
@@ -3452,7 +3506,7 @@ test("base_unittests") {
     }
   }
 
-  if (is_linux || is_chromeos) {
+  if ((is_linux || is_chromeos) && !is_bsd) {
     sources += [
       "debug/proc_maps_linux_unittest.cc",
       "files/scoped_file_linux_unittest.cc",
@@ -3500,7 +3554,7 @@ test("base_unittests") {
       "posix/unix_domain_socket_unittest.cc",
       "task/thread_pool/task_tracker_posix_unittest.cc",
     ]
-    if (!is_nacl && !is_apple) {
+    if (!is_nacl && !is_apple && !is_bsd) {
       sources += [
         "cpu_affinity_posix_unittest.cc",
         "profiler/stack_copier_signal_unittest.cc",
@@ -3511,7 +3565,7 @@ test("base_unittests") {
 
   # Allow more direct string conversions on platforms with native utf8
   # strings
-  if (is_apple || is_chromeos || is_chromecast || is_fuchsia) {
+  if (is_apple || is_chromeos || is_chromecast || is_fuchsia || is_bsd) {
     defines += [ "SYSTEM_NATIVE_UTF8" ]
   }
 
@@ -3683,7 +3737,7 @@ test("base_unittests") {
     }
   }
 
-  if (is_fuchsia || is_linux || is_chromeos) {
+  if ((is_fuchsia || is_linux || is_chromeos) && !is_bsd) {
     sources += [
       "debug/elf_reader_unittest.cc",
       "debug/test_elf_image_builder.cc",