blob: c9323d8b61a11efef70144ae452b4acae77d0f6a [file] [log] [blame]
# Copyright (C) 2016 The Android Open Source Project
#
# 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.
glob_all_dirs()
glob(sources
PATH . gl coder ${PlatformSourcePath}
INCLUDE ".cpp$"
EXCLUDE "_test.cpp$"
)
glob(test_sources
PATH .
INCLUDE "_test.cpp$"
)
foreach(abi ${ANDROID_ACTIVE_ABI_LIST})
add_cmake_step(${abi} gapic DEPENDS ${sources} ${android_files})
endforeach()
if(NOT DISABLED_CXX)
add_library(gapic ${sources})
if(ANDROID)
find_package(NDK REQUIRED)
find_package(Log REQUIRED)
find_package(STL REQUIRED)
target_link_libraries(gapic NDK::Lib Log::Lib STL::Lib)
endif()
if(LINUX)
find_package(DLOpen REQUIRED)
find_package(PThread REQUIRED)
find_package(RT REQUIRED)
find_package(X11 REQUIRED)
target_link_libraries(gapic DLOpen::Lib PThread::Lib RT::Lib X11::Lib)
endif()
if(WIN32)
find_package(Winsock REQUIRED)
target_link_libraries(gapic Winsock::Lib)
endif()
if(NOT ANDROID)
add_executable(gapic-tests ${test_sources})
use_gtest(gapic-tests)
target_link_libraries(gapic-tests gapic)
endif()
endif()