Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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
cpp-libs
Actor Framework
Commits
e13eb9a2
Commit
e13eb9a2
authored
Dec 11, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add --warnings-as-errors configure option
parent
0b6d7f05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
28 deletions
+36
-28
CMakeLists.txt
CMakeLists.txt
+32
-28
configure
configure
+4
-0
No files found.
CMakeLists.txt
View file @
e13eb9a2
...
@@ -101,31 +101,45 @@ if(NOT WIN32 AND NOT NO_COMPILER_CHECK)
...
@@ -101,31 +101,45 @@ if(NOT WIN32 AND NOT NO_COMPILER_CHECK)
"or is not supported"
)
"or is not supported"
)
endif
()
endif
()
endif
()
endif
()
# set optional build flags
set
(
CXX_EXTRA_FLAGS
""
)
# add "-Werror" flag if --pedantic-build is used
if
(
CXX_WARNINGS_AS_ERROS
)
set
(
CXX_EXTRA_FLAGS
"-Werror"
)
endif
()
# enable a ton of warnings if --more-clang-warnings is used
if
(
MORE_CLANG_WARNINGS AND
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
set
(
CXX_EXTRA_FLAGS
"
${
CXX_EXTRA_FLAGS
}
-Weverything -Wno-c++98-compat "
"-Wno-padded -Wno-documentation-unknown-command "
"-Wno-exit-time-destructors -Wno-global-constructors "
"-Wno-missing-prototypes -Wno-c++98-compat-pedantic "
"-Wno-unused-member-function "
"-Wno-unused-const-variable"
)
endif
()
# add -stdlib=libc++ when using Clang
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
message
(
STATUS
"NOTE: Automatically added -stdlib=libc++ flag, "
"you can override this by defining CMAKE_CXX_FLAGS "
"(see 'configure --help')"
)
set
(
CXX_EXTRA_FLAGS
"
${
CXX_EXTRA_FLAGS
}
-stdlib=libc++"
)
endif
()
# enable address sanitizer if requested by the user
if
(
ENABLE_ADDRESS_SANITIZER
)
message
(
STATUS
"Enable address sanitizer"
)
set
(
CXX_EXTRA_FLAGS
"
${
CXX_EXTRA_FLAGS
}
-fsanitize=address -fno-omit-frame-pointer"
)
endif
(
ENABLE_ADDRESS_SANITIZER
)
# -pthread is ignored on MacOSX but required on other platforms
if
(
NOT APPLE AND NOT WIN32
)
set
(
CXX_EXTRA_FLAGS
"
${
CXX_EXTRA_FLAGS
}
-pthread"
)
endif
()
# check if the user provided CXXFLAGS, set defaults otherwise
# check if the user provided CXXFLAGS, set defaults otherwise
if
(
CMAKE_CXX_FLAGS
)
if
(
CMAKE_CXX_FLAGS
)
set
(
CXXFLAGS_PROVIDED true
)
set
(
CMAKE_CXX_FLAGS_DEBUG
""
)
set
(
CMAKE_CXX_FLAGS_DEBUG
""
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
""
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
""
)
set
(
CMAKE_CXX_FLAGS_RELEASE
""
)
set
(
CMAKE_CXX_FLAGS_RELEASE
""
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
""
)
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
""
)
else
()
else
()
set
(
CXXFLAGS_PROVIDED false
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -Wextra -Wall -pedantic -fPIC
${
CXX_EXTRA_FLAGS
}
"
)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
MATCHES
"Clang"
)
message
(
STATUS
"NOTE: Automatically added -stdlib=libc++ flag, "
"you can override this by defining CMAKE_CXX_FLAGS "
"(see 'configure --help')"
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -stdlib=libc++ -fPIC"
)
if
(
MORE_CLANG_WARNINGS
)
set
(
CMAKE_CXX_FLAGS
"-pedantic -Weverything -Wno-c++98-compat "
"-Wno-padded -Wno-documentation-unknown-command "
"-Wno-exit-time-destructors -Wno-global-constructors "
"-Wno-missing-prototypes -Wno-c++98-compat-pedantic "
"-Wno-unused-member-function "
"-Wno-unused-const-variable"
)
endif
()
else
()
set
(
CMAKE_CXX_FLAGS
"-std=c++11 -Wextra -Wall -pedantic -fPIC"
)
endif
()
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -g"
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
"-Os"
)
set
(
CMAKE_CXX_FLAGS_MINSIZEREL
"-Os"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
)
...
@@ -135,16 +149,6 @@ endif()
...
@@ -135,16 +149,6 @@ endif()
if
(
NOT CMAKE_BUILD_TYPE
)
if
(
NOT CMAKE_BUILD_TYPE
)
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
set
(
CMAKE_BUILD_TYPE RelWithDebInfo
)
endif
()
endif
()
# enable clang's address sanitizer if requested by the user
if
(
ENABLE_ADDRESS_SANITIZER
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=address -fno-omit-frame-pointer"
)
message
(
STATUS
"Enable address sanitizer"
)
endif
(
ENABLE_ADDRESS_SANITIZER
)
# -pthread is ignored on MacOSX, enable it for all other platforms
if
(
NOT APPLE AND NOT WIN32
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-pthread"
)
endif
()
# extra setup steps needed on MinGW
# extra setup steps needed on MinGW
if
(
MINGW
)
if
(
MINGW
)
add_definitions
(
-D_WIN32_WINNT=0x0600
)
add_definitions
(
-D_WIN32_WINNT=0x0600
)
...
...
configure
View file @
e13eb9a2
...
@@ -47,6 +47,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
...
@@ -47,6 +47,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--build-static-only build as static library only
--build-static-only build as static library only
--more-clang-warnings enables most of Clang's warning flags
--more-clang-warnings enables most of Clang's warning flags
--no-compiler-check disable compiler version check
--no-compiler-check disable compiler version check
--warnings-as-errors enables -Werror
Installation Directories:
Installation Directories:
--prefix=PREFIX installation directory [/usr/local]
--prefix=PREFIX installation directory [/usr/local]
...
@@ -224,6 +225,9 @@ while [ $# -ne 0 ]; do
...
@@ -224,6 +225,9 @@ while [ $# -ne 0 ]; do
--no-compiler-check
)
--no-compiler-check
)
append_cache_entry NO_COMPILER_CHECK BOOL
yes
append_cache_entry NO_COMPILER_CHECK BOOL
yes
;;
;;
--warnings-as-errors
)
append_cache_entry CXX_WARNINGS_AS_ERROS BOOL
yes
;;
--with-log-level
=
*
)
--with-log-level
=
*
)
level
=
`
echo
"
$optarg
"
|
tr
'[:lower:]'
'[:upper:]'
`
level
=
`
echo
"
$optarg
"
|
tr
'[:lower:]'
'[:upper:]'
`
case
$level
in
case
$level
in
...
...
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