From bebfeb488618cfebe5f5ac7d38fdc5fa0eaa33de Mon Sep 17 00:00:00 2001 From: Sascha Kratky Date: Sun, 18 Mar 2018 10:20:02 +0100 Subject: [PATCH] honor source file property COMPILE_OPTIONS --- CMake/cotire.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMake/cotire.cmake b/CMake/cotire.cmake index eef78b9..42d14e6 100644 --- a/CMake/cotire.cmake +++ b/CMake/cotire.cmake @@ -239,7 +239,13 @@ function (cotire_filter_language_source_files _language _target _sourceFilesVar # add to excluded sources, if file has custom compile flags list (APPEND _excludedSourceFiles "${_sourceFile}") else() - list (APPEND _sourceFiles "${_sourceFile}") + get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS) + if (_sourceCompileOptions) + # add to excluded sources, if file has list of custom compile options + list (APPEND _excludedSourceFiles "${_sourceFile}") + else() + list (APPEND _sourceFiles "${_sourceFile}") + endif() endif() endif() endforeach()