Merge branch 'cmake_fixes' into 'master'

Formatting and coverage related CMake files fixes

See merge request OpenMW/openmw!2811
depth-refraction
psi29a 2 years ago
commit efebb8efd8

@ -132,6 +132,7 @@ Clang_Format:
before_script:
- CI/install_debian_deps.sh openmw-clang-format
script:
- CI/check_cmake_format.sh
- CI/check_file_names.sh
- CI/check_clang_format.sh

@ -0,0 +1,6 @@
#!/bin/bash -ex
git ls-files -- ':(exclude)extern/' 'CMakeLists.txt' '*.cmake' |
xargs grep -P '^\s*\t' &&
( echo 'CMake files contain leading tab character. Use only spaces for indentation'; exit -1 )
exit 0

@ -13,3 +13,8 @@ endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE <algorithm>)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE --coverage)
target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark gcov)
endif()

@ -14,7 +14,7 @@ target_link_libraries(bsatool
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(bsatool PRIVATE --coverage)
target_link_libraries(bsatool gcov)
endif()

@ -11,7 +11,7 @@ target_link_libraries(openmw-bulletobjecttool
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions(--coverage)
target_compile_options(openmw-bulletobjecttool PRIVATE --coverage)
target_link_libraries(openmw-bulletobjecttool gcov)
endif()

@ -21,7 +21,7 @@ target_link_libraries(esmtool
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(esmtool PRIVATE --coverage)
target_link_libraries(esmtool gcov)
endif()

@ -39,7 +39,7 @@ target_link_libraries(openmw-essimporter
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(openmw-essimporter PRIVATE --coverage)
target_link_libraries(openmw-essimporter gcov)
endif()

@ -85,7 +85,7 @@ target_link_libraries(openmw-launcher
target_link_libraries(openmw-launcher Qt::Widgets Qt::Core)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(openmw-launcher PRIVATE --coverage)
target_link_libraries(openmw-launcher gcov)
endif()

@ -29,7 +29,7 @@ if (MINGW)
endif()
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(openmw-iniimporter PRIVATE --coverage)
target_link_libraries(openmw-iniimporter gcov)
endif()

@ -13,7 +13,7 @@ target_link_libraries(openmw-navmeshtool
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions(--coverage)
target_compile_options(openmw-navmeshtool PRIVATE --coverage)
target_link_libraries(openmw-navmeshtool gcov)
endif()

@ -13,7 +13,7 @@ target_link_libraries(niftest
)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(niftest PRIVATE --coverage)
target_link_libraries(niftest gcov)
endif()

@ -260,6 +260,11 @@ if(USE_QT)
set_property(TARGET openmw-cs PROPERTY AUTOMOC ON)
endif(USE_QT)
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-cs PRIVATE --coverage)
target_link_libraries(openmw-cs gcov)
endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
target_precompile_headers(openmw-cs PRIVATE
<boost/filesystem.hpp>

@ -230,7 +230,7 @@ if(APPLE)
endif(APPLE)
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(openmw PRIVATE --coverage)
target_link_libraries(openmw gcov)
endif()

@ -108,7 +108,7 @@ if (UNIX AND NOT APPLE)
endif()
if (BUILD_WITH_CODE_COVERAGE)
add_definitions(--coverage)
target_compile_options(openmw_test_suite PRIVATE --coverage)
target_link_libraries(openmw_test_suite gcov)
endif()

@ -94,7 +94,7 @@ if(DPKG_PROGRAM)
endif()
if (BUILD_WITH_CODE_COVERAGE)
add_definitions (--coverage)
target_compile_options(openmw-wizard PRIVATE --coverage)
target_link_libraries(openmw-wizard gcov)
endif()

@ -462,6 +462,11 @@ if (USE_QT)
add_library(components_qt STATIC ${COMPONENT_QT_FILES} ${ESM_UI_HDR})
target_link_libraries(components_qt components Qt::Widgets Qt::Core)
target_compile_definitions(components_qt PRIVATE OPENMW_DOC_BASEURL="${OPENMW_DOC_BASEURL}")
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(components_qt PRIVATE --coverage)
target_link_libraries(components_qt gcov)
endif()
endif()
if (GIT_CHECKOUT)
@ -487,7 +492,7 @@ target_link_libraries(components ${CMAKE_THREAD_LIBS_INIT})
endif()
if (BUILD_WITH_CODE_COVERAGE)
add_definitions(--coverage)
target_compile_options(components PRIVATE --coverage)
target_link_libraries(components gcov)
endif()

Loading…
Cancel
Save