Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tim-Philipp Müller
Opus
Commits
edccc331
Commit
edccc331
authored
Jun 24, 2020
by
Marcus Asteborg
Committed by
Ralph Giles
Aug 08, 2020
Browse files
cmake - add warning flags for clang, gcc etc.
parent
982e83a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
cmake/OpusConfig.cmake
View file @
edccc331
...
...
@@ -78,3 +78,15 @@ else()
check_flag
(
STACK_PROTECTOR -fstack-protector-strong
)
check_flag
(
HIDDEN_VISIBILITY -fvisibility=hidden
)
endif
()
if
(
NOT MSVC
)
set
(
WARNING_LIST -Wall -W -Wstrict-prototypes -Wextra -Wcast-align -Wnested-externs -Wshadow
)
include
(
CheckCCompilerFlag
)
foreach
(
WARNING_FLAG
${
WARNING_LIST
}
)
string
(
REPLACE -
""
WARNING_VAR
${
WARNING_FLAG
}
)
check_c_compiler_flag
(
${
WARNING_FLAG
}
${
WARNING_VAR
}
_SUPPORTED
)
if
(
${
WARNING_VAR
}
_SUPPORTED
)
add_compile_options
(
${
WARNING_FLAG
}
)
endif
()
endforeach
()
endif
()
\ No newline at end of file
Write
Preview
Supports
Markdown
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