forked from veldrid/veldrid-spirv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (34 loc) · 1.25 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required (VERSION 3.0)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(ext/SPIRV-Cross)
set(SHADERC_SKIP_TESTS ON)
set(SHADERC_SKIP_INSTALL ON)
add_subdirectory(ext/shaderc)
set(CMAKE_CXX_STANDARD 17)
include_directories(ext/SPIRV-Cross)
include_directories(ext/SPIRV-Cross/include)
include_directories(ext/shaderc/libshaderc/include/shaderc)
file(GLOB_RECURSE LIBVELDRID_SPIRV_SOURCES src/libveldrid-spirv/*.cpp src/libveldrid-spirv/*.hpp)
project(veldrid-spirv)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS")
set(LIBRARY_TYPE STATIC)
message( "Configured to build a static library." )
else()
set(LIBRARY_TYPE SHARED)
message( "Configured to build a shared library." )
endif()
add_library(veldrid-spirv ${LIBRARY_TYPE} ${LIBVELDRID_SPIRV_SOURCES})
target_link_libraries(veldrid-spirv
spirv-cross-core
spirv-cross-glsl
spirv-cross-reflect
spirv-cross-msl
spirv-cross-hlsl
shaderc
)
set_target_properties(veldrid-spirv PROPERTIES PREFIX "lib")
set_target_properties(veldrid-spirv PROPERTIES DEBUG_POSTFIX "")
set_target_properties(veldrid-spirv PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
if("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS")
shaderc_combine_static_lib(veldrid-spirv-combined veldrid-spirv)
endif()