Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
f4b2a4ab
Commit
f4b2a4ab
authored
Feb 16, 2016
by
Peter Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: always enable warnings without -Werror
Warnings are useful, let's enable them by default.
parent
a909eb6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
CMakeLists.txt
CMakeLists.txt
+7
-2
cmake/ExtractValidFlags.cmake
cmake/ExtractValidFlags.cmake
+1
-3
No files found.
CMakeLists.txt
View file @
f4b2a4ab
...
@@ -285,12 +285,17 @@ if(HAVE_EPOLL AND HAVE_TIMERFD_CREATE)
...
@@ -285,12 +285,17 @@ if(HAVE_EPOLL AND HAVE_TIMERFD_CREATE)
set
(
ENABLE_TINY_NGHTTPD 1
)
set
(
ENABLE_TINY_NGHTTPD 1
)
endif
()
endif
()
set
(
WARNCFLAGS
)
set
(
WARNCXXFLAGS
)
if
(
ENABLE_WERROR
)
if
(
ENABLE_WERROR
)
extract_valid_c_flags
(
WARNCFLAGS -Werror
)
extract_valid_c_flags
(
WARNCXXFLAGS -Werror
)
endif
()
if
(
NOT CMAKE_C_COMPILER_ID STREQUAL
"MSVC"
)
# For C compiler
# For C compiler
extract_valid_c_flags
(
WARNCFLAGS
extract_valid_c_flags
(
WARNCFLAGS
-Wall
-Wall
-Wextra
-Wextra
-Werror
-Wmissing-prototypes
-Wmissing-prototypes
-Wstrict-prototypes
-Wstrict-prototypes
-Wmissing-declarations
-Wmissing-declarations
...
@@ -338,11 +343,11 @@ if(ENABLE_WERROR)
...
@@ -338,11 +343,11 @@ if(ENABLE_WERROR)
extract_valid_cxx_flags
(
WARNCXXFLAGS
extract_valid_cxx_flags
(
WARNCXXFLAGS
# For C++ compiler
# For C++ compiler
-Wall
-Wall
-Werror
-Wformat-security
-Wformat-security
)
)
endif
()
endif
()
set
(
EXTRACFLAG
)
extract_valid_c_flags
(
EXTRACFLAG
extract_valid_c_flags
(
EXTRACFLAG
-fvisibility=hidden
-fvisibility=hidden
)
)
...
...
cmake/ExtractValidFlags.cmake
View file @
f4b2a4ab
# Convenience function that checks the availability
# Convenience function that checks the availability
# of certain C or C++ compiler flags and
returns the
valid ones.
# of certain C or C++ compiler flags and
appends
valid ones.
include
(
CheckCCompilerFlag
)
include
(
CheckCCompilerFlag
)
include
(
CheckCXXCompilerFlag
)
include
(
CheckCXXCompilerFlag
)
function
(
extract_valid_c_flags varname
)
function
(
extract_valid_c_flags varname
)
set
(
valid_flags
""
)
foreach
(
flag IN LISTS ARGN
)
foreach
(
flag IN LISTS ARGN
)
string
(
REGEX REPLACE
"[^a-zA-Z0-9_]+"
"_"
flag_var
${
flag
}
)
string
(
REGEX REPLACE
"[^a-zA-Z0-9_]+"
"_"
flag_var
${
flag
}
)
set
(
flag_var
"C_FLAG_
${
flag_var
}
"
)
set
(
flag_var
"C_FLAG_
${
flag_var
}
"
)
...
@@ -18,7 +17,6 @@ function(extract_valid_c_flags varname)
...
@@ -18,7 +17,6 @@ function(extract_valid_c_flags varname)
endfunction
()
endfunction
()
function
(
extract_valid_cxx_flags varname
)
function
(
extract_valid_cxx_flags varname
)
set
(
valid_flags
""
)
foreach
(
flag IN LISTS ARGN
)
foreach
(
flag IN LISTS ARGN
)
string
(
REGEX REPLACE
"[^a-zA-Z0-9_]+"
"_"
flag_var
${
flag
}
)
string
(
REGEX REPLACE
"[^a-zA-Z0-9_]+"
"_"
flag_var
${
flag
}
)
set
(
flag_var
"CXX_FLAG_
${
flag_var
}
"
)
set
(
flag_var
"CXX_FLAG_
${
flag_var
}
"
)
...
...
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