1# Copyright 2024 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# 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, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15include($ENV{PW_ROOT}/pw_build/pigweed.cmake) 16include($ENV{PW_ROOT}/third_party/emboss/emboss.cmake) 17 18# Hardcoding overrides to use pw_assert. This could potentially be done in a 19# more clever way. 20pw_add_library(pw_third_party.emboss.config_assert INTERFACE 21 PUBLIC_DEPS 22 pw_assert.assert 23 PUBLIC_DEFINES 24 EMBOSS_CHECK=PW_DASSERT 25 EMBOSS_CHECK_ABORTS 26 EMBOSS_DCHECK=PW_DASSERT 27 EMBOSS_DCHECK_ABORTS 28 PUBLIC_COMPILE_OPTIONS 29 -include pw_assert/assert.h 30) 31 32set(dir_pw_third_party_emboss "" CACHE PATH "Path to the emboss installation.") 33 34if("${dir_pw_third_party_emboss}" STREQUAL "") 35 pw_add_error_target(pw_third_party.emboss 36 MESSAGE 37 "Attempted to use emboss without configuring it, see " 38 "pigweed.dev/third_party/emboss/" 39 ) 40 return() 41endif() 42 43pw_add_library(pw_third_party.emboss.cpp_utils INTERFACE 44 HEADERS 45 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_arithmetic.h 46 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_arithmetic_all_known_generated.h 47 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_arithmetic_maximum_operation_generated.h 48 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_array_view.h 49 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_bit_util.h 50 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_constant_view.h 51 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_cpp_types.h 52 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_cpp_util.h 53 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_defines.h 54 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_enum_view.h 55 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_maybe.h 56 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_memory_util.h 57 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_prelude.h 58 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_text_util.h 59 ${dir_pw_third_party_emboss}/runtime/cpp/emboss_view_parameters.h 60 PUBLIC_INCLUDES 61 ${dir_pw_third_party_emboss} 62 PUBLIC_DEPS 63 pw_third_party.emboss.config_assert 64) 65