# pylint:disable=I0011,W0401,W0614,C0103,E0602
############################################################################
# Copyright 2017 Intel Corporation
#
# 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.
############################################################################
"""Build confioguration for include-only common

Needed to avoid linking to avoid listing ipp in dependencies when only
depending on headers. Eventually should unify this into single header.

"""
Import('*')
env.PartName('tinycommon')

include_files = Pattern(src_dir='.',
                        includes=['*.h'],
                        recursive=False).files()

install_files = Pattern(src_dir='.',
                        includes=[
                            '*.h',
                            '*.c',
                            '*-test.cc',
                            '*-testhelper.cc',
                            '*.parts'
                            'Makefile'],
                        recursive=True)

if 'install_package' in env['MODE']:
    env.InstallTopLevel(install_files,
                        sub_dir='epid/common')
else:
    env.SdkInclude(include_files, sub_dir='epid/common')
    if 'install_lib' in env['MODE']:
        env.InstallInclude(include_files, sub_dir='epid/common')
