[PATCH] D67171: LLVM_COMPILE_FLAGS also applies to C files

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 4 07:17:57 PDT 2019


davezarzycki created this revision.
davezarzycki added reviewers: beanz, chapuni, zturner.
Herald added a subscriber: mgorny.
Herald added a project: LLVM.

LLVM_COMPILE_FLAGS also applies to C files, otherwise tuning flags, etc won't be picked up.

Found via `LLVM_COMPILE_FLAGS="-march=native"` and `objdump -d`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67171

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -58,7 +58,7 @@
   if(update_src_props)
     foreach(fn ${sources})
       get_filename_component(suf ${fn} EXT)
-      if("${suf}" STREQUAL ".cpp")
+	  if("${suf}" STREQUAL ".cpp" OR "${suf}" STREQUAL ".c")
         set_property(SOURCE ${fn} APPEND_STRING PROPERTY
           COMPILE_FLAGS "${target_compile_flags}")
       endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67171.218686.patch
Type: text/x-patch
Size: 517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190904/086d0560/attachment.bin>


More information about the llvm-commits mailing list