cmake: check flags in CMAKE_TUNE_FLAGS

This commit is contained in:
Christoph Junghans
2020-04-05 08:58:34 -06:00
parent 5c0e8a6b0d
commit 6f5fcd66ac
2 changed files with 11 additions and 5 deletions

View File

@ -76,7 +76,7 @@ if(PKG_USER-INTEL)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
include(CheckCXXCompilerFlag)
foreach(_FLAG -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high -qno-offload -fno-alias -ansi-alias -restrict)
check_cxx_compiler_flag("${__FLAG}" COMPILER_SUPPORTS${_FLAG})
check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAG})
if(COMPILER_SUPPORTS${_FLAG})
target_compile_options(lammps PRIVATE ${_FLAG})
endif()