John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 1 | set(SOURCES |
| 2 | GlslangToSpv.cpp |
Dejan Mircevski | 44bfb0d | 2016-01-18 16:18:37 -0500 | [diff] [blame] | 3 | InReadableOrder.cpp |
Lei Zhang | 17535f7 | 2016-05-04 15:55:59 -0400 | [diff] [blame] | 4 | Logger.cpp |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 5 | SpvBuilder.cpp |
John Kessenich | f04c51b | 2018-08-03 15:56:12 -0600 | [diff] [blame] | 6 | SpvPostProcess.cpp |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 7 | doc.cpp |
John Kessenich | 717c80a | 2018-08-23 15:17:10 -0600 | [diff] [blame] | 8 | SpvTools.cpp |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 9 | disassemble.cpp) |
| 10 | |
steve-lunarg | a845641 | 2016-08-17 16:18:06 -0600 | [diff] [blame] | 11 | set(SPVREMAP_SOURCES |
| 12 | SPVRemapper.cpp |
| 13 | doc.cpp) |
| 14 | |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 15 | set(HEADERS |
Rex Xu | c9e3c3c | 2016-07-29 16:00:05 +0800 | [diff] [blame] | 16 | bitutils.h |
John Kessenich | 5e4b124 | 2015-08-06 22:53:06 -0600 | [diff] [blame] | 17 | spirv.hpp |
| 18 | GLSL.std.450.h |
Rex Xu | 81f4c03 | 2018-03-02 17:42:37 +0800 | [diff] [blame] | 19 | GLSL.ext.EXT.h |
Rex Xu | 5159664 | 2016-09-21 18:56:12 +0800 | [diff] [blame] | 20 | GLSL.ext.KHR.h |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 21 | GlslangToSpv.h |
Rex Xu | c9e3c3c | 2016-07-29 16:00:05 +0800 | [diff] [blame] | 22 | hex_float.h |
Lei Zhang | 17535f7 | 2016-05-04 15:55:59 -0400 | [diff] [blame] | 23 | Logger.h |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 24 | SpvBuilder.h |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 25 | spvIR.h |
| 26 | doc.h |
John Kessenich | 717c80a | 2018-08-23 15:17:10 -0600 | [diff] [blame] | 27 | SpvTools.h |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 28 | disassemble.h) |
| 29 | |
steve-lunarg | a845641 | 2016-08-17 16:18:06 -0600 | [diff] [blame] | 30 | set(SPVREMAP_HEADERS |
| 31 | SPVRemapper.h |
| 32 | doc.h) |
| 33 | |
Rex Xu | 9d93a23 | 2016-05-05 12:30:44 +0800 | [diff] [blame] | 34 | if(ENABLE_AMD_EXTENSIONS) |
Rex Xu | c9e3c3c | 2016-07-29 16:00:05 +0800 | [diff] [blame] | 35 | list(APPEND |
| 36 | HEADERS |
| 37 | GLSL.ext.AMD.h) |
Rex Xu | 9d93a23 | 2016-05-05 12:30:44 +0800 | [diff] [blame] | 38 | endif(ENABLE_AMD_EXTENSIONS) |
| 39 | |
chaoc | 0ad6a4e | 2016-12-19 16:29:34 -0800 | [diff] [blame] | 40 | if(ENABLE_NV_EXTENSIONS) |
Rex Xu | c708f98 | 2017-01-24 14:24:21 +0800 | [diff] [blame] | 41 | list(APPEND |
| 42 | HEADERS |
| 43 | GLSL.ext.NV.h) |
chaoc | 0ad6a4e | 2016-12-19 16:29:34 -0800 | [diff] [blame] | 44 | endif(ENABLE_NV_EXTENSIONS) |
| 45 | |
Matthew Albrecht | 6c5f649 | 2018-03-30 09:32:03 -0500 | [diff] [blame] | 46 | add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) |
Rohith Chandran | 6206091 | 2017-07-04 10:53:45 -0400 | [diff] [blame] | 47 | set_property(TARGET SPIRV PROPERTY FOLDER glslang) |
| 48 | set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) |
Michael Maltese | a895f37 | 2017-05-02 16:16:06 -0700 | [diff] [blame] | 49 | target_include_directories(SPIRV PUBLIC ..) |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 50 | |
Matthew Albrecht | 857f25c | 2018-07-07 16:53:06 -0500 | [diff] [blame] | 51 | if (ENABLE_SPVREMAPPER) |
| 52 | add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) |
| 53 | set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) |
| 54 | set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) |
| 55 | endif() |
steve-lunarg | a845641 | 2016-08-17 16:18:06 -0600 | [diff] [blame] | 56 | |
Matthew Albrecht | 6c5f649 | 2018-03-30 09:32:03 -0500 | [diff] [blame] | 57 | if(WIN32 AND BUILD_SHARED_LIBS) |
| 58 | set_target_properties(SPIRV PROPERTIES PREFIX "") |
Matthew Albrecht | 857f25c | 2018-07-07 16:53:06 -0500 | [diff] [blame] | 59 | if (ENABLE_SPVREMAPPER) |
| 60 | set_target_properties(SPVRemapper PROPERTIES PREFIX "") |
| 61 | endif() |
Matthew Albrecht | 6c5f649 | 2018-03-30 09:32:03 -0500 | [diff] [blame] | 62 | endif() |
| 63 | |
GregF | fd34f0e | 2017-09-21 16:50:39 -0600 | [diff] [blame] | 64 | if(ENABLE_OPT) |
| 65 | target_include_directories(SPIRV |
| 66 | PRIVATE ${spirv-tools_SOURCE_DIR}/include |
| 67 | PRIVATE ${spirv-tools_SOURCE_DIR}/source |
| 68 | ) |
GregF | 4bede9e | 2018-03-26 17:20:10 -0600 | [diff] [blame] | 69 | target_link_libraries(SPIRV glslang SPIRV-Tools-opt) |
John Kessenich | e215622 | 2018-06-11 18:12:15 -0600 | [diff] [blame] | 70 | target_include_directories(SPIRV PUBLIC ../External) |
GregF | fd34f0e | 2017-09-21 16:50:39 -0600 | [diff] [blame] | 71 | else() |
| 72 | target_link_libraries(SPIRV glslang) |
| 73 | endif(ENABLE_OPT) |
| 74 | |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 75 | if(WIN32) |
| 76 | source_group("Source" FILES ${SOURCES} ${HEADERS}) |
steve-lunarg | a845641 | 2016-08-17 16:18:06 -0600 | [diff] [blame] | 77 | source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) |
John Kessenich | 140f3df | 2015-06-26 16:58:36 -0600 | [diff] [blame] | 78 | endif(WIN32) |
| 79 | |
d3x0r | 4e53d90 | 2017-07-04 06:00:35 -0700 | [diff] [blame] | 80 | if(ENABLE_GLSLANG_INSTALL) |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 81 | if(BUILD_SHARED_LIBS) |
Matthew Albrecht | 857f25c | 2018-07-07 16:53:06 -0500 | [diff] [blame] | 82 | if (ENABLE_SPVREMAPPER) |
| 83 | install(TARGETS SPVRemapper |
| 84 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 85 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 86 | endif() |
| 87 | install(TARGETS SPIRV |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 88 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
Matthew Albrecht | cda52d5 | 2019-05-23 19:01:57 -0500 | [diff] [blame^] | 89 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 90 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 91 | else() |
Matthew Albrecht | 857f25c | 2018-07-07 16:53:06 -0500 | [diff] [blame] | 92 | if (ENABLE_SPVREMAPPER) |
| 93 | install(TARGETS SPVRemapper |
| 94 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 95 | endif() |
| 96 | install(TARGETS SPIRV |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 97 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 98 | endif() |
Benjamin Saunders | 5a07453 | 2017-01-29 17:45:12 -0800 | [diff] [blame] | 99 | |
d3x0r | 4e53d90 | 2017-07-04 06:00:35 -0700 | [diff] [blame] | 100 | install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/) |
| 101 | endif(ENABLE_GLSLANG_INSTALL) |