Ben Clayton | 1d21270 | 2020-07-01 15:43:36 +0100 | [diff] [blame] | 1 | # Copyright (C) 2020 The Khronos Group Inc. |
| 2 | # |
| 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions |
| 7 | # are met: |
| 8 | # |
| 9 | # Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # |
| 12 | # Redistributions in binary form must reproduce the above |
| 13 | # copyright notice, this list of conditions and the following |
| 14 | # disclaimer in the documentation and/or other materials provided |
| 15 | # with the distribution. |
| 16 | # |
Ben Clayton | cb261e3 | 2020-07-03 12:21:01 +0100 | [diff] [blame] | 17 | # Neither the name of The Khronos Group Inc. nor the names of its |
Ben Clayton | 1d21270 | 2020-07-01 15:43:36 +0100 | [diff] [blame] | 18 | # contributors may be used to endorse or promote products derived |
| 19 | # from this software without specific prior written permission. |
| 20 | # |
| 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 25 | # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 32 | # POSSIBILITY OF SUCH DAMAGE. |
John Kessenich | e01a9bc | 2016-03-12 20:11:22 -0700 | [diff] [blame] | 33 | |
Ben Clayton | dcad9ad | 2020-06-15 13:54:55 +0100 | [diff] [blame] | 34 | # The HLSL source is directly embedded into the glslang target when ENABLE_HLSL |
| 35 | # is set. |
Ben Clayton | f49820d | 2020-06-16 11:54:34 +0100 | [diff] [blame] | 36 | # This source now lives at: glslang/HLSL/ |
Ben Clayton | dcad9ad | 2020-06-15 13:54:55 +0100 | [diff] [blame] | 37 | # The HLSL target is now just a stub that exists for backwards compatibility for |
| 38 | # projects that referenced this target. |
John Kessenich | e01a9bc | 2016-03-12 20:11:22 -0700 | [diff] [blame] | 39 | |
Ben Clayton | dcad9ad | 2020-06-15 13:54:55 +0100 | [diff] [blame] | 40 | add_library(HLSL ${LIB_TYPE} "stub.cpp") |
Rohith Chandran | 6206091 | 2017-07-04 10:53:45 -0400 | [diff] [blame] | 41 | set_property(TARGET HLSL PROPERTY FOLDER hlsl) |
| 42 | set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON) |
John Kessenich | e01a9bc | 2016-03-12 20:11:22 -0700 | [diff] [blame] | 43 | |
Matthew Albrecht | 6c5f649 | 2018-03-30 09:32:03 -0500 | [diff] [blame] | 44 | if(WIN32 AND BUILD_SHARED_LIBS) |
| 45 | set_target_properties(HLSL PROPERTIES PREFIX "") |
| 46 | endif() |
| 47 | |
d3x0r | 9c6ea32 | 2017-07-04 05:59:34 -0700 | [diff] [blame] | 48 | if(ENABLE_GLSLANG_INSTALL) |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 49 | if(BUILD_SHARED_LIBS) |
James Rumble | ab6d149 | 2019-08-06 14:47:51 +0100 | [diff] [blame] | 50 | install(TARGETS HLSL EXPORT HLSLTargets |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 51 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} |
Matthew Albrecht | cda52d5 | 2019-05-23 19:01:57 -0500 | [diff] [blame] | 52 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
| 53 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 54 | else() |
James Rumble | ab6d149 | 2019-08-06 14:47:51 +0100 | [diff] [blame] | 55 | install(TARGETS HLSL EXPORT HLSLTargets |
Matthew Albrecht | 1199cf9 | 2018-04-26 09:04:25 -0500 | [diff] [blame] | 56 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
| 57 | endif() |
Arfrever Frehtes Taifersar Arahesis | bd69a4f | 2019-11-18 11:11:55 -0800 | [diff] [blame] | 58 | install(EXPORT HLSLTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) |
d3x0r | 9c6ea32 | 2017-07-04 05:59:34 -0700 | [diff] [blame] | 59 | endif(ENABLE_GLSLANG_INSTALL) |