This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
misc: refactor cmake scripts to support gcov #165
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
we refactor several places on cmake scripts to make the whole building process much simpler:
remove
WARNING_ALL
option, because whatever the value is, it always add-Wall
flag.remove
scripts/linux/misc.sh,
this is useless.don't generate
.matchfile
, useless.remove
MY_PROJ_BINDIRS
argument, useless.don't install useless stuff in rdsn/bin to rdsn/builder/output
extract the installation process to
dsn_install_library
anddsn_install_executable
, removeMY_DO_INSTALL
argument, which makes things complicated.Formerly we had a unfinished support for gcov, however we used lcov to generate report. lcov is useful but it is an old tool and compared to gcovr, it's not convenient enough. Now I change our tool to gcovr, which do everything only in one statement.
unset
CMAKE_RUNTIME_OUTPUT_DIRECTORY
,CMAKE_ARCHIVE_OUTPUT_DIRECTORY
andCMAKE_LIBRARY_OUTPUT_DIRECTORY
. The problem is, when test executable,dsn_nfs_test
for example, is copied tobuilder/bin/dsn_nfs_test
(byCMAKE_RUNTIME_OUTPUT_DIRECTORY
), gcovr can not find the corresponding*.gcno
file because they are not in the same directory.More specifically,
dsn_nfs_test
is inbuilder/bin/dsn_nfs_test
, whilemain.cpp.gcno
is inbuilder/src/dist/nfs/test/CMakeFiles/dsn_nfs_test.dir
. gcovr failed to find gcno file ofdsn_nfs_test
inbuilder/bin/dsn_nfs_test
so it generated empty result for it.To fix this we make
builder/bin/dsn_nfs_test
a soft link tobuilder/src/dist/nfs/test
, and it works now.