|
| 1 | +# Copyright (c) 2024 Project CHIP Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# TODO: maybe delete this file as it seems useless as of 25/06 |
| 16 | +import("//build_overrides/build.gni") |
| 17 | +import("//build_overrides/pigweed.gni") |
| 18 | + |
| 19 | +import("${build_root}/toolchain/gcc_toolchain.gni") |
| 20 | + |
| 21 | +import("$dir_pigweed/targets/host/target_toolchains.gni") |
| 22 | + |
| 23 | +#import("$dir_pigweed/pw_toolchain/host_clang/toolchains.gni") |
| 24 | + |
| 25 | +gcc_toolchain("clang_pw_fuzz") { |
| 26 | + toolchain_args = { |
| 27 | + name = "clang_pw_fuzz" |
| 28 | + print("gcc_toolchain(clang_pw_fuzz)") |
| 29 | + |
| 30 | + # print("pw_toolchain_host_clang = $pw_toolchain_host_clang") |
| 31 | + # forward_variables_from(pw_toolchain_host_clang.fuzz, "*", [ "name" ]) |
| 32 | + |
| 33 | + # print( |
| 34 | + # "pw_target_toolchain_host.clang_fuzz = ${pw_target_toolchain_host.clang_fuzz}") |
| 35 | + forward_variables_from(pw_target_toolchain_host.clang_fuzz, "*", [ "name" ]) |
| 36 | + |
| 37 | + #This is needed to have the defaults passed from pw_target_toolchain_host.clang_fuzz, |
| 38 | + forward_variables_from(defaults, "*") |
| 39 | + |
| 40 | + #print("defaults = $defaults") |
| 41 | + print("pw_toolchain_FUZZING_ENABLED = ${pw_toolchain_FUZZING_ENABLED}") |
| 42 | + pw_unit_test_MAIN = "$dir_pw_fuzzer:fuzztest_main" |
| 43 | + pw_unit_test_BACKEND = "$dir_pw_fuzzer:gtest" |
| 44 | + |
| 45 | + # below three lines are needed by gcc_toolchain template |
| 46 | + current_os = host_os |
| 47 | + current_cpu = host_cpu |
| 48 | + is_clang = true |
| 49 | + |
| 50 | + # pw_toolchain_FUZZING_ENABLED = true |
| 51 | + treat_warnings_as_errors = false |
| 52 | + |
| 53 | + # dir_pw_third_party_abseil_cpp = "$dir_pigweed/third_party/abseil-cpp/src" |
| 54 | + # dir_pw_third_party_fuzztest = "$dir_pigweed/third_party/fuzztest" |
| 55 | + # dir_pw_third_party_googletest = "$dir_pigweed/third_party/googletest" |
| 56 | + # dir_pw_third_party_re2 = "$dir_pigweed/third_party/re2/src" |
| 57 | + |
| 58 | + #dir_pw_third_party_abseil_cpp = "$dir_pw_third_party/abseil-cpp/" |
| 59 | + |
| 60 | + dir_pw_third_party_abseil_cpp = "//third_party/abseil-cpp/src" |
| 61 | + dir_pw_third_party_fuzztest = "//third_party/fuzztest" |
| 62 | + dir_pw_third_party_googletest = "//third_party/googletest" |
| 63 | + dir_pw_third_party_re2 = "//third_party/re2/src" |
| 64 | + |
| 65 | + # use below if above dont work |
| 66 | + #dir_pw_third_party_abseil_cpp="//third_party/abseil-cpp" |
| 67 | + #dir_pw_third_party_re2 = "//third_party/re2" |
| 68 | + } |
| 69 | +} |
0 commit comments