| 1 |
# Copyright (c) 2015-2016 The Khronos Group Inc. |
| 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 |
# http://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 |
cmake_minimum_required(VERSION 2.8.12) |
| 16 |
if (POLICY CMP0048) |
| 17 |
cmake_policy(SET CMP0048 NEW) |
| 18 |
endif() |
| 19 |
if (POLICY CMP0054) |
| 20 |
# Avoid dereferencing variables or interpret keywords that have been |
| 21 |
# quoted or bracketed. |
| 22 |
# https://cmake.org/cmake/help/v3.1/policy/CMP0054.html |
| 23 |
cmake_policy(SET CMP0054 NEW) |
| 24 |
endif() |
| 25 |
set_property(GLOBAL PROPERTY USE_FOLDERS ON) |
| 26 |
|
| 27 |
# Filament specific changes |
| 28 |
if (APPLE) |
| 29 |
set(CMAKE_MACOSX_RPATH ON) |
| 30 |
endif (APPLE) |
| 31 |
set(SPIRV_SKIP_EXECUTABLES_OPTION ON) |
| 32 |
set(SPIRV_SKIP_TESTS_OPTION ON) |
| 33 |
set(SKIP_SPIRV_TOOLS_INSTALL ON) |
| 34 |
# End Filament specific changes |
| 35 |
|
| 36 |
project(spirv-tools) |
| 37 |
# Filament specific changes |
| 38 |
# enable_testing() |
| 39 |
# End Filament specific changes |
| 40 |
set(SPIRV_TOOLS "SPIRV-Tools") |
| 41 |
|
| 42 |
include(GNUInstallDirs) |
| 43 |
|
| 44 |
set(CMAKE_POSITION_INDEPENDENT_CODE ON) |
| 45 |
set(CMAKE_CXX_STANDARD 11) |
| 46 |
|
| 47 |
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON) |
| 48 |
|
| 49 |
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") |
| 50 |
add_definitions(-DSPIRV_LINUX) |
| 51 |
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS}) |
| 52 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten") |
| 53 |
add_definitions(-DSPIRV_EMSCRIPTEN) |
| 54 |
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") |
| 55 |
add_definitions(-DSPIRV_WINDOWS) |
| 56 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") |
| 57 |
add_definitions(-DSPIRV_WINDOWS) |
| 58 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") |
| 59 |
add_definitions(-DSPIRV_MAC) |
| 60 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS") |
| 61 |
add_definitions(-DSPIRV_IOS) |
| 62 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") |
| 63 |
add_definitions(-DSPIRV_ANDROID) |
| 64 |
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS}) |
| 65 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") |
| 66 |
add_definitions(-DSPIRV_FREEBSD) |
| 67 |
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") |
| 68 |
add_definitions(-DSPIRV_FUCHSIA) |
| 69 |
else() |
| 70 |
message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!") |
| 71 |
endif() |
| 72 |
|
| 73 |
if (${SPIRV_TIMER_ENABLED}) |
| 74 |
add_definitions(-DSPIRV_TIMER_ENABLED) |
| 75 |
endif() |
| 76 |
|
| 77 |
if ("${CMAKE_BUILD_TYPE}" STREQUAL "") |
| 78 |
message(STATUS "No build type selected, default to Debug") |
| 79 |
set(CMAKE_BUILD_TYPE "Debug") |
| 80 |
endif() |
| 81 |
|
| 82 |
# Filament specific changes |
| 83 |
# option(SKIP_SPIRV_TOOLS_INSTALL "Skip installation" ${SKIP_SPIRV_TOOLS_INSTALL}) |
| 84 |
# End Filament specific changes |
| 85 |
if(NOT ${SKIP_SPIRV_TOOLS_INSTALL}) |
| 86 |
set(ENABLE_SPIRV_TOOLS_INSTALL ON) |
| 87 |
endif() |
| 88 |
|
| 89 |
option(SPIRV_BUILD_COMPRESSION "Build SPIR-V compressing codec" OFF) |
| 90 |
if(SPIRV_BUILD_COMPRESSION) |
| 91 |
message(FATAL_ERROR "SPIR-V compression codec has been removed from SPIR-V tools. " |
| 92 |
"Please remove SPIRV_BUILD_COMPRESSION from your build options.") |
| 93 |
endif(SPIRV_BUILD_COMPRESSION) |
| 94 |
|
| 95 |
option(SPIRV_BUILD_FUZZER "Build spirv-fuzz" OFF) |
| 96 |
|
| •97 |
option(SPIRV_WERROR "Enable error on warning" OFF) |
| 98 |
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))) |
| 99 |
set(COMPILER_IS_LIKE_GNU TRUE) |
| 100 |
endif() |
| 101 |
if(${COMPILER_IS_LIKE_GNU}) |
| 102 |
set(SPIRV_WARNINGS -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers) |
| 103 |
|
| 104 |
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |
| 105 |
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wno-self-assign) |
| 106 |
endif() |
| 107 |
|
| 108 |
option(SPIRV_WARN_EVERYTHING "Enable -Weverything" ${SPIRV_WARN_EVERYTHING}) |
| 109 |
if(${SPIRV_WARN_EVERYTHING}) |
| 110 |
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
| 111 |
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} |
| 112 |
-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded) |
| 113 |
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 114 |
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wpedantic -pedantic-errors) |
| 115 |
else() |
| 116 |
message(STATUS "Unknown compiler ${CMAKE_CXX_COMPILER_ID}, " |
| 117 |
"so SPIRV_WARN_EVERYTHING has no effect") |
| 118 |
endif() |
| 119 |
endif() |
| 120 |
|
| 121 |
if(${SPIRV_WERROR}) |
| 122 |
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror) |
| 123 |
endif() |
| 124 |
elseif(MSVC) |
| 125 |
set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800) |
| 126 |
|
| 127 |
if(${SPIRV_WERROR}) |
| 128 |
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX) |
| 129 |
endif() |
| 130 |
endif() |
| 131 |
|
| 132 |
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/) |
| 133 |
|
| 134 |
option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON) |
| 135 |
if(${SPIRV_COLOR_TERMINAL}) |
| 136 |
add_definitions(-DSPIRV_COLOR_TERMINAL) |
| 137 |
endif() |
| 138 |
|
| 139 |
option(SPIRV_LOG_DEBUG "Enable excessive debug output" OFF) |
| 140 |
if(${SPIRV_LOG_DEBUG}) |
| 141 |
add_definitions(-DSPIRV_LOG_DEBUG) |
| 142 |
endif() |
| 143 |
|
| 144 |
if (DEFINED SPIRV_TOOLS_EXTRA_DEFINITIONS) |
| 145 |
add_definitions(${SPIRV_TOOLS_EXTRA_DEFINITIONS}) |
| 146 |
endif() |
| 147 |
|
| 148 |
# Library build setting definitions: |
| 149 |
# |
| 150 |
# * SPIRV_TOOLS_BUILD_STATIC - ON or OFF - Defaults to ON. |
| 151 |
# If enabled the following targets will be created: |
| 152 |
# ${SPIRV_TOOLS}-static - STATIC library. |
| 153 |
# Has full public symbol visibility. |
| 154 |
# ${SPIRV_TOOLS}-shared - SHARED library. |
| 155 |
# Has default-hidden symbol visibility. |
| 156 |
# ${SPIRV_TOOLS} - will alias to one of above, based on BUILD_SHARED_LIBS. |
| 157 |
# If disabled the following targets will be created: |
| 158 |
# ${SPIRV_TOOLS} - either STATIC or SHARED based on SPIRV_TOOLS_LIBRARY_TYPE. |
| 159 |
# Has full public symbol visibility. |
| 160 |
# ${SPIRV_TOOLS}-shared - SHARED library. |
| 161 |
# Has default-hidden symbol visibility. |
| 162 |
# |
| 163 |
# * SPIRV_TOOLS_LIBRARY_TYPE - SHARED or STATIC. |
| 164 |
# Specifies the library type used for building SPIRV-Tools libraries. |
| 165 |
# Defaults to SHARED when BUILD_SHARED_LIBS=1, otherwise STATIC. |
| 166 |
# |
| 167 |
# * SPIRV_TOOLS_FULL_VISIBILITY - "${SPIRV_TOOLS}-static" or "${SPIRV_TOOLS}" |
| 168 |
# Evaluates to the SPIRV_TOOLS target library name that has no hidden symbols. |
| 169 |
# This is used by internal targets for accessing symbols that are non-public. |
| 170 |
# Note this target provides no API stability guarantees. |
| 171 |
# |
| 172 |
# Ideally, all of these will go away - see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909. |
| 173 |
option(SPIRV_TOOLS_BUILD_STATIC "Build ${SPIRV_TOOLS}-static target. ${SPIRV_TOOLS} will alias to ${SPIRV_TOOLS}-static or ${SPIRV_TOOLS}-shared based on BUILD_SHARED_LIBS" ON) |
| 174 |
if(SPIRV_TOOLS_BUILD_STATIC) |
| 175 |
set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-static) |
| 176 |
set(SPIRV_TOOLS_LIBRARY_TYPE "STATIC") |
| 177 |
else(SPIRV_TOOLS_BUILD_STATIC) |
| 178 |
set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}) |
| 179 |
if (NOT DEFINED SPIRV_TOOLS_LIBRARY_TYPE) |
| 180 |
if(BUILD_SHARED_LIBS) |
| 181 |
set(SPIRV_TOOLS_LIBRARY_TYPE "SHARED") |
| 182 |
else() |
| 183 |
set(SPIRV_TOOLS_LIBRARY_TYPE "STATIC") |
| 184 |
endif() |
| 185 |
endif() |
| 186 |
endif(SPIRV_TOOLS_BUILD_STATIC) |
| 187 |
|
| 188 |
function(spvtools_default_compile_options TARGET) |
| 189 |
target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS}) |
| 190 |
|
| 191 |
if (${COMPILER_IS_LIKE_GNU}) |
| 192 |
target_compile_options(${TARGET} PRIVATE |
| 193 |
-std=c++11 -fno-exceptions -fno-rtti) |
| 194 |
target_compile_options(${TARGET} PRIVATE |
| 195 |
-Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion |
| 196 |
-Wno-sign-conversion) |
| 197 |
# For good call stacks in profiles, keep the frame pointers. |
| 198 |
if(NOT "${SPIRV_PERF}" STREQUAL "") |
| 199 |
target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer) |
| 200 |
endif() |
| 201 |
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
| 202 |
set(SPIRV_USE_SANITIZER "" CACHE STRING |
| 203 |
"Use the clang sanitizer [address|memory|thread|...]") |
| 204 |
if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "") |
| 205 |
target_compile_options(${TARGET} PRIVATE |
| 206 |
-fsanitize=${SPIRV_USE_SANITIZER}) |
| 207 |
set_target_properties(${TARGET} PROPERTIES |
| 208 |
LINK_FLAGS -fsanitize=${SPIRV_USE_SANITIZER}) |
| 209 |
endif() |
| 210 |
target_compile_options(${TARGET} PRIVATE |
| 211 |
-ftemplate-depth=1024) |
| 212 |
else() |
| 213 |
target_compile_options(${TARGET} PRIVATE |
| 214 |
-Wno-missing-field-initializers) |
| 215 |
endif() |
| 216 |
endif() |
| 217 |
|
| 218 |
if (MSVC) |
| 219 |
# Specify /EHs for exception handling. This makes using SPIRV-Tools as |
| 220 |
# dependencies in other projects easier. |
| 221 |
target_compile_options(${TARGET} PRIVATE /EHs) |
| 222 |
endif() |
| 223 |
|
| 224 |
# For MinGW cross compile, statically link to the C++ runtime. |
| 225 |
# But it still depends on MSVCRT.dll. |
| 226 |
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
| 227 |
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") |
| 228 |
set_target_properties(${TARGET} PROPERTIES |
| 229 |
LINK_FLAGS -static -static-libgcc -static-libstdc++) |
| 230 |
endif() |
| 231 |
endif() |
| 232 |
endfunction() |
| 233 |
|
| 234 |
if(NOT COMMAND find_host_package) |
| 235 |
macro(find_host_package) |
| 236 |
find_package(${ARGN}) |
| 237 |
endmacro() |
| 238 |
endif() |
| 239 |
if(NOT COMMAND find_host_program) |
| 240 |
macro(find_host_program) |
| 241 |
find_program(${ARGN}) |
| 242 |
endmacro() |
| 243 |
endif() |
| 244 |
|
| 245 |
# Tests require Python3 |
| 246 |
if(CMAKE_VERSION VERSION_LESS "3.12" OR ${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
| 247 |
find_host_package(PythonInterp 3 REQUIRED) |
| 248 |
else() |
| 249 |
find_package(Python3 COMPONENTS Interpreter) |
| 250 |
endif() |
| 251 |
|
| 252 |
# Check for symbol exports on Linux. |
| 253 |
# At the moment, this check will fail on the OSX build machines for the Android NDK. |
| 254 |
# It appears they don't have objdump. |
| 255 |
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") |
| 256 |
macro(spvtools_check_symbol_exports TARGET) |
| 257 |
if (NOT "${SPIRV_SKIP_TESTS}") |
| 258 |
add_test(NAME spirv-tools-symbol-exports-${TARGET} |
| 259 |
COMMAND ${PYTHON_EXECUTABLE} |
| 260 |
${spirv-tools_SOURCE_DIR}/utils/check_symbol_exports.py "$<TARGET_FILE:${TARGET}>") |
| 261 |
endif() |
| 262 |
endmacro() |
| 263 |
else() |
| 264 |
macro(spvtools_check_symbol_exports TARGET) |
| 265 |
if (NOT "${SPIRV_SKIP_TESTS}") |
| 266 |
message("Skipping symbol exports test for ${TARGET}") |
| 267 |
endif() |
| 268 |
endmacro() |
| 269 |
endif() |
| 270 |
|
| 271 |
if(ENABLE_SPIRV_TOOLS_INSTALL) |
| 272 |
if(WIN32) |
| 273 |
macro(spvtools_config_package_dir TARGET PATH) |
| 274 |
set(${PATH} ${TARGET}/cmake) |
| 275 |
endmacro() |
| 276 |
else() |
| 277 |
macro(spvtools_config_package_dir TARGET PATH) |
| 278 |
set(${PATH} ${CMAKE_INSTALL_LIBDIR}/cmake/${TARGET}) |
| 279 |
endmacro() |
| 280 |
endif() |
| 281 |
|
| 282 |
macro(spvtools_generate_config_file TARGET) |
| 283 |
file(WRITE ${CMAKE_BINARY_DIR}/${TARGET}Config.cmake |
| 284 |
"include(CMakeFindDependencyMacro)\n" |
| 285 |
"find_dependency(${SPIRV_TOOLS})\n" |
| 286 |
"include(\${CMAKE_CURRENT_LIST_DIR}/${TARGET}Targets.cmake)\n" |
| 287 |
"set(${TARGET}_LIBRARIES ${TARGET})\n" |
| 288 |
"get_target_property(${TARGET}_INCLUDE_DIRS ${TARGET} INTERFACE_INCLUDE_DIRECTORIES)\n") |
| 289 |
endmacro() |
| 290 |
endif() |
| 291 |
|
| 292 |
# Defaults to OFF if the user didn't set it. |
| 293 |
# Filament specific changes |
| 294 |
option(SPIRV_SKIP_EXECUTABLES |
| 295 |
"Skip building the executable and tests along with the library" |
| 296 |
${SPIRV_SKIP_EXECUTABLES_OPTION}) |
| 297 |
option(SPIRV_SKIP_TESTS |
| 298 |
"Skip building tests along with the library" ${SPIRV_SKIP_TESTS_OPTION}) |
| 299 |
# End Filament specific changes |
| 300 |
if ("${SPIRV_SKIP_EXECUTABLES}") |
| 301 |
set(SPIRV_SKIP_TESTS ON) |
| 302 |
endif() |
| 303 |
|
| 304 |
# Defaults to ON. The checks can be time consuming. |
| 305 |
# Turn off if they take too long. |
| 306 |
option(SPIRV_CHECK_CONTEXT "In a debug build, check if the IR context is in a valid state." ON) |
| 307 |
if (${SPIRV_CHECK_CONTEXT}) |
| 308 |
add_definitions(-DSPIRV_CHECK_CONTEXT) |
| 309 |
endif() |
| 310 |
|
| 311 |
# Precompiled header macro. Parameters are source file list and filename for pch cpp file. |
| 312 |
macro(spvtools_pch SRCS PCHPREFIX) |
| 313 |
if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio" AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |
| 314 |
set(PCH_NAME "$(IntDir)\\${PCHPREFIX}.pch") |
| 315 |
# make source files use/depend on PCH_NAME |
| 316 |
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yu${PCHPREFIX}.h /FI${PCHPREFIX}.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}") |
| 317 |
# make PCHPREFIX.cpp file compile and generate PCH_NAME |
| 318 |
set_source_files_properties("${PCHPREFIX}.cpp" PROPERTIES COMPILE_FLAGS "/Yc${PCHPREFIX}.h /Fp${PCH_NAME} /Zm300" OBJECT_OUTPUTS "${PCH_NAME}") |
| 319 |
list(APPEND ${SRCS} "${PCHPREFIX}.cpp") |
| 320 |
endif() |
| 321 |
endmacro(spvtools_pch) |
| 322 |
|
| 323 |
add_subdirectory(external) |
| 324 |
|
| 325 |
# Warning about extra semi-colons. |
| 326 |
# |
| 327 |
# This is not supported on all compilers/versions. so enabling only |
| 328 |
# for clang, since that works for all versions that our bots run. |
| 329 |
# |
| 330 |
# This is intentionally done after adding the external subdirectory, |
| 331 |
# so we don't enforce this flag on our dependencies, some of which do |
| 332 |
# not pass it. |
| 333 |
# |
| 334 |
# If the minimum version of CMake supported is updated to 3.0 or |
| 335 |
# later, then check_cxx_compiler_flag could be used instead. |
| 336 |
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") |
| 337 |
add_compile_options("-Wextra-semi") |
| 338 |
endif() |
| 339 |
|
| 340 |
add_subdirectory(source) |
| 341 |
add_subdirectory(tools) |
| 342 |
|
| 343 |
# Filament specific changes |
| 344 |
#add_subdirectory(test) |
| 345 |
#add_subdirectory(examples) |
| 346 |
# End Filament specific changes |
| 347 |
|
| 348 |
if(ENABLE_SPIRV_TOOLS_INSTALL) |
| 349 |
install( |
| 350 |
FILES |
| 351 |
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.h |
| 352 |
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.hpp |
| 353 |
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/optimizer.hpp |
| 354 |
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/linker.hpp |
| 355 |
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/instrument.hpp |
| 356 |
DESTINATION |
| 357 |
${CMAKE_INSTALL_INCLUDEDIR}/spirv-tools/) |
| 358 |
endif(ENABLE_SPIRV_TOOLS_INSTALL) |
| 359 |
|
| 360 |
if (NOT "${SPIRV_SKIP_TESTS}") |
| 361 |
add_test(NAME spirv-tools-copyrights |
| 362 |
COMMAND ${PYTHON_EXECUTABLE} utils/check_copyright.py |
| 363 |
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
| 364 |
endif() |
| 365 |
|
| 366 |
set(SPIRV_LIBRARIES "-lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link") |
| 367 |
set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared") |
| 368 |
|
| 369 |
# Build pkg-config file |
| 370 |
# Use a first-class target so it's regenerated when relevant files are updated. |
| 371 |
# Filament specific changes |
| 372 |
# add_custom_target(spirv-tools-pkg-config ALL |
| 373 |
# COMMAND ${CMAKE_COMMAND} |
| 374 |
# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES |
| 375 |
# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools.pc.in |
| 376 |
# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc |
| 377 |
# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} |
| 378 |
# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} |
| 379 |
# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} |
| 380 |
# -DSPIRV_LIBRARIES=${SPIRV_LIBRARIES} |
| 381 |
# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake |
| 382 |
# DEPENDS "CHANGES" "cmake/SPIRV-Tools.pc.in" "cmake/write_pkg_config.cmake") |
| 383 |
# add_custom_target(spirv-tools-shared-pkg-config ALL |
| 384 |
# COMMAND ${CMAKE_COMMAND} |
| 385 |
# -DCHANGES_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CHANGES |
| 386 |
# -DTEMPLATE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/SPIRV-Tools-shared.pc.in |
| 387 |
# -DOUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc |
| 388 |
# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} |
| 389 |
# -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} |
| 390 |
# -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR} |
| 391 |
# -DSPIRV_SHARED_LIBRARIES=${SPIRV_SHARED_LIBRARIES} |
| 392 |
# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake |
| 393 |
# DEPENDS "CHANGES" "cmake/SPIRV-Tools-shared.pc.in" "cmake/write_pkg_config.cmake") |
| 394 |
# End Filament specific changes |
| 395 |
|
| 396 |
# Install pkg-config file |
| 397 |
if (ENABLE_SPIRV_TOOLS_INSTALL) |
| 398 |
install( |
| 399 |
FILES |
| 400 |
${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc |
| 401 |
${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc |
| 402 |
DESTINATION |
| 403 |
${CMAKE_INSTALL_LIBDIR}/pkgconfig) |
| 404 |
endif() |