Skip to content

Commit

Permalink
add gcov capability
Browse files Browse the repository at this point in the history
  • Loading branch information
pit-ray committed Feb 12, 2024
1 parent a7c2256 commit d9bb507
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 17 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vimspector.json
.vscode
build
build_test
build_mingw
.vscode
.vimspector.json
build_test
venv
10 changes: 6 additions & 4 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ if(${MSVC})
/DDEBUG
)
else()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_FLAGS
-static
-std=c++17
-std=c++11
-lstdc++
-lstdc++fs
-lgcc
Expand All @@ -45,12 +45,14 @@ else()
-DWINVER=0x0A00
-D_WIN32_WINNT=0x0A00
--coverage
-m64
-O0
-g3
-DDEBUG
)
list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g3 -DDEBUG")
set(CMAKE_SH "CMAKE_SH-NOTFOUND")
endif()

Expand Down
64 changes: 54 additions & 10 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,60 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(ROOT_DIR ${PROJECT_SOURCE_DIR}/..)

add_compile_options(
/W4
/std:c11
/D_UNICODE
/DUNICODE
/DEBUG
/DDEBUG
/utf-8
)
add_link_options(/FORCE:MULTIPLE)
if(${MSVC})
add_compile_options(
/W4
/std:c11
/D_UNICODE
/DUNICODE
/DEBUG
/DDEBUG
/utf-8
)
add_link_options(/FORCE:MULTIPLE)
else()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_CXX_FLAGS
-static
-std=c++11
-lstdc++
-lstdc++fs
-lgcc
-Wall
-Wextra
-Wcast-align
-Wno-unknown-pragmas
-Wcast-qual
-Wctor-dtor-privacy
-Wdelete-non-virtual-dtor
-Wdouble-promotion
-Weffc++
-Wold-style-cast
-Woverloaded-virtual
-Wreorder
-Wshadow
-Wsuggest-override
-Wuseless-cast
-fdiagnostics-color
-DUNICODE
-D_UNICODE
-DWINVER=0x0A00
-D_WIN32_WINNT=0x0A00
--coverage
-m64
-O0
-g3
-DDEBUG
)
list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

set(CMAKE_SH "CMAKE_SH-NOTFOUND")
endif()

include(ProcessorCount)
ProcessorCount(PROC_N)
Expand Down

0 comments on commit d9bb507

Please sign in to comment.