2020-01-17 21:05:03 +08:00
|
|
|
# Copyright 2019 Google LLC
|
2019-05-06 20:03:29 +08:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
# sandboxed_api/util:status_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(_sapi_util_status_pb_cc _sapi_util_status_pb_h
|
2019-05-06 20:03:29 +08:00
|
|
|
status.proto
|
|
|
|
)
|
|
|
|
add_library(sapi_util_status_proto STATIC
|
|
|
|
${_sapi_util_status_pb_cc}
|
|
|
|
${_sapi_util_status_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sapi::status_proto ALIAS sapi_util_status_proto)
|
2019-07-26 20:50:45 +08:00
|
|
|
target_link_libraries(sapi_util_status_proto
|
|
|
|
PRIVATE sapi::base
|
|
|
|
PUBLIC protobuf::libprotobuf
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/util:status
|
|
|
|
add_library(sapi_util_status STATIC
|
|
|
|
status.cc
|
|
|
|
status.h
|
|
|
|
status_macros.h
|
|
|
|
)
|
|
|
|
add_library(sapi::status ALIAS sapi_util_status)
|
2019-07-26 20:50:45 +08:00
|
|
|
target_link_libraries(sapi_util_status
|
|
|
|
PRIVATE absl::core_headers
|
2020-02-28 01:23:44 +08:00
|
|
|
absl::status
|
2019-07-26 20:50:45 +08:00
|
|
|
absl::strings
|
|
|
|
sapi::base
|
2020-02-28 01:23:44 +08:00
|
|
|
protobuf::libprotobuf
|
2019-07-26 20:50:45 +08:00
|
|
|
PUBLIC sapi::status_proto
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/util:statusor
|
|
|
|
add_library(sapi_util_statusor STATIC
|
|
|
|
statusor.h
|
|
|
|
)
|
|
|
|
add_library(sapi::statusor ALIAS sapi_util_statusor)
|
|
|
|
target_link_libraries(sapi_util_statusor PRIVATE
|
|
|
|
absl::core_headers
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
|
|
|
absl::statusor
|
|
|
|
sapi::base
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
2019-06-05 15:25:50 +08:00
|
|
|
# sandboxed_api/util:flag
|
|
|
|
add_library(sapi_util_flags STATIC
|
|
|
|
flag.h
|
|
|
|
)
|
|
|
|
add_library(sapi::flags ALIAS sapi_util_flags)
|
|
|
|
target_link_libraries(sapi_util_flags PUBLIC
|
2019-07-26 20:50:45 +08:00
|
|
|
gflags::gflags
|
2019-06-05 15:25:50 +08:00
|
|
|
)
|
|
|
|
|
2019-05-06 20:03:29 +08:00
|
|
|
# sandboxed_api/util:raw_logging
|
|
|
|
add_library(sapi_util_raw_logging STATIC
|
|
|
|
raw_logging.cc
|
|
|
|
raw_logging.h
|
|
|
|
)
|
|
|
|
add_library(sapi::raw_logging ALIAS sapi_util_raw_logging)
|
|
|
|
target_link_libraries(sapi_util_raw_logging PRIVATE
|
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
|
|
|
sandbox2::strerror
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
2019-07-15 19:42:39 +08:00
|
|
|
if(SAPI_ENABLE_TESTS)
|
|
|
|
# sandboxed_api/util:status_matchers
|
|
|
|
add_library(sapi_util_status_matchers STATIC
|
|
|
|
status_matchers.h
|
|
|
|
)
|
|
|
|
add_library(sapi::status_matchers ALIAS sapi_util_status_matchers)
|
2019-07-30 21:48:16 +08:00
|
|
|
target_link_libraries(sapi_util_status_matchers
|
|
|
|
PRIVATE absl::optional
|
|
|
|
gmock
|
|
|
|
gtest
|
|
|
|
sapi::base
|
2020-02-28 01:23:44 +08:00
|
|
|
PUBLIC absl::status
|
|
|
|
sapi::status
|
2019-07-15 19:42:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/util:status_test
|
|
|
|
add_executable(status_test
|
|
|
|
status_test.cc
|
|
|
|
)
|
|
|
|
target_link_libraries(status_test PRIVATE
|
2020-09-03 22:40:09 +08:00
|
|
|
sapi::status
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::type_traits
|
|
|
|
)
|
|
|
|
gtest_discover_tests(status_test)
|
2020-02-28 01:23:44 +08:00
|
|
|
|
2020-09-03 22:40:09 +08:00
|
|
|
# sandboxed_api/util:status_macros_test
|
|
|
|
add_executable(status_macros_test
|
|
|
|
status_macros_test.cc
|
2020-02-28 01:23:44 +08:00
|
|
|
)
|
2020-09-03 22:40:09 +08:00
|
|
|
target_link_libraries(status_macros_test PRIVATE
|
2020-02-28 01:23:44 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
|
|
|
absl::statusor
|
2020-02-28 01:23:44 +08:00
|
|
|
absl::type_traits
|
|
|
|
)
|
2020-09-03 22:40:09 +08:00
|
|
|
gtest_discover_tests(status_macros_test)
|
2019-07-15 19:42:39 +08:00
|
|
|
endif()
|