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
bcb7e92d
Commit
bcb7e92d
authored
Aug 25, 2017
by
Edward Thomson
Committed by
GitHub
Aug 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4279 from pks-t/pks/error-builds
-Werror builds for Travis
parents
0a93ded1
414a3384
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
.travis.yml
+2
-2
CMakeLists.txt
+26
-10
No files found.
.travis.yml
View file @
bcb7e92d
...
...
@@ -18,8 +18,8 @@ env:
-
secure
:
"
YnhS+8n6B+uoyaYfaJ3Lei7cSJqHDPiKJCKFIF2c87YDfmCvAJke8QtE7IzjYDs7UFkTCM4ox+ph2bERUrxZbSCyEkHdjIZpKuMJfYWja/jgMqTMxdyOH9y8JLFbZsSXDIXDwqBlC6vVyl1fP90M35wuWcNTs6tctfVWVofEFbs="
-
GITTEST_INVASIVE_FS_SIZE=1
matrix
:
-
OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release"
-
OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON"
-
OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release
-DENABLE_WERROR=ON
"
-
OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON
-DENABLE_WERROR=ON
"
dist
:
trusty
sudo
:
true
...
...
CMakeLists.txt
View file @
bcb7e92d
...
...
@@ -49,6 +49,7 @@ OPTION( VALGRIND "Configure build for valgrind" OFF )
OPTION
(
CURL
"Use curl for HTTP if available"
ON
)
OPTION
(
USE_EXT_HTTP_PARSER
"Use system HTTP_Parser if available"
ON
)
OPTION
(
DEBUG_POOL
"Enable debug pool allocator"
OFF
)
OPTION
(
ENABLE_WERROR
"Enable compilation with -Werror"
OFF
)
IF
(
${
CMAKE_SYSTEM_NAME
}
MATCHES
"Darwin"
)
SET
(
USE_ICONV ON
)
...
...
@@ -223,8 +224,23 @@ IF (MSVC)
ELSE
()
SET
(
CMAKE_C_FLAGS
"-D_GNU_SOURCE
${
CMAKE_C_FLAGS
}
"
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wall
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wextra
)
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
()
ENABLE_WARNINGS
(
all
)
ENABLE_WARNINGS
(
extra
)
IF
(
CMAKE_SYSTEM_NAME MATCHES
"(Solaris|SunOS)"
)
SET
(
CMAKE_C_FLAGS
"-std=c99 -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS
${
CMAKE_C_FLAGS
}
"
)
...
...
@@ -247,16 +263,16 @@ ELSE ()
ADD_DEFINITIONS
(
-D__USE_MINGW_ANSI_STDIO=1
)
ENDIF
()
ADD_C_FLAG_IF_SUPPORTED
(
-W
documentation
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-
missing-field-initializers
)
ADD_C_FLAG_IF_SUPPORTED
(
-W
strict-aliasing=2
)
ADD_C_FLAG_IF_SUPPORTED
(
-W
strict-prototypes
)
ADD_C_FLAG_IF_SUPPORTED
(
-W
declaration-after-statement
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-
unused-const-variable
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-
unused-function
)
ENABLE_WARNINGS
(
documentation
)
DISABLE_WARNINGS
(
missing-field-initializers
)
ENABLE_WARNINGS
(
strict-aliasing=2
)
ENABLE_WARNINGS
(
strict-prototypes
)
ENABLE_WARNINGS
(
declaration-after-statement
)
DISABLE_WARNINGS
(
unused-const-variable
)
DISABLE_WARNINGS
(
unused-function
)
IF
(
APPLE
)
# Apple deprecated OpenSSL
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-
deprecated-declarations
)
DISABLE_WARNINGS
(
deprecated-declarations
)
ENDIF
()
IF
(
PROFILE
)
...
...
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