CMake: defines and uses macro add_llvm_definitions for keeping track
[opencl/llvm.git] / cmake / modules / CrossCompileLLVM.cmake
index 1c00f3958e67ddce4b3a0b10b8e93b11e9e8fc29..f638d67a30d1a0458004e1b38cf125450afa28d4 100644 (file)
@@ -1,8 +1,8 @@
 \r
 if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )\r
+  set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native")\r
   set(LLVM_TABLEGEN "${CX_NATIVE_TG_DIR}/bin/tblgen")\r
 \r
-  message(STATUS "CX_NATIVE_TG_DIR : ${CX_NATIVE_TG_DIR}")\r
   add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}\r
     COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR}\r
     COMMENT "Creating ${CX_NATIVE_TG_DIR}...")\r
@@ -22,10 +22,5 @@ if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
 \r
   add_dependencies(tblgen NativeTableGen)\r
 \r
-  # TODO: We should clean the native build when the `clean target\r
-  # is invoked. This doesn't work.\r
-  # add_custom_command(TARGET clean\r
-  #   COMMAND ${CMAKE_BUILD_TOOL} -C ${CX_NATIVE_TG_DIR}/utils/TableGen clean\r
-  #   POST_BUILD\r
-  #   COMMENT "Cleaning native TableGen...")\r
+  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CX_NATIVE_TG_DIR})\r
 endif()\r