1# Copyright 2018 The PDFium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("//build_overrides/build.gni") 6import("../../pdfium.gni") 7import("../../testing/test.gni") 8 9source_set("fxcrt") { 10 visibility = [ 11 "../*", 12 "../../:*", 13 "../../fpdfsdk/*", 14 "../../fxbarcode:*", 15 "../../fxjs:*", 16 "../../testing:*", 17 "../../testing/fuzzers/*", 18 "../../testing/image_diff/*", 19 "../../third_party:fx_agg", 20 "../../third_party:fx_lcms2", 21 "../../third_party:fx_libopenjpeg", 22 "../../third_party:fx_tiff", 23 "../../xfa/*", 24 ] 25 sources = [ 26 "autonuller.h", 27 "autorestorer.h", 28 "binary_buffer.cpp", 29 "binary_buffer.h", 30 "byteorder.h", 31 "bytestring.cpp", 32 "bytestring.h", 33 "cfx_bitstream.cpp", 34 "cfx_bitstream.h", 35 "cfx_datetime.cpp", 36 "cfx_datetime.h", 37 "cfx_read_only_span_stream.cpp", 38 "cfx_read_only_span_stream.h", 39 "cfx_read_only_string_stream.cpp", 40 "cfx_read_only_string_stream.h", 41 "cfx_read_only_vector_stream.cpp", 42 "cfx_read_only_vector_stream.h", 43 "cfx_seekablestreamproxy.cpp", 44 "cfx_seekablestreamproxy.h", 45 "cfx_timer.cpp", 46 "cfx_timer.h", 47 "check.h", 48 "check_op.h", 49 "code_point_view.h", 50 "component_export.h", 51 "containers/adapters.h", 52 "containers/contains.h", 53 "data_vector.h", 54 "debug/alias.cc", 55 "debug/alias.h", 56 "fileaccess_iface.h", 57 "fixed_size_data_vector.h", 58 "fx_2d_size.h", 59 "fx_bidi.cpp", 60 "fx_bidi.h", 61 "fx_codepage.cpp", 62 "fx_codepage.h", 63 "fx_codepage_forward.h", 64 "fx_coordinates.cpp", 65 "fx_coordinates.h", 66 "fx_extension.cpp", 67 "fx_extension.h", 68 "fx_folder.h", 69 "fx_memcpy_wrappers.h", 70 "fx_memory.cpp", 71 "fx_memory.h", 72 "fx_memory_wrappers.h", 73 "fx_number.cpp", 74 "fx_number.h", 75 "fx_random.cpp", 76 "fx_random.h", 77 "fx_safe_types.h", 78 "fx_stream.cpp", 79 "fx_stream.h", 80 "fx_string.cpp", 81 "fx_string.h", 82 "fx_string_wrappers.h", 83 "fx_system.cpp", 84 "fx_system.h", 85 "fx_types.h", 86 "fx_unicode.cpp", 87 "fx_unicode.h", 88 "immediate_crash.h", 89 "mask.h", 90 "maybe_owned.h", 91 "notreached.h", 92 "numerics/checked_math.h", 93 "numerics/checked_math_impl.h", 94 "numerics/clamped_math.h", 95 "numerics/clamped_math_impl.h", 96 "numerics/safe_conversions.h", 97 "numerics/safe_conversions_arm_impl.h", 98 "numerics/safe_conversions_impl.h", 99 "numerics/safe_math.h", 100 "numerics/safe_math_arm_impl.h", 101 "numerics/safe_math_clang_gcc_impl.h", 102 "numerics/safe_math_shared_impl.h", 103 "observed_ptr.cpp", 104 "observed_ptr.h", 105 "pauseindicator_iface.h", 106 "ptr_util.h", 107 "raw_span.h", 108 "retain_ptr.h", 109 "scoped_set_insertion.h", 110 "shared_copy_on_write.h", 111 "span.h", 112 "span_util.h", 113 "stl_util.h", 114 "string_data_template.cpp", 115 "string_data_template.h", 116 "string_pool_template.h", 117 "string_template.cpp", 118 "string_template.h", 119 "string_view_template.h", 120 "template_util.h", 121 "tree_node.h", 122 "unowned_ptr.h", 123 "utf16.h", 124 "weak_ptr.h", 125 "widestring.cpp", 126 "widestring.h", 127 "widetext_buffer.cpp", 128 "widetext_buffer.h", 129 "xml/cfx_xmlchardata.cpp", 130 "xml/cfx_xmlchardata.h", 131 "xml/cfx_xmldocument.cpp", 132 "xml/cfx_xmldocument.h", 133 "xml/cfx_xmlelement.cpp", 134 "xml/cfx_xmlelement.h", 135 "xml/cfx_xmlinstruction.cpp", 136 "xml/cfx_xmlinstruction.h", 137 "xml/cfx_xmlnode.cpp", 138 "xml/cfx_xmlnode.h", 139 "xml/cfx_xmlparser.cpp", 140 "xml/cfx_xmlparser.h", 141 "xml/cfx_xmltext.cpp", 142 "xml/cfx_xmltext.h", 143 "zip.h", 144 ] 145 configs += [ 146 "../../:pdfium_strict_config", 147 "../../:pdfium_noshorten_config", 148 ] 149 deps = [ "//third_party/fast_float" ] 150 public_deps = [ 151 "../../:freetype_common", 152 "//third_party/abseil-cpp:absl", 153 "//third_party/icu:icuuc", 154 ] 155 if (pdf_use_partition_alloc) { 156 sources += [ "fx_memory_pa.cpp" ] 157 public_deps += [ "../../third_party:pdfium_pa" ] 158 } else { 159 sources += [ "fx_memory_malloc.cpp" ] 160 } 161 if (is_posix) { 162 sources += [ 163 "cfx_fileaccess_posix.cpp", 164 "cfx_fileaccess_posix.h", 165 "fx_folder_posix.cpp", 166 ] 167 } 168 if (is_win) { 169 sources += [ 170 "cfx_fileaccess_windows.cpp", 171 "cfx_fileaccess_windows.h", 172 "code_point_view.cpp", 173 "fx_folder_windows.cpp", 174 "win/scoped_select_object.h", 175 "win/win_util.cc", 176 "win/win_util.h", 177 ] 178 } 179 if (pdf_enable_xfa) { 180 sources += [ 181 "cfx_memorystream.cpp", 182 "cfx_memorystream.h", 183 ] 184 } 185} 186 187source_set("test_support") { 188 testonly = true 189 sources = [ 190 "fx_coordinates_test_support.cpp", 191 "fx_coordinates_test_support.h", 192 "string_test_support.cpp", 193 ] 194 configs += [ "../../:pdfium_strict_config" ] 195 deps = [ ":fxcrt" ] 196} 197 198source_set("unit_test_support") { 199 testonly = true 200 sources = [ 201 "fake_time_test.cpp", 202 "fake_time_test.h", 203 ] 204 configs += [ "../../:pdfium_strict_config" ] 205 deps = [ 206 ":fxcrt", 207 ":test_support", 208 "//testing/gtest", 209 ] 210} 211 212pdfium_unittest_source_set("unittests") { 213 sources = [ 214 "autonuller_unittest.cpp", 215 "autorestorer_unittest.cpp", 216 "binary_buffer_unittest.cpp", 217 "byteorder_unittest.cpp", 218 "bytestring_unittest.cpp", 219 "cfx_bitstream_unittest.cpp", 220 "cfx_datetime_unittest.cpp", 221 "cfx_seekablestreamproxy_unittest.cpp", 222 "cfx_timer_unittest.cpp", 223 "code_point_view_unittest.cpp", 224 "fixed_size_data_vector_unittest.cpp", 225 "fx_bidi_unittest.cpp", 226 "fx_coordinates_unittest.cpp", 227 "fx_extension_unittest.cpp", 228 "fx_memcpy_wrappers_unittest.cpp", 229 "fx_memory_unittest.cpp", 230 "fx_memory_wrappers_unittest.cpp", 231 "fx_number_unittest.cpp", 232 "fx_random_unittest.cpp", 233 "fx_safe_types_unittest.cpp", 234 "fx_string_unittest.cpp", 235 "fx_string_wrappers_unittest.cpp", 236 "fx_system_unittest.cpp", 237 "mask_unittest.cpp", 238 "maybe_owned_unittest.cpp", 239 "observed_ptr_unittest.cpp", 240 "pdfium_span_unittest.cpp", 241 "retain_ptr_unittest.cpp", 242 "scoped_set_insertion_unittest.cpp", 243 "shared_copy_on_write_unittest.cpp", 244 "span_util_unittest.cpp", 245 "stl_util_unittest.cpp", 246 "string_pool_template_unittest.cpp", 247 "tree_node_unittest.cpp", 248 "unowned_ptr_unittest.cpp", 249 "utf16_unittest.cpp", 250 "weak_ptr_unittest.cpp", 251 "widestring_unittest.cpp", 252 "widetext_buffer_unittest.cpp", 253 "xml/cfx_xmlchardata_unittest.cpp", 254 "xml/cfx_xmldocument_unittest.cpp", 255 "xml/cfx_xmlelement_unittest.cpp", 256 "xml/cfx_xmlinstruction_unittest.cpp", 257 "xml/cfx_xmlnode_unittest.cpp", 258 "xml/cfx_xmlparser_unittest.cpp", 259 "xml/cfx_xmltext_unittest.cpp", 260 "zip_unittest.cpp", 261 ] 262 deps = [ 263 ":test_support", 264 ":unit_test_support", 265 ] 266 pdfium_root_dir = "../../" 267 if (pdf_use_partition_alloc) { 268 deps += [ "//base/allocator/partition_allocator/src/partition_alloc" ] 269 } 270 if (pdf_enable_xfa) { 271 sources += [ "cfx_memorystream_unittest.cpp" ] 272 deps += [ "../fpdfapi/parser" ] 273 } 274} 275