tkonolige commented on a change in pull request #8822:
URL: https://github.com/apache/tvm/pull/8822#discussion_r694996813



##########
File path: cmake/modules/Hexagon.cmake
##########
@@ -47,41 +47,10 @@ function(find_hexagon_toolchain)
   endif()
 endfunction()
 
-function(find_hexagon_sdk_root)
-  if(FOUND_HEXAGON_SDK_ROOT)
-    return()
-  endif()
-  message(STATUS "Checking Hexagon SDK root: ${USE_HEXAGON_SDK}")
-  file(GLOB_RECURSE HEXAGON_AEESTDDEF "${USE_HEXAGON_SDK}/*/AEEStdDef.h")
-  if(HEXAGON_AEESTDDEF)
-    # The path is ${HEXAGON_SDK_ROOT}/incs/stddef/AEEStdDef.h.
-    get_filename_component(HEXAGON_TMP0 "${HEXAGON_AEESTDDEF}" DIRECTORY)
-    get_filename_component(HEXAGON_TMP1 "${HEXAGON_TMP0}" DIRECTORY)
-    get_filename_component(HEXAGON_TMP2 "${HEXAGON_TMP1}" DIRECTORY)
-    set(HEXAGON_SDK_ROOT "${HEXAGON_TMP2}" CACHE PATH
-        "Root directory of Hexagon SDK")
-    set(FOUND_HEXAGON_SDK_ROOT TRUE)
-  else(HEXAGON_AEESTDDEF)
-    message(SEND_ERROR "Cannot validate Hexagon SDK in ${USE_HEXAGON_SDK}")
-  endif()
-endfunction()
-
 if(BUILD_FOR_HEXAGON)
-  find_hexagon_sdk_root()
-  if(HEXAGON_SDK_ROOT MATCHES "3.5.1")
-    message(SEND_ERROR "Hexagon SDK 3.5.1 is not supported")
-  elseif(HEXAGON_SDK_ROOT MATCHES "3\.[0-9]+\.[0-9]+")
-    include_directories(
-      SYSTEM "${USE_HEXAGON_SDK}/libs/common/qurt/ADSPv62MP/include/posix"
-      SYSTEM "${USE_HEXAGON_SDK}/libs/common/qurt/ADSPv62MP/include/qurt")
-  else()
-    include_directories(
-      SYSTEM "${HEXAGON_SDK_ROOT}/rtos/qurt/computev65/include/posix"
-      SYSTEM "${HEXAGON_SDK_ROOT}/rtos/qurt/computev65/include/qurt")
-  endif()
-  include_directories(
-    SYSTEM "${HEXAGON_SDK_ROOT}/incs"
-    SYSTEM "${HEXAGON_SDK_ROOT}/incs/stddef")
+  find_hexagon_sdk_root("${USE_HEXAGON_SDK}" "v66")
+  # Add SDK and QuRT includes when building for Hexagon.
+  include_directories(SYSTEM ${HEXAGON_SDK_INCLUDES} ${HEXAGON_QURT_INCLUDES})

Review comment:
       I would like to clean up the module, but I don't want to put too much of 
a burden on you @kparzysz-quic. If its too much work switch this to 
`target_include_directories`, we can leave it as further work.
   
   @Lunderberg I think cmake 3.9 is the minimum version of cmake we support. 
There are a lot of useful features in 3.12 and 3.13 that I'd like to use, but 
many OSs don't have newer version of cmake.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to