1# Copyright 2020 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of 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, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15# Wrapper library including curl, wrappers for some methods and callbacks 16# The CURL_SAPI_CALLBACKS variable should contain the absolute paths of 17# all the files implementing the callbacks 18add_library(curl_wrapper_and_callbacks OBJECT 19 curl_wrapper.h 20 curl_wrapper.cc 21 "${CURL_SAPI_CALLBACKS}" 22) 23set_target_properties(curl_wrapper_and_callbacks 24 PROPERTIES LINKER_LANGUAGE C 25) 26 27# Flags needed to build curl statically 28set(CURL_HIDDEN_SYMBOLS OFF) 29set(BUILD_SHARED_LIBS OFF) 30 31# Link the wrapper to the original curl library (testing is disabled in curl) 32set(BUILD_TESTING OFF) 33add_subdirectory(curl) 34target_link_libraries(curl_wrapper_and_callbacks 35 CURL::libcurl 36 sapi::sapi 37) 38