| # 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. |
| |
| set(api gles/gles.api) |
| |
| |
| apic(${api} TEMPLATE ${APIC_API_PATH}/gles/templates/api_exports.cpp.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/gles/templates/api_imports.cpp.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/gles/templates/api_imports.h.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/gles/templates/api_spy.cpp.tmpl) |
| apic(${api} TEMPLATE api_spy.h.tmpl) |
| apic(${api} TEMPLATE api_types.h.tmpl) |
| |
| apic(${api} PATH windows TEMPLATE opengl32_exports.def.tmpl) |
| apic(${api} PATH windows TEMPLATE opengl32_resolve.cpp.tmpl) |
| apic(${api} PATH windows TEMPLATE opengl32_x64.asm.tmpl) |
| |
| apic(${api} PATH osx TEMPLATE opengl_framework_exports.cpp.tmpl) |
| |
| set(api vulkan/vulkan.api) |
| |
| apic(${api} TEMPLATE ${APIC_API_PATH}/vulkan/templates/api_exports.cpp.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/vulkan/templates/api_imports.cpp.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/vulkan/templates/api_imports.h.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/vulkan/templates/api_spy.cpp.tmpl) |
| apic(${api} TEMPLATE ${APIC_API_PATH}/vulkan/templates/vk_spy_helpers.cpp.tmpl) |
| apic(${api} TEMPLATE api_spy.h.tmpl) |
| apic(${api} TEMPLATE api_types.h.tmpl) |
| |
| glob(sources |
| PATH . ${PlatformSourcePath} |
| INCLUDE ".cpp$" |
| EXCLUDE "_test.cpp$" |
| ) |
| |
| if(NOT DISABLED_CXX) |
| add_library(gapii SHARED ${sources}) |
| target_link_libraries(gapii gapic) |
| |
| find_package(GL REQUIRED) |
| target_link_libraries(gapii GL::Lib) |
| |
| if(APPLE) |
| find_package(Cocoa REQUIRED) |
| target_link_libraries(gapii Cocoa::Lib) |
| endif() |
| |
| if(ANDROID) |
| get_filename_component(crazy "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/ndk/crazy_linker/src" ABSOLUTE) |
| target_sources(gapii PRIVATE |
| "${crazy}/crazy_linker_elf_view.cpp" |
| "${crazy}/crazy_linker_error.cpp" |
| "${crazy}/linker_phdr.cpp" |
| ) |
| target_include_directories(gapii PRIVATE "${crazy}") |
| endif() |
| install(TARGETS gapii EXPORT all DESTINATION bin) |
| endif() |