1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14cmake_minimum_required(VERSION 3.13) 15 16project(hdt VERSION 1.0 LANGUAGES C CXX) 17 18# Library file compilation 19add_subdirectory(depend_libs/cmake) 20 21# COMPONENT CMAKE 22include("${CMAKE_CURRENT_SOURCE_DIR}/conf/comp.cmake") 23 24# PATH 25set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../../) 26set(CLANG_DIR ${ROOT_DIR}prebuilts/clang/host/linux-x86/clang-r353983c/) 27 28# COMPILE_OPTIONS 29set(CMAKE_CXX_COMPILER "${CLANG_DIR}/bin/clang++") 30set(CMAKE_C_COMPILER "${CLANG_DIR}/bin/clang") 31set(CMAKE_CXX_STANDARD_REQUIRED ON) 32set(CMAKE_CXX_STANDARD 17) 33set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") 34 35# INCLUDE_DIR 36add_compile_options(-include memory) 37include("${CMAKE_CURRENT_SOURCE_DIR}/conf/include.cmake") 38include_directories(${INCLUDE_DIRECTORIES}) 39 40 41# TEST_SOURCE_FILES 42aux_source_directory(${TEST_SRC_DIR}/src/ TEST_SRC) 43aux_source_directory(${TEST_SRC_DIR}/src/statemgr TEST_SRC) 44 45 46# TEST_CASE_FILES 47aux_source_directory(testcase/intell_voice_utils TEST_CASE) 48 49# STUB_FILE 50aux_source_directory(stub STUB_FILE) 51 52# TARGET 53add_executable(intellvoicetest ${TEST_SRC} ${TEST_CASE} ${STUB_FILE} ${DEPEND_SRC}) 54 55add_dependencies(intellvoicetest hilog sec utilsbase) 56target_link_libraries(intellvoicetest hilog sec utilsbase) 57 58# MESSAGE 59get_target_property(COMPILE_FLAGS intellvoicetest COMPILE_OPTIONS) 60get_target_property(LINK_FLAGS intellvoicetest LINK_OPTIONS) 61message(STATUS "Compiler id: ${CMAKE_CXX_COMPILER_ID}") 62message(STATUS "Compile flags: ${COMPILE_FLAGS}") 63message(STATUS "Link flags: ${LINK_FLAGS}") 64message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")