CMake: Fold HLSL source into glslang
... and stub the HLSL target. Fixes the building of shared libraries. This breaks the cyclic dependency between the `glslang` and `hlsl` targets (by essentially removing the `hlsl` target). The `BUILD.gn` and `BUILD.bazel` build rules already pull the `HLSL` source into the `glslang` target. `Android.mk` is the only remaining build config that has a dedicated `HLSL` target, but this is explicity static and does not suffer the same link-time issues with the cyclic dependency (we may wish to stub this target too). Related issue: #1484, #2147 Related PR: #2267
This commit is contained in:
@@ -1,25 +1,10 @@
|
||||
set(SOURCES
|
||||
hlslAttributes.cpp
|
||||
hlslParseHelper.cpp
|
||||
hlslScanContext.cpp
|
||||
hlslOpMap.cpp
|
||||
hlslTokenStream.cpp
|
||||
hlslGrammar.cpp
|
||||
hlslParseables.cpp)
|
||||
|
||||
set(HEADERS
|
||||
hlslAttributes.h
|
||||
hlslParseHelper.h
|
||||
hlslTokens.h
|
||||
hlslScanContext.h
|
||||
hlslOpMap.h
|
||||
hlslTokenStream.h
|
||||
hlslGrammar.h
|
||||
hlslParseables.h)
|
||||
# The HLSL source is directly embedded into the glslang target when ENABLE_HLSL
|
||||
# is set.
|
||||
# The HLSL target is now just a stub that exists for backwards compatibility for
|
||||
# projects that referenced this target.
|
||||
|
||||
glslang_pch(SOURCES pch.cpp)
|
||||
|
||||
add_library(HLSL ${LIB_TYPE} ${SOURCES} ${HEADERS})
|
||||
add_library(HLSL ${LIB_TYPE} "stub.cpp")
|
||||
set_property(TARGET HLSL PROPERTY FOLDER hlsl)
|
||||
set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
@@ -27,10 +12,6 @@ if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
set_target_properties(HLSL PROPERTIES PREFIX "")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
source_group("Source" FILES ${SOURCES} ${HEADERS})
|
||||
endif(WIN32)
|
||||
|
||||
if(ENABLE_GLSLANG_INSTALL)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS HLSL EXPORT HLSLTargets
|
||||
|
||||
Reference in New Issue
Block a user