[PATCH] [Polly] Add -std=c99 flag only to C source files
Michael Kruse
llvm at meinersbur.de
Mon Jun 29 12:58:35 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D10809
Files:
polly/trunk/cmake/polly_macros.cmake
Index: polly/trunk/cmake/polly_macros.cmake
===================================================================
--- polly/trunk/cmake/polly_macros.cmake
+++ polly/trunk/cmake/polly_macros.cmake
@@ -72,12 +72,17 @@
endif()
endmacro(add_polly_loadable_module)
-# # Use C99-compatible compile mode for all C source files of a target.
+# Use C99-compatible compile mode for all C source files of a target.
function(target_enable_c99 _target)
if(CMAKE_VERSION VERSION_GREATER "3.1")
set_target_properties("${_target}" PROPERTIES C_STANDARD 99)
elseif(CMAKE_COMPILER_IS_GNUCC)
get_target_property(_sources "${_target}" SOURCES)
- set_source_files_properties(${_sources} COMPILE_FLAGS "-std=gnu99")
+ foreach(_file IN LISTS _sources)
+ get_source_file_property(_lang "${_file}" LANGUAGE)
+ if(_lang STREQUAL "C")
+ set_source_files_properties(${_file} COMPILE_FLAGS "-std=gnu99")
+ endif()
+ endforeach()
endif()
endfunction()
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10809.28703.patch
Type: text/x-patch
Size: 978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150629/9f72a7fa/attachment.bin>
More information about the llvm-commits
mailing list