[V2] Fix libva examples build error

Submitted by Pan Xiuli on June 14, 2017, 7:53 a.m.

Details

Message ID 1497426820-25204-1-git-send-email-xiuli.pan@intel.com
State New
Headers show
Series "Fix libva examples build error" ( rev: 4 ) in Beignet

Not browsing as part of any series.

Commit Message

Pan Xiuli June 14, 2017, 7:53 a.m.
From: Pan Xiuli <xiuli.pan@intel.com>

Now libva has moved from freedesktop to github and been spilt into two
projects. Change the submodule to make sure the test case can be built.

Upgrade Guide: If you have tried old freedesktop libva, you should run
git submodule deinit -f .
first to remove all of the cache of the old version libva.

V2: Add some guide to upgrade libva and fix examples Cmake file.

Signed-off-by: Pan Xiuli <xiuli.pan@intel.com>
---
 .gitmodules                     |  5 ++++-
 examples/CMakeLists.txt         | 15 ++++++++++++---
 examples/thirdparty/libva       |  2 +-
 examples/thirdparty/libva-utils |  1 +
 4 files changed, 18 insertions(+), 5 deletions(-)
 create mode 160000 examples/thirdparty/libva-utils

Patch hide | download patch | download mbox

diff --git a/.gitmodules b/.gitmodules
index 2f761c0..b635a84 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,6 @@ 
 [submodule "examples/thirdparty/libva"]
 	path = examples/thirdparty/libva
-	url = git://anongit.freedesktop.org/libva
+	url = https://github.com/01org/libva.git
+[submodule "examples/thirdparty/libva-utils"]
+	path = examples/thirdparty/libva-utils
+	url = https://github.com/01org/libva-utils.git
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index a9e35c2..bb60ec7 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -20,6 +20,7 @@  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations" )
 
 ADD_LIBRARY(ocl_example_helper SHARED ${ocl_example_helper_sources})
 
+link_directories (${LLVM_LIBRARY_DIR} ${DRM_LIBDIR} ${OPENGL_LIBDIR} ${EGL_LIBDIR})
 TARGET_LINK_LIBRARIES(ocl_example_helper cl m ${X11_LIBRARIES} ${OPENGL_LIBRARIES} ${EGL_LIBRARIES})
 
 IF(LIBVA_BUF_SH_DEP OR V4L2_BUF_SH_DEP)
@@ -30,15 +31,23 @@  IF(LIBVA_BUF_SH_DEP OR V4L2_BUF_SH_DEP)
     EXECUTE_PROCESS(COMMAND git checkout master WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva)
   ENDIF ("LS_RESULT" STREQUAL "")
 
+  EXECUTE_PROCESS(COMMAND ls "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva-utils" OUTPUT_VARIABLE LS_RESULT)
+  IF ("LS_RESULT" STREQUAL "")
+    EXECUTE_PROCESS(COMMAND git submodule init WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+    EXECUTE_PROCESS(COMMAND git submodule update WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+    EXECUTE_PROCESS(COMMAND git checkout master WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva-utils)
+  ENDIF ("LS_RESULT" STREQUAL "")
+
+
   INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva/va
-                      ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva/test/common)
+                      ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libva-utils/common)
 
   link_directories (${LIBVA_LIBDIR}
                     ${LIBVA-X11_LIBDIR})
 
   set (va_display_sources
-    ./thirdparty/libva/test/common/va_display.c
-    ./thirdparty/libva/test/common/va_display_x11.c)
+    ./thirdparty/libva-utils/common/va_display.c
+    ./thirdparty/libva-utils/common/va_display_x11.c)
 
   ADD_DEFINITIONS(-DHAVE_VA_X11)
 
diff --git a/examples/thirdparty/libva b/examples/thirdparty/libva
index f974172..bd949b7 160000
--- a/examples/thirdparty/libva
+++ b/examples/thirdparty/libva
@@ -1 +1 @@ 
-Subproject commit f9741725839ea144e9a6a1827f74503ee39946c3
+Subproject commit bd949b77e8f0226a746b5fc2002b01a0e9ea1f2e
diff --git a/examples/thirdparty/libva-utils b/examples/thirdparty/libva-utils
new file mode 160000
index 0000000..2fc915d
--- /dev/null
+++ b/examples/thirdparty/libva-utils
@@ -0,0 +1 @@ 
+Subproject commit 2fc915d48927e7065cf99c397701f8406093eba9