blob: 62faa19576f3276d4f9af1e46f806349cef50d7e [file] [log] [blame]
Ben Clayton1d212702020-07-01 15:43:36 +01001# 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 Claytoncb261e32020-07-03 12:21:01 +010017# Neither the name of The Khronos Group Inc. nor the names of its
Ben Clayton1d212702020-07-01 15:43:36 +010018# 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 Kesseniche01a9bc2016-03-12 20:11:22 -070033
Ben Claytondcad9ad2020-06-15 13:54:55 +010034# The HLSL source is directly embedded into the glslang target when ENABLE_HLSL
35# is set.
Ben Claytonf49820d2020-06-16 11:54:34 +010036# This source now lives at: glslang/HLSL/
Ben Claytondcad9ad2020-06-15 13:54:55 +010037# The HLSL target is now just a stub that exists for backwards compatibility for
38# projects that referenced this target.
John Kesseniche01a9bc2016-03-12 20:11:22 -070039
Ben Claytondcad9ad2020-06-15 13:54:55 +010040add_library(HLSL ${LIB_TYPE} "stub.cpp")
Rohith Chandran62060912017-07-04 10:53:45 -040041set_property(TARGET HLSL PROPERTY FOLDER hlsl)
42set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON)
John Kesseniche01a9bc2016-03-12 20:11:22 -070043
Matthew Albrecht6c5f6492018-03-30 09:32:03 -050044if(WIN32 AND BUILD_SHARED_LIBS)
45 set_target_properties(HLSL PROPERTIES PREFIX "")
46endif()
47
d3x0r9c6ea322017-07-04 05:59:34 -070048if(ENABLE_GLSLANG_INSTALL)
Matthew Albrecht1199cf92018-04-26 09:04:25 -050049 if(BUILD_SHARED_LIBS)
James Rumbleab6d1492019-08-06 14:47:51 +010050 install(TARGETS HLSL EXPORT HLSLTargets
Matthew Albrecht1199cf92018-04-26 09:04:25 -050051 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Matthew Albrechtcda52d52019-05-23 19:01:57 -050052 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
53 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Matthew Albrecht1199cf92018-04-26 09:04:25 -050054 else()
James Rumbleab6d1492019-08-06 14:47:51 +010055 install(TARGETS HLSL EXPORT HLSLTargets
Matthew Albrecht1199cf92018-04-26 09:04:25 -050056 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
57 endif()
Arfrever Frehtes Taifersar Arahesisbd69a4f2019-11-18 11:11:55 -080058 install(EXPORT HLSLTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
d3x0r9c6ea322017-07-04 05:59:34 -070059endif(ENABLE_GLSLANG_INSTALL)