fix compiler flags issue on Ubuntu18.04

This commit is contained in:
Axel Kohlmeyer
2022-12-30 00:39:23 -05:00
parent 064e1abd5b
commit 93689f40dd

View File

@ -34,6 +34,14 @@ foreach(_FLAG ${CMAKE_TUNE_FLAGS})
add_compile_options(${_FLAG})
endforeach()
# must repeat handling coverage for older CMake
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND ENABLE_COVERAGE)
if(CMAKE_VERSION VERSION_LESS 3.13)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_${CMAKE_BUILD_TYPE}_FLAGS} --coverage")
endif()
endif()
########################################
# General tests using the LAMMPS executable itself