1import("//build/test.gni") 2 3ohos_static_library("libtest") { 4 include_dirs = [ "." ] 5 6 sources = [ 7 "check_log.c", 8 "fdfill.c", 9 "memfill.c", 10 "mtest.c", 11 "path.c", 12 "print.c", 13 "rand.c", 14 "runtest.c", 15 "setrlim.c", 16 "utf8.c", 17 "vmfill.c", 18 ] 19 20 cflags_c = [ 21 "-pipe", 22 "-std=c99", 23 "-D_POSIX_C_SOURCE=200809L", 24 "-Wall", 25 "-Wno-unused", 26 "-Wno-unused-function", 27 "-Wno-missing-braces", 28 "-Wno-overflow", 29 "-Wno-unknown-pragmas", 30 "-Wno-unsupported-floating-point-opt", 31 "-fno-builtin", 32 "-frounding-math", 33 "-Werror=implicit-function-declaration", 34 "-Werror=implicit-int", 35 "-Werror=pointer-sign", 36 "-Werror=pointer-arith", 37 "-g", 38 "-D_FILE_OFFSET_BITS=64", 39 ] 40 41 output_name = "libtest" 42} 43 44ohos_executable("runtest") { 45 sources = [ "runtest.c" ] 46 47 configs = [ ":config_runtest" ] 48 deps = [ ":libtest" ] 49 subsystem_name = "musl" 50 part_name = "libc-test" 51} 52 53config("config_runtest") { 54 include_dirs = [ "." ] 55 56 cflags_c = [ 57 "-pipe", 58 "-std=c99", 59 "-D_POSIX_C_SOURCE=200809L", 60 "-Wall", 61 "-Wno-unused", 62 "-Wno-unused-function", 63 "-Wno-missing-braces", 64 "-Wno-overflow", 65 "-Wno-unknown-pragmas", 66 "-Wno-unsupported-floating-point-opt", 67 "-fno-builtin", 68 "-frounding-math", 69 "-Werror=implicit-function-declaration", 70 "-Werror=implicit-int", 71 "-Werror=pointer-sign", 72 "-Werror=pointer-arith", 73 "-Wno-error=unused-function", 74 "-g", 75 "-D_FILE_OFFSET_BITS=64", 76 ] 77 78 cflags = [ "-Wno-unused-function" ] 79 80 ldflags = [ "-nostdlib" ] 81 82 libs = [ "//${target_out_dir}/libtest.a" ] 83} 84 85config("config_unittest") { 86 include_dirs = [ "." ] 87 88 cflags_c = [ 89 "-pipe", 90 "-std=c99", 91 "-ffreestanding", 92 "-nostdinc", 93 "-D_POSIX_C_SOURCE=200809L", 94 "-Wall", 95 "-Wno-unused", 96 "-Wno-unused-function", 97 "-Wno-missing-braces", 98 "-Wno-overflow", 99 "-Wno-unknown-pragmas", 100 "-Wno-unsupported-floating-point-opt", 101 "-Wno-parentheses", 102 "-fno-builtin", 103 "-frounding-math", 104 "-Werror=implicit-function-declaration", 105 "-Werror=implicit-int", 106 "-Werror=pointer-sign", 107 "-Werror=pointer-arith", 108 "-Wno-error=unused-function", 109 "-g", 110 "-D_FILE_OFFSET_BITS=64", 111 "-Wno-constant-conversion", 112 ] 113 114 ldflags = [ "-nostdlib" ] 115 116 libs = [ "//${target_out_dir}/libtest.a" ] 117} 118