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
044113ab
Unverified
Commit
044113ab
authored
May 21, 2020
by
nihui
Committed by
GitHub
May 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an option to make Exceptions enabled (#2239)
* Add an option to make Exceptions enabled * /EHsc enable exceptions since vs2003
parent
2e0f0a05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
CMakeLists.txt
CMakeLists.txt
+11
-1
No files found.
CMakeLists.txt
View file @
044113ab
...
...
@@ -57,6 +57,7 @@ CMAKE_DEPENDENT_OPTION(ENABLE_HLSL
OFF
)
option
(
ENABLE_RTTI
"Enables RTTI"
OFF
)
option
(
ENABLE_EXCEPTIONS
"Enables Exceptions"
OFF
)
option
(
ENABLE_OPT
"Enables spirv-opt capability if present"
ON
)
option
(
ENABLE_PCH
"Enables Precompiled header"
ON
)
option
(
ENABLE_CTEST
"Enables testing"
ON
)
...
...
@@ -121,6 +122,9 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
if
(
NOT ENABLE_RTTI
)
add_compile_options
(
-fno-rtti
)
endif
()
if
(
NOT ENABLE_EXCEPTIONS
)
add_compile_options
(
-fno-exceptions
)
endif
()
if
(
NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS
"9.0.0"
)
add_compile_options
(
-Werror=deprecated-copy
)
endif
()
...
...
@@ -131,17 +135,23 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
if
(
NOT ENABLE_RTTI
)
add_compile_options
(
-fno-rtti
)
endif
()
if
(
NOT ENABLE_EXCEPTIONS
)
add_compile_options
(
-fno-exceptions
)
endif
()
elseif
(
MSVC
)
if
(
NOT ENABLE_RTTI
)
add_compile_options
(
/GR-
)
# Disable RTTI
endif
()
if
(
ENABLE_EXCEPTIONS
)
add_compile_options
(
/EHsc
)
# Enable Exceptions
endif
()
endif
()
if
(
ENABLE_GLSLANG_JS
)
if
(
MSVC
)
add_compile_options
(
/Os /GR-
)
else
()
add_compile_options
(
-Os -fno-exceptions
)
add_compile_options
(
-Os -fno-
rtti -fno-
exceptions
)
if
(
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
"Clang"
AND NOT MSVC
)
add_compile_options
(
-Wno-unused-parameter
)
add_compile_options
(
-Wno-unused-variable -Wno-unused-const-variable
)
...
...
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