Skip to content

Commit

Permalink
Update CMakeLists.txt (#348)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt
  • Loading branch information
amallia authored Mar 25, 2020
1 parent 5b56486 commit 56b3ed3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ set_property(TARGET gumbo::gumbo APPEND PROPERTY IMPORTED_LOCATION
${CMAKE_BINARY_DIR}/gumbo-parser/lib/libgumbo.a)
add_dependencies( gumbo::gumbo gumbo-external )


# Add code coverage
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/CMake-codecov/cmake")
find_package(codecov)
list(APPEND LCOV_REMOVE_PATTERNS "'${PROJECT_SOURCE_DIR}/external/*'")


if (UNIX)
# For hardware popcount and other special instructions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
Expand Down Expand Up @@ -119,6 +112,13 @@ if (PISA_BUILD_TOOLS)
endif()

if (PISA_ENABLE_TESTING AND BUILD_TESTING)
if (ENABLE_COVERAGE)
# Add code coverage
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/CMake-codecov/cmake")
find_package(codecov)
list(APPEND LCOV_REMOVE_PATTERNS "'${PROJECT_SOURCE_DIR}/external/*'")
endif()

enable_testing()
add_subdirectory(test)
endif()
Expand Down
7 changes: 4 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ foreach(TEST_SRC ${TEST_SOURCES})
rapidcheck
)
catch_discover_tests(${TEST_SRC_NAME} TEST_PREFIX "${TEST_SRC_NAME}:")

# enable code coverage
add_coverage(${TEST_SRC_NAME})
if (ENABLE_COVERAGE)
# enable code coverage
add_coverage(${TEST_SRC_NAME})
endif()
endforeach(TEST_SRC)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test_data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

0 comments on commit 56b3ed3

Please sign in to comment.