1# Copyright 2019 The Marl 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# https://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 15config_setting( 16 name = "linux_x86_64", 17 constraint_values = [ 18 "@platforms//os:linux", 19 "@platforms//cpu:x86_64", 20 ], 21) 22 23config_setting( 24 name = "windows", 25 constraint_values = ["@platforms//os:windows"], 26) 27 28cc_library( 29 name = "marl", 30 srcs = glob( 31 [ 32 "src/**/*.cpp", 33 "src/**/*.c", 34 "src/**/*.h", 35 ], 36 exclude = glob([ 37 "src/**/*_bench.cpp", 38 "src/**/*_test.cpp", 39 ]), 40 ) + select({ 41 ":windows": [], 42 "//conditions:default": glob(["src/**/*.S"]), 43 }), 44 hdrs = glob([ 45 "include/marl/**/*.h", 46 ]), 47 includes = [ 48 "include", 49 ], 50 linkopts = select({ 51 ":linux_x86_64": ["-pthread"], 52 "//conditions:default": [], 53 }), 54 visibility = [ 55 "//visibility:public", 56 ], 57) 58 59cc_test( 60 name = "tests", 61 srcs = glob([ 62 "src/**/*_test.cpp", 63 ]), 64 deps = [ 65 "//:marl", 66 "@googletest//:gtest", 67 ], 68) 69