• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
28set(DEFINITIONS
29    ""
30)
31if (PANDA_TARGET_WINDOWS)
32    list(APPEND DEFINITIONS -DWINDOWS_PLATFORM)
33elseif (PANDA_TARGET_OHOS)
34    list(APPEND DEFINITIONS -DOHOS_PLATFORM)
35endif()
36
37panda_add_library(toolchain_websocket ${PANDA_DEFAULT_LIB_TYPE} ${SOURCES})
38panda_target_include_directories(toolchain_websocket SYSTEM PUBLIC
39    ${TOOLCHAIN_ROOT}/websocket
40    ${TOOLCHAIN_ROOT}
41    ${PANDA_THIRD_PARTY_SOURCES_DIR}/openssl/include/
42    ${PANDA_THIRD_PARTY_SOURCES_DIR}/utils_native/base/include/
43)
44panda_target_link_libraries(toolchain_websocket
45    c_secshared
46    crypto_shared
47)
48panda_target_compile_definitions(toolchain_websocket PRIVATE
49    NDEBUG
50    ${DEFINITIONS}
51)
52