[objcopy][NFC] Add rules to cmake to put files under specific folders.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Thu, 17 Feb 2022 22:41:29 +0000 (01:41 +0300)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Fri, 18 Feb 2022 10:17:29 +0000 (13:17 +0300)
This patch adds rules to cmake to put files under specific folders.

It allows to have files for different formats(which are located in different
subdirectories) be displayed in different subfolders of VS IDE solution.

Depends on D114429

Differential Revision: https://reviews.llvm.org/D114664

llvm/lib/ObjCopy/CMakeLists.txt

index c272d26..1e51639 100644 (file)
@@ -1,3 +1,34 @@
+source_group("Header Files" REGULAR_EXPRESSION
+  .*[.]h
+)
+source_group("Header Files\\COFF" REGULAR_EXPRESSION
+  COFF/.*[.]h
+)
+source_group("Header Files\\ELF" REGULAR_EXPRESSION
+  ELF/.*[.]h
+)
+source_group("Header Files\\MachO" REGULAR_EXPRESSION
+  MachO/.*[.]h
+)
+source_group("Header Files\\wasm" REGULAR_EXPRESSION
+  wasm/.*[.]h
+)
+source_group("Source Files" REGULAR_EXPRESSION
+  .*[.]cpp
+)
+source_group("Source Files\\COFF" REGULAR_EXPRESSION  
+  COFF/.*[.]cpp
+)
+source_group("Source Files\\ELF" REGULAR_EXPRESSION
+  ELF/.*[.]cpp
+)
+source_group("Source Files\\MachO" REGULAR_EXPRESSION
+  MachO/.*[.]cpp
+)
+source_group("Source Files\\wasm" REGULAR_EXPRESSION
+  wasm/.*[.]cpp
+)
+
 add_llvm_component_library(LLVMObjCopy
   Archive.cpp
   ObjCopy.cpp
@@ -19,8 +50,16 @@ add_llvm_component_library(LLVMObjCopy
   wasm/WasmObjcopy.cpp
 
   ADDITIONAL_HEADER_DIRS
-  ${LLVM_MAIN_INCLUDE_DIR}/llvm/Object
-
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCopy
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCopy/COFF
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCopy/ELF
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCopy/MachO
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjCopy/wasm
+  COFF
+  ELF
+  MachO
+  wasm
   DEPENDS
   intrinsics_gen