1import("//build/ohos.gni") 2 3expat_path = root_out_dir + "/third_party_expat" 4src_path = "//third_party/expat" 5action("deps_expat") { 6 script = "install.sh" 7 args = [ 8 rebase_path(src_path, root_build_dir), 9 rebase_path(expat_path, root_build_dir), 10 ] 11 inputs = [ src_path ] 12 outputs = [ 13 "$expat_path/expat-2.4.1/lib/expat.h", 14 "$expat_path/expat-2.4.1/lib/xmlparse.c", 15 "$expat_path/expat-2.4.1/lib/xmlrole.c", 16 "$expat_path/expat-2.4.1/lib/xmltok.c", 17 ] 18} 19 20## Build expat.a {{{ 21config("expat_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [] 25 26 cflags = [ 27 "-DXML_POOR_ENTROPY", 28 "-Wno-sign-compare", 29 ] 30} 31 32config("expat_public_config") { 33 include_dirs = [ 34 "$expat_path/expat-2.4.1", 35 "$expat_path/expat-2.4.1/lib", 36 ] 37 38 defines = [ "XML_STATIC" ] 39} 40 41ohos_static_library("expat") { 42 part_name = "expat" 43 subsystem_name = "thirdparty" 44 deps = [ ":deps_expat" ] 45 46 sources = [ 47 "$expat_path/expat-2.4.1/lib/expat.h", 48 "$expat_path/expat-2.4.1/lib/xmlparse.c", 49 "$expat_path/expat-2.4.1/lib/xmlrole.c", 50 "$expat_path/expat-2.4.1/lib/xmltok.c", 51 ] 52 53 configs = [ ":expat_config" ] 54 public_configs = [ ":expat_public_config" ] 55 56 public_deps = [] 57} 58## Build expat.a }}} 59