config: Fix build failure missing header file 38/24138/1
authorRomain Forlot <romain.forlot@iot.bzh>
Fri, 28 Feb 2020 15:54:07 +0000 (16:54 +0100)
committerRomain Forlot <romain.forlot@iot.bzh>
Fri, 28 Feb 2020 16:08:22 +0000 (17:08 +0100)
This commit add a sysroot variable in front of the path to header file which
the presence is tested. Then we always point to the correct kernel headers
path depending on the build environment

Bug-AGL: SPEC-3204

Change-Id: Ifb59a897d36c74e6f84897d0bf3db3eb75609702
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
conf.d/cmake/config.cmake

index cedb5e3..3453d66 100644 (file)
@@ -44,7 +44,7 @@ set(BUILD_TYPE "DEBUG" CACHE STRING "Default Build variant chosen. (Overwritten
 # Need module in kernel
 # --------------
 
-execute_process(COMMAND ls /usr/include/linux/can/j1939.h RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND ls $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/can/j1939.h RESULT_VARIABLE result OUTPUT_QUIET ERROR_QUIET)
 
 if(result)
        message("Feature J1939 disabled")
@@ -62,7 +62,7 @@ endif()
 # Need module in kernel
 # --------------
 
-execute_process(COMMAND ls /usr/include/linux/can/isotp.h RESULT_VARIABLE result2 OUTPUT_QUIET ERROR_QUIET)
+execute_process(COMMAND ls $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/can/isotp.h RESULT_VARIABLE result2 OUTPUT_QUIET ERROR_QUIET)
 
 if(result2)
     message("Feature ISO TP disabled")