Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
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
lvzhengyang
git2
Commits
99afd41f
Unverified
Commit
99afd41f
authored
Jan 10, 2019
by
Edward Thomson
Committed by
GitHub
Jan 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4924 from lhchavez/werror
Make ENABLE_WERROR actually work
parents
3afa1ede
6af6170b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
cmake/Modules/AddCFlagIfSupported.cmake
+4
-2
cmake/Modules/EnableWarnings.cmake
+4
-7
No files found.
cmake/Modules/AddCFlagIfSupported.cmake
View file @
99afd41f
...
...
@@ -7,7 +7,8 @@ INCLUDE(CheckCCompilerFlag)
MACRO
(
ADD_C_FLAG _FLAG
)
STRING
(
TOUPPER
${
_FLAG
}
UPCASE
)
STRING
(
REGEX REPLACE
"^-"
""
UPCASE_PRETTY
${
UPCASE
}
)
STRING
(
REGEX REPLACE
"[-=]"
"_"
UPCASE_PRETTY
${
UPCASE
}
)
STRING
(
REGEX REPLACE
"^_+"
""
UPCASE_PRETTY
${
UPCASE_PRETTY
}
)
CHECK_C_COMPILER_FLAG
(
${
_FLAG
}
IS_
${
UPCASE_PRETTY
}
_SUPPORTED
)
IF
(
IS_
${
UPCASE_PRETTY
}
_SUPPORTED
)
...
...
@@ -19,7 +20,8 @@ ENDMACRO()
MACRO
(
ADD_C_FLAG_IF_SUPPORTED _FLAG
)
STRING
(
TOUPPER
${
_FLAG
}
UPCASE
)
STRING
(
REGEX REPLACE
"^-"
""
UPCASE_PRETTY
${
UPCASE
}
)
STRING
(
REGEX REPLACE
"[-=]"
"_"
UPCASE_PRETTY
${
UPCASE
}
)
STRING
(
REGEX REPLACE
"^_+"
""
UPCASE_PRETTY
${
UPCASE_PRETTY
}
)
CHECK_C_COMPILER_FLAG
(
${
_FLAG
}
IS_
${
UPCASE_PRETTY
}
_SUPPORTED
)
IF
(
IS_
${
UPCASE_PRETTY
}
_SUPPORTED
)
...
...
cmake/Modules/EnableWarnings.cmake
View file @
99afd41f
MACRO
(
ENABLE_WARNINGS flag
)
IF
(
ENABLE_WERROR
)
ADD_C_FLAG_IF_SUPPORTED
(
-Werror=
${
flag
}
)
ELSE
()
ADD_C_FLAG_IF_SUPPORTED
(
-W
${
flag
}
)
ENDIF
()
ENDMACRO
()
MACRO
(
DISABLE_WARNINGS flag
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-
${
flag
}
)
IF
(
ENABLE_WERROR
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-error=
${
flag
}
)
ENDIF
()
ENDMACRO
()
IF
(
ENABLE_WERROR
)
ADD_C_FLAG_IF_SUPPORTED
(
-Werror
)
ENDIF
()
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