[Openmp-commits] [openmp] 99d72eb - [Libomptarget] Add header files as a dependency to CMake target

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 8 09:10:10 PST 2022


Author: Joseph Huber
Date: 2022-02-08T12:09:59-05:00
New Revision: 99d72ebddf97879c175552278601c824410884e8

URL: https://github.com/llvm/llvm-project/commit/99d72ebddf97879c175552278601c824410884e8
DIFF: https://github.com/llvm/llvm-project/commit/99d72ebddf97879c175552278601c824410884e8.diff

LOG: [Libomptarget] Add header files as a dependency to CMake target

This patch manually adds the runtime include files to the list of
dependencies when we build the bitcode runtime library. Previously if
only the header was changed we would not recompile the source files.
The solution used here isn't optimal because every source file not has a
dependency on each header file regardless of if it was actually used by
that file.

Reviewed By: tianshilei1992

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

Added: 
    

Modified: 
    openmp/libomptarget/DeviceRTL/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
index ec586959868a1..211f44dc6fd27 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/openmp/libomptarget/DeviceRTL/CMakeLists.txt
@@ -106,6 +106,16 @@ endif()
 set(LIBOMPTARGET_DEVICE_DEBUG FALSE CACHE BOOL
   "Activate DeviceRTL debug messages.")
 
+set(include_files
+  ${include_directory}/Configuration.h
+  ${include_directory}/Debug.h
+  ${include_directory}/Interface.h
+  ${include_directory}/Mapping.h
+  ${include_directory}/State.h
+  ${include_directory}/Synchronization.h
+  ${include_directory}/Types.h
+  ${include_directory}/Utils.h
+)
 
 set(src_files
   ${source_directory}/Configuration.cpp
@@ -161,7 +171,7 @@ function(compileDeviceRTLLibrary target_cpu target_name)
       -Xclang -target-cpu -Xclang ${target_cpu}
       ${target_bc_flags}
       ${infile} -o ${outfile}
-      DEPENDS ${infile}
+      DEPENDS ${infile} ${include_files}
       IMPLICIT_DEPENDS CXX ${infile}
       COMMENT "Building LLVM bitcode ${outfile}"
       VERBATIM


        


More information about the Openmp-commits mailing list