2019-11-13 05:16:50 +00:00
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/CMakeLists.txt.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/CMakeLists.txt
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/CMakeLists.txt.dma 2019-11-02 02:51:21.000000000 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/CMakeLists.txt 2019-11-13 15:06:21.418739152 +1000
@@ -69,6 +69,13 @@ endmacro(glslang_pch)
2019-06-10 15:48:29 +00:00
project(glslang)
2019-11-13 05:16:50 +00:00
2019-06-10 15:48:29 +00:00
+# using pkg-config to configure include paths and link libraries
+include(FindPkgConfig)
+pkg_check_modules(SPIRV_TOOLS REQUIRED SPIRV-Tools>=2019.2.1)
+if(BUILD_SHARED_LIBS)
+ pkg_check_modules(SPIRV_TOOLS_SHARED REQUIRED SPIRV-Tools-shared>=2019.2.1)
+endif(BUILD_SHARED_LIBS)
2019-11-13 05:16:50 +00:00
+
if(ENABLE_CTEST)
include(CTest)
endif()
@@ -163,11 +170,7 @@ if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMA
add_subdirectory(External)
endif()
2019-06-10 15:48:29 +00:00
-if(NOT TARGET SPIRV-Tools-opt)
- set(ENABLE_OPT OFF)
-endif()
-
-if(ENABLE_OPT)
+if(${SPIRV_TOOLS_FOUND} EQUAL 1)
message(STATUS "optimizer enabled")
add_definitions(-DENABLE_OPT=1)
else()
2019-11-13 05:16:50 +00:00
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/External/CMakeLists.txt.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/External/CMakeLists.txt
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/External/CMakeLists.txt.dma 2019-11-02 02:51:21.000000000 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/External/CMakeLists.txt 2019-11-13 15:06:21.418739152 +1000
@@ -35,10 +35,3 @@ if(BUILD_TESTING)
endif()
endif()
-if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
- if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
- set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
- endif()
-endif()
-
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/CMakeLists.txt.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/CMakeLists.txt
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/CMakeLists.txt.dma 2019-11-13 15:06:05.678579864 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/CMakeLists.txt 2019-11-13 15:07:16.046291974 +1000
@@ -76,6 +76,7 @@ set(HEADERS
MachineIndependent/preprocessor/PpContext.h
MachineIndependent/preprocessor/PpTokens.h)
+set(VERSION 7.11.3113)
glslang_pch(SOURCES MachineIndependent/pch.cpp)
add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
@@ -112,7 +113,9 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslang EXPORT glslangTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glslang.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)
if(ENABLE_GLSLANG_INSTALL)
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/glslang.pc.cmake.in.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/glslang.pc.cmake.in
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/glslang.pc.cmake.in.dma 2019-11-13 15:06:21.419739162 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/glslang/glslang.pc.cmake.in 2019-11-13 15:06:21.419739162 +1000
@@ -0,0 +1,11 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+ Name: @PROJECT_NAME@
+ Description: OpenGL and OpenGL ES shader front end and validator
+ Requires:
+ Version: @VERSION@
+ Libs: -L${libdir} -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper
+ Cflags: -I${includedir}
\ No newline at end of file
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/CMakeLists.txt.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/CMakeLists.txt
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/CMakeLists.txt.dma 2019-11-13 15:06:05.678579864 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/CMakeLists.txt 2019-11-13 15:06:21.438739355 +1000
@@ -40,6 +40,10 @@ target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
2019-06-10 15:48:29 +00:00
+
+set(SPIRV_NAME spirv)
+set(SPIRV_VERSION 1.3)
+
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
2019-11-13 05:16:50 +00:00
@@ -53,15 +57,21 @@ if(WIN32 AND BUILD_SHARED_LIBS)
2019-06-10 15:48:29 +00:00
endif()
endif()
+target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS})
+target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_CFLAGS_OTHER})
+target_link_libraries(SPIRV ${SPIRV_TOOLS_LIBRARIES})
+if(BUILD_SHARED_LIBS)
+ target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS})
+ target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_CFLAGS_OTHER})
+ target_link_libraries(SPIRV ${SPIRV_TOOLS_SHARED_LIBRARIES})
+endif(BUILD_SHARED_LIBS)
2019-11-13 05:16:50 +00:00
+
2019-06-10 15:48:29 +00:00
if(ENABLE_OPT)
target_include_directories(SPIRV
PRIVATE ${spirv-tools_SOURCE_DIR}/include
PRIVATE ${spirv-tools_SOURCE_DIR}/source
)
- target_link_libraries(SPIRV glslang SPIRV-Tools-opt)
2019-11-13 05:16:50 +00:00
- target_include_directories(SPIRV PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
2019-06-10 15:48:29 +00:00
+ target_link_libraries(SPIRV glslang)
else()
target_link_libraries(SPIRV glslang)
endif(ENABLE_OPT)
2019-11-13 05:16:50 +00:00
@@ -94,5 +104,8 @@ if(ENABLE_GLSLANG_INSTALL)
install(EXPORT SPVRemapperTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
2019-06-10 15:48:29 +00:00
+ # spirv.pc Configuration
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/spirv.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc @ONLY)
2019-11-13 05:16:50 +00:00
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)
2019-06-10 15:48:29 +00:00
endif(ENABLE_GLSLANG_INSTALL)
2019-11-13 05:16:50 +00:00
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/spirv.pc.cmake.in.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/spirv.pc.cmake.in
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/spirv.pc.cmake.in.dma 2019-11-13 15:06:21.438739355 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/spirv.pc.cmake.in 2019-11-13 15:06:21.438739355 +1000
2019-06-10 15:48:29 +00:00
@@ -0,0 +1,11 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+ Name: @SPIRV_NAME@
+ Description: SPIR-V is a binary intermediate language for representing graphical-shader stages and compute kernels for multiple Khronos APIs, including OpenCL, OpenGL, and Vulkan
+ Requires:
+ Version: @SPIRV_VERSION@
+ Libs: -L${libdir} -lSPIRV
+ Cflags: -I${includedir}
\ No newline at end of file
2019-11-13 05:16:50 +00:00
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/SpvTools.cpp.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/SpvTools.cpp
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/SpvTools.cpp.dma 2019-11-02 02:51:21.000000000 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/SPIRV/SpvTools.cpp 2019-11-13 15:06:21.438739355 +1000
@@ -43,8 +43,8 @@
#include <iostream>
#include "SpvTools.h"
-#include "spirv-tools/optimizer.hpp"
-#include "spirv-tools/libspirv.h"
+#include <spirv-tools/optimizer.hpp>
+#include <spirv-tools/libspirv.h>
namespace glslang {
diff -up glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/StandAlone/CMakeLists.txt.dma glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/StandAlone/CMakeLists.txt
--- glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/StandAlone/CMakeLists.txt.dma 2019-11-13 15:06:05.678579864 +1000
+++ glslang-7f77b2e8669ae06acbee9c9867be8b13e4054f9c/StandAlone/CMakeLists.txt 2019-11-13 15:06:21.439739365 +1000
@@ -24,6 +24,14 @@ set(LIBRARIES
2019-06-10 15:48:29 +00:00
SPVRemapper
glslang-default-resource-limits)
+if(BUILD_SHARED_LIBS)
+ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_SHARED_LIBRARIES})
+ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS})
+else()
+ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_LIBRARIES})
+ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS})
+endif(BUILD_SHARED_LIBS)
+
if(WIN32)
set(LIBRARIES ${LIBRARIES} psapi)
elseif(UNIX)
2019-11-13 05:16:50 +00:00
@@ -34,9 +42,6 @@ endif(WIN32)
2019-06-10 15:48:29 +00:00
target_link_libraries(glslangValidator ${LIBRARIES})
target_link_libraries(spirv-remap ${LIBRARIES})
2019-11-13 05:16:50 +00:00
-target_include_directories(glslangValidator PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
2019-06-10 15:48:29 +00:00
if(WIN32)
source_group("Source" FILES ${SOURCES})