Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
fd34f0e6
Commit
fd34f0e6
authored
Sep 21, 2017
by
GregF
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMake changes for HLSL legalization
Cmake now looks for External/spirv-tools. If found, it links in SPIRV-Tools-opt and SPVRemapper, and adds -DENABLE_OPT to build.
parent
5f77d864
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
CMakeLists.txt
CMakeLists.txt
+13
-0
CMakeLists.txt
External/CMakeLists.txt
+7
-0
CMakeLists.txt
SPIRV/CMakeLists.txt
+10
-1
No files found.
CMakeLists.txt
View file @
fd34f0e6
...
...
@@ -18,6 +18,8 @@ option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
option
(
ENABLE_HLSL
"Enables HLSL input support"
ON
)
option
(
ENABLE_OPT
"Enables spirv-opt capability if present"
ON
)
if
(
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32
)
set
(
CMAKE_INSTALL_PREFIX
"install"
CACHE STRING
"..."
FORCE
)
endif
()
...
...
@@ -83,6 +85,17 @@ endfunction(glslang_set_link_args)
# We depend on these for later projects, so they should come first.
add_subdirectory
(
External
)
if
(
NOT TARGET SPIRV-Tools-opt
)
set
(
ENABLE_OPT OFF
)
endif
()
if
(
ENABLE_OPT
)
message
(
STATUS
"optimizer enabled"
)
add_definitions
(
-DENABLE_OPT
)
elseif
(
ENABLE_HLSL
)
message
(
STATUS
"spirv-tools not linked - illegal SPIRV may be generated for HLSL"
)
endif
()
add_subdirectory
(
glslang
)
add_subdirectory
(
OGLCompilersDLL
)
if
(
ENABLE_GLSLANG_BINARIES
)
...
...
External/CMakeLists.txt
View file @
fd34f0e6
...
...
@@ -33,3 +33,10 @@ if(BUILD_TESTING)
"Google Mock was not found - tests based on that will not build"
)
endif
()
endif
()
if
(
ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt
)
if
(
IS_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
/spirv-tools
)
add_subdirectory
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/spirv-tools spirv-tools
)
endif
()
endif
()
SPIRV/CMakeLists.txt
View file @
fd34f0e6
...
...
@@ -42,12 +42,21 @@ endif(ENABLE_NV_EXTENSIONS)
add_library
(
SPIRV STATIC
${
SOURCES
}
${
HEADERS
}
)
set_property
(
TARGET SPIRV PROPERTY FOLDER glslang
)
set_property
(
TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON
)
target_link_libraries
(
SPIRV glslang
)
add_library
(
SPVRemapper STATIC
${
SPVREMAP_SOURCES
}
${
SPVREMAP_HEADERS
}
)
set_property
(
TARGET SPVRemapper PROPERTY FOLDER glslang
)
set_property
(
TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON
)
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 SPVRemapper
)
else
()
target_link_libraries
(
SPIRV glslang
)
endif
(
ENABLE_OPT
)
if
(
WIN32
)
source_group
(
"Source"
FILES
${
SOURCES
}
${
HEADERS
}
)
source_group
(
"Source"
FILES
${
SPVREMAP_SOURCES
}
${
SPVREMAP_HEADERS
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment