1# Copyright (c) 2024 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.10) 15 16project(toolchain_websocket) 17 18set(SOURCES 19 ${TOOLCHAIN_ROOT}/common/log_wrapper.cpp 20 ${TOOLCHAIN_ROOT}/websocket/frame_builder.cpp 21 ${TOOLCHAIN_ROOT}/websocket/handshake_helper.cpp 22 ${TOOLCHAIN_ROOT}/websocket/http.cpp 23 ${TOOLCHAIN_ROOT}/websocket/network.cpp 24 ${TOOLCHAIN_ROOT}/websocket/websocket_base.cpp 25 ${TOOLCHAIN_ROOT}/websocket/server/websocket_server.cpp 26) 27 28if (PANDA_TARGET_WINDOWS) 29 list(APPEND SOURCES ${TOOLCHAIN_ROOT}/platform/windows/file.cpp) 30else() 31 list(APPEND SOURCES ${TOOLCHAIN_ROOT}/platform/unix/file.cpp) 32endif() 33 34set(DEFINITIONS 35 "" 36) 37if (PANDA_TARGET_WINDOWS) 38 list(APPEND DEFINITIONS -DWINDOWS_PLATFORM) 39elseif (PANDA_TARGET_OHOS) 40 list(APPEND DEFINITIONS -DOHOS_PLATFORM) 41endif() 42 43panda_add_library(toolchain_websocket ${PANDA_DEFAULT_LIB_TYPE} ${SOURCES}) 44panda_target_include_directories(toolchain_websocket SYSTEM PUBLIC 45 ${TOOLCHAIN_ROOT}/websocket 46 ${TOOLCHAIN_ROOT} 47 ${PANDA_THIRD_PARTY_SOURCES_DIR}/openssl/include/ 48 ${PANDA_THIRD_PARTY_SOURCES_DIR}/utils_native/base/include/ 49) 50panda_target_link_libraries(toolchain_websocket 51 c_secshared 52 crypto_shared 53) 54panda_target_compile_definitions(toolchain_websocket PRIVATE 55 NDEBUG 56 ${DEFINITIONS} 57) 58