-
Notifications
You must be signed in to change notification settings - Fork 123
/
CMakeLists.txt
64 lines (58 loc) · 1.82 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
cmake_minimum_required(VERSION 2.8)
project(HLSLcc)
option(HLSLCC_LIBRARY_SHARED "Build shared library instead of static." ON)
file(GLOB HLSLCC_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
set(HLSLCC_SRC
src/ControlFlowGraph.cpp
src/ControlFlowGraphUtils.cpp
src/DataTypeAnalysis.cpp
src/Declaration.cpp
src/decode.cpp
src/HLSLcc.cpp
src/HLSLccToolkit.cpp
src/HLSLCrossCompilerContext.cpp
src/Instruction.cpp
src/LoopTransform.cpp
src/Operand.cpp
src/reflect.cpp
src/Shader.cpp
src/ShaderInfo.cpp
src/toGLSL.cpp
src/toGLSLDeclaration.cpp
src/toGLSLInstruction.cpp
src/toGLSLOperand.cpp
src/toMetal.cpp
src/toMetalDeclaration.cpp
src/toMetalInstruction.cpp
src/toMetalOperand.cpp
src/UseDefineChains.cpp
src/cbstring/bsafe.c
src/cbstring/bstraux.c
src/cbstring/bstrlib.c)
if(HLSLCC_LIBRARY_SHARED)
add_library(hlslcc SHARED ${HLSLCC_SRC})
else(HLSLCC_LIBRARY_SHARED)
add_library(hlslcc STATIC ${HLSLCC_SRC})
endif(HLSLCC_LIBRARY_SHARED)
target_include_directories(hlslcc
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/cbstring>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/internal_includes>)
set_target_properties(hlslcc PROPERTIES
"CXX_STANDARD" "11"
"CXX_STANDARD_REQUIRED" "ON"
"PUBLIC_HEADERS" "${HLSLCC_HDRS}")
install(TARGETS hlslcc
EXPORT hlslccConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include/hlslcc)
install(FILES ${HLSLCC_HDRS} DESTINATION include/hlslcc)
install(EXPORT hlslccConfig DESTINATION share/hlslcc/cmake)
export(TARGETS hlslcc FILE hlslccConfig.cmake)