Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ include(cmake/findDependencies.cmake REQUIRED)
include(cmake/compileroptions.cmake REQUIRED)
include(cmake/compilerDefinitions.cmake REQUIRED)
include(cmake/buildFiles.cmake REQUIRED)
include(cmake/cxx11.cmake REQUIRED)

use_cxx11()

file(GLOB cfgs "cfg/*.cfg")

Expand Down
14 changes: 14 additions & 0 deletions cmake/cxx11.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
macro(use_cxx11)
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
if (POLICY CMP0025)
cmake_policy(SET CMP0025 NEW)
endif ()
endif ()
endmacro(use_cxx11)
4 changes: 0 additions & 4 deletions lib/checkbool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ static bool isBool(const Variable* var)
{
return (var && Token::Match(var->typeEndToken(), "bool|_Bool"));
}
static bool isNonBoolStdType(const Variable* var)
{
return (var && var->typeEndToken()->isStandardType() && !Token::Match(var->typeEndToken(), "bool|_Bool"));
}

//---------------------------------------------------------------------------
void CheckBool::checkIncrementBoolean()
Expand Down
9 changes: 3 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,12 @@ There are multiple compilation choices:
Example, compiling Cppcheck with cmake:

```shell
mkdir b
cd b
mkdir build
cd build
cmake ..
make
cmake --build .
```

If you need to specify c++ standard you can do it with the option
-DCMAKE_CXX_STANDARD=11

If you want to compile the GUI you can use the flag
-DBUILD_GUI=ON

Expand Down
9 changes: 3 additions & 6 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ Compiling
cmake
=====
Example, compiling Cppcheck with cmake:
mkdir b
cd b
mkdir build
cd build
cmake ..
make

If you need to specify c++ standard you can do it with the option
-DCMAKE_CXX_STANDARD=11
cmake --build .

If you want to compile the GUI you can use the flag
-DBUILD_GUI=ON
Expand Down