Title: [228051] trunk/Source/ThirdParty
Revision
228051
Author
zandober...@gmail.com
Date
2018-02-04 00:17:17 -0800 (Sun, 04 Feb 2018)

Log Message

Lots of build warnings from Source/ThirdParty/openvr
https://bugs.webkit.org/show_bug.cgi?id=182117

Reviewed by Michael Catanzaro.

Suppress OpenVR compiler warnings by listing -Wno-unknown-pragmas,
-Wno-unused-parameter and -Wno-unused-variable options among the
libopenvr_api.so CXX flags.

CMake configuration warning about default project variables for the
openvr_api project is avoided by removing the openvr_api project and
instead setting the OPENVR_SOURCE_DIR to the path of the OpenVR
source directory under Source/ThirdParty/.

Another compiler warning is removed by fixing the return condition in
the Path_WriteBinaryFile() function to perform an equality comparison
instead of an assignment. This has already been fixed upstream.

All changes to the OpenVR code are reflected in the separately-managed
patch files kept in the patches/ directory.

* openvr/README.webkit:
* openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch: Added.
* openvr/patches/cmake-build.patch:
* openvr/src/CMakeLists.txt:
* openvr/src/vrcommon/pathtools_public.cpp:
(Path_WriteBinaryFile):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/ThirdParty/ChangeLog (228050 => 228051)


--- trunk/Source/ThirdParty/ChangeLog	2018-02-04 03:35:18 UTC (rev 228050)
+++ trunk/Source/ThirdParty/ChangeLog	2018-02-04 08:17:17 UTC (rev 228051)
@@ -1,3 +1,33 @@
+2018-02-04  Zan Dobersek  <zdober...@igalia.com>
+
+        Lots of build warnings from Source/ThirdParty/openvr
+        https://bugs.webkit.org/show_bug.cgi?id=182117
+
+        Reviewed by Michael Catanzaro.
+
+        Suppress OpenVR compiler warnings by listing -Wno-unknown-pragmas,
+        -Wno-unused-parameter and -Wno-unused-variable options among the
+        libopenvr_api.so CXX flags.
+
+        CMake configuration warning about default project variables for the
+        openvr_api project is avoided by removing the openvr_api project and
+        instead setting the OPENVR_SOURCE_DIR to the path of the OpenVR
+        source directory under Source/ThirdParty/.
+
+        Another compiler warning is removed by fixing the return condition in
+        the Path_WriteBinaryFile() function to perform an equality comparison
+        instead of an assignment. This has already been fixed upstream.
+
+        All changes to the OpenVR code are reflected in the separately-managed
+        patch files kept in the patches/ directory.
+
+        * openvr/README.webkit:
+        * openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch: Added.
+        * openvr/patches/cmake-build.patch:
+        * openvr/src/CMakeLists.txt:
+        * openvr/src/vrcommon/pathtools_public.cpp:
+        (Path_WriteBinaryFile):
+
 2018-01-30  Don Olmstead  <don.olmst...@sony.com>
 
         [CMake] Make WTF headers copies

Modified: trunk/Source/ThirdParty/openvr/README.webkit (228050 => 228051)


--- trunk/Source/ThirdParty/openvr/README.webkit	2018-02-04 03:35:18 UTC (rev 228050)
+++ trunk/Source/ThirdParty/openvr/README.webkit	2018-02-04 08:17:17 UTC (rev 228051)
@@ -14,8 +14,10 @@
 WebKit changes:
 * patches/cmake-build.patch: script used to allow openvr CMake build to be
 integrated into WebKit build
+* patches/Path_WriteBinaryFile-fix-return-condition.patch: suppresses a
+compiler warning, but otherwise already applied upstream in 1.0.12
 * Removed bin/ directory. Not needed as it includes precompiled libraries
 * Removed lib/ directory. Not needed as it includes precompiled libraries
 * Removed controller_callouts/ directory. Unneeded docs
 * Removed samples/ directory.
-* Replaced tabs by whitespaces to make check-webkit-style happy.
\ No newline at end of file
+* Replaced tabs by whitespaces to make check-webkit-style happy.

Added: trunk/Source/ThirdParty/openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch (0 => 228051)


--- trunk/Source/ThirdParty/openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch	                        (rev 0)
+++ trunk/Source/ThirdParty/openvr/patches/Path_WriteBinaryFile-fix-return-condition.patch	2018-02-04 08:17:17 UTC (rev 228051)
@@ -0,0 +1,13 @@
+diff --git a/src/vrcommon/pathtools_public.cpp b/src/vrcommon/pathtools_public.cpp
+index 7f7c7e8..de7a72a 100644
+--- a/src/vrcommon/pathtools_public.cpp
++++ b/src/vrcommon/pathtools_public.cpp
+@@ -655,7 +655,7 @@ bool Path_WriteBinaryFile(const std::string &strFilename, unsigned char *pData,
+               fclose(f);
+        }
+ 
+-       return written = nSize ? true : false;
++       return written == nSize ? true : false;
+ }
+ 
+ std::string Path_ReadTextFile( const std::string &strFilename )

Modified: trunk/Source/ThirdParty/openvr/patches/cmake-build.patch (228050 => 228051)


--- trunk/Source/ThirdParty/openvr/patches/cmake-build.patch	2018-02-04 03:35:18 UTC (rev 228050)
+++ trunk/Source/ThirdParty/openvr/patches/cmake-build.patch	2018-02-04 08:17:17 UTC (rev 228051)
@@ -1,5 +1,5 @@
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 94de3ce..6decedd 100644
+index d7025c0db4b..d13a7f90cf8 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -1,14 +1,8 @@
@@ -40,10 +40,13 @@
  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
         # Enable c++11 and hide symbols which shouldn't be visible
 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 58954d6..8b537af 100644
+index e58c9e1c039..095f81e562b 100644
 --- a/src/CMakeLists.txt
 +++ b/src/CMakeLists.txt
-@@ -3,6 +3,9 @@ project(openvr_api)
+@@ -1,8 +1,10 @@
+-# Project name.
+-project(openvr_api)
++set(OPENVR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source/ThirdParty/openvr)
  
  set( LIBNAME "openvr_api" )
  
@@ -53,16 +56,16 @@
  # Set some properies for specific files.
  if(APPLE)
    set(CMAKE_MACOSX_RPATH 1)
-@@ -22,7 +25,7 @@ elseif(WIN32)
+@@ -22,7 +24,7 @@ elseif(WIN32)
  endif()
  
  # Add include folders.
 -include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/headers ${CMAKE_SOURCE_DIR}/src/vrcommon)
-+include_directories(${PROJECT_SOURCE_DIR}/../src ${PROJECT_SOURCE_DIR}/../headers ${PROJECT_SOURCE_DIR}/../src/vrcommon)
++include_directories(${OPENVR_SOURCE_DIR}/src ${OPENVR_SOURCE_DIR}/headers ${OPENVR_SOURCE_DIR}/src/vrcommon)
  
  if(USE_CUSTOM_LIBCXX)
         link_directories(
-@@ -65,22 +68,22 @@ elseif(BUILD_FRAMEWORK)
+@@ -65,28 +67,34 @@ elseif(BUILD_FRAMEWORK)
         set( LIBNAME "OpenVR" )
         add_library( ${LIBNAME} 
              SHARED ${SOURCE_FILES}
@@ -71,11 +74,11 @@
 -            ${CMAKE_SOURCE_DIR}/headers/openvr_api.json
 -            ${CMAKE_SOURCE_DIR}/headers/openvr_capi.h
 -            ${CMAKE_SOURCE_DIR}/headers/openvr_driver.h
-+            ${PROJECT_SOURCE_DIR}/../headers/openvr.h
-+            ${PROJECT_SOURCE_DIR}/../headers/openvr_api.cs
-+            ${PROJECT_SOURCE_DIR}/../headers/openvr_api.json
-+            ${PROJECT_SOURCE_DIR}/../headers/openvr_capi.h
-+            ${PROJECT_SOURCE_DIR}/../headers/openvr_driver.h
++            ${OPENVR_SOURCE_DIR}/headers/openvr.h
++            ${OPENVR_SOURCE_DIR}/headers/openvr_api.cs
++            ${OPENVR_SOURCE_DIR}/headers/openvr_api.json
++            ${OPENVR_SOURCE_DIR}/headers/openvr_capi.h
++            ${OPENVR_SOURCE_DIR}/headers/openvr_driver.h
         )
         set_target_properties(OpenVR PROPERTIES
                FRAMEWORK TRUE
@@ -82,13 +85,25 @@
                FRAMEWORK_VERSION A
                MACOSX_FRAMEWORK_IDENTIFIER com.valvesoftware.OpenVR.framework
 -              MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/Info.plist
-+              MACOSX_FRAMEWORK_INFO_PLIST ${PROJECT_SOURCE_DIR}/../src/Info.plist
++              MACOSX_FRAMEWORK_INFO_PLIST ${OPENVR_SOURCE_DIR}/src/Info.plist
                # "current version" in semantic format in Mach-O binary file
                VERSION 1.0.6
                # "compatibility version" in semantic format in Mach-O binary file
                SOVERSION 1.0.0
 -              PUBLIC_HEADER "${CMAKE_SOURCE_DIR}/headers/openvr.h;${CMAKE_SOURCE_DIR}/headers/openvr_api.cs;${CMAKE_SOURCE_DIR}/headers/openvr_api.json;${CMAKE_SOURCE_DIR}/headers/openvr_capi.h;${CMAKE_SOURCE_DIR}/headers/openvr_driver.h"
-+              PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/../headers/openvr.h;${PROJECT_SOURCE_DIR}/../headers/openvr_api.cs;${PROJECT_SOURCE_DIR}/../headers/openvr_api.json;${PROJECT_SOURCE_DIR}/../headers/openvr_capi.h;${PROJECT_SOURCE_DIR}/../headers/openvr_driver.h"
++              PUBLIC_HEADER "${OPENVR_SOURCE_DIR}/headers/openvr.h;${OPENVR_SOURCE_DIR}/headers/openvr_api.cs;${OPENVR_SOURCE_DIR}/headers/openvr_api.json;${OPENVR_SOURCE_DIR}/headers/openvr_capi.h;${OPENVR_SOURCE_DIR}/headers/openvr_driver.h"
                LINKER_LANGUAGE CXX
         )
  else()
+        add_library(${LIBNAME} STATIC ${SOURCE_FILES})
+ endif()
+ 
++if (COMPILER_IS_GCC_OR_CLANG)
++    WEBKIT_ADD_TARGET_CXX_FLAGS(${LIBNAME} -Wno-unknown-pragmas
++                                           -Wno-unused-parameter
++                                           -Wno-unused-variable)
++endif()
++
+ if(USE_CUSTOM_LIBCXX)
+        set(EXTRA_LIBS ${EXTRA_LIBS} c++ c++abi)
+ endif()

Modified: trunk/Source/ThirdParty/openvr/src/CMakeLists.txt (228050 => 228051)


--- trunk/Source/ThirdParty/openvr/src/CMakeLists.txt	2018-02-04 03:35:18 UTC (rev 228050)
+++ trunk/Source/ThirdParty/openvr/src/CMakeLists.txt	2018-02-04 08:17:17 UTC (rev 228051)
@@ -1,5 +1,4 @@
-# Project name.
-project(openvr_api)
+set(OPENVR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/Source/ThirdParty/openvr)
 
 set( LIBNAME "openvr_api" )
 
@@ -25,7 +24,7 @@
 endif()
 
 # Add include folders.
-include_directories(${PROJECT_SOURCE_DIR}/../src ${PROJECT_SOURCE_DIR}/../headers ${PROJECT_SOURCE_DIR}/../src/vrcommon)
+include_directories(${OPENVR_SOURCE_DIR}/src ${OPENVR_SOURCE_DIR}/headers ${OPENVR_SOURCE_DIR}/src/vrcommon)
 
 if(USE_CUSTOM_LIBCXX)
        link_directories(
@@ -68,22 +67,22 @@
        set( LIBNAME "OpenVR" )
        add_library( ${LIBNAME} 
             SHARED ${SOURCE_FILES}
-            ${PROJECT_SOURCE_DIR}/../headers/openvr.h
-            ${PROJECT_SOURCE_DIR}/../headers/openvr_api.cs
-            ${PROJECT_SOURCE_DIR}/../headers/openvr_api.json
-            ${PROJECT_SOURCE_DIR}/../headers/openvr_capi.h
-            ${PROJECT_SOURCE_DIR}/../headers/openvr_driver.h
+            ${OPENVR_SOURCE_DIR}/headers/openvr.h
+            ${OPENVR_SOURCE_DIR}/headers/openvr_api.cs
+            ${OPENVR_SOURCE_DIR}/headers/openvr_api.json
+            ${OPENVR_SOURCE_DIR}/headers/openvr_capi.h
+            ${OPENVR_SOURCE_DIR}/headers/openvr_driver.h
        )
        set_target_properties(OpenVR PROPERTIES
               FRAMEWORK TRUE
               FRAMEWORK_VERSION A
               MACOSX_FRAMEWORK_IDENTIFIER com.valvesoftware.OpenVR.framework
-              MACOSX_FRAMEWORK_INFO_PLIST ${PROJECT_SOURCE_DIR}/../src/Info.plist
+              MACOSX_FRAMEWORK_INFO_PLIST ${OPENVR_SOURCE_DIR}/src/Info.plist
               # "current version" in semantic format in Mach-O binary file
               VERSION 1.0.6
               # "compatibility version" in semantic format in Mach-O binary file
               SOVERSION 1.0.0
-              PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/../headers/openvr.h;${PROJECT_SOURCE_DIR}/../headers/openvr_api.cs;${PROJECT_SOURCE_DIR}/../headers/openvr_api.json;${PROJECT_SOURCE_DIR}/../headers/openvr_capi.h;${PROJECT_SOURCE_DIR}/../headers/openvr_driver.h"
+              PUBLIC_HEADER "${OPENVR_SOURCE_DIR}/headers/openvr.h;${OPENVR_SOURCE_DIR}/headers/openvr_api.cs;${OPENVR_SOURCE_DIR}/headers/openvr_api.json;${OPENVR_SOURCE_DIR}/headers/openvr_capi.h;${OPENVR_SOURCE_DIR}/headers/openvr_driver.h"
               LINKER_LANGUAGE CXX
        )
 else()
@@ -90,6 +89,12 @@
        add_library(${LIBNAME} STATIC ${SOURCE_FILES})
 endif()
 
+if (COMPILER_IS_GCC_OR_CLANG)
+    WEBKIT_ADD_TARGET_CXX_FLAGS(${LIBNAME} -Wno-unknown-pragmas
+                                           -Wno-unused-parameter
+                                           -Wno-unused-variable)
+endif()
+
 if(USE_CUSTOM_LIBCXX)
        set(EXTRA_LIBS ${EXTRA_LIBS} c++ c++abi)
 endif()

Modified: trunk/Source/ThirdParty/openvr/src/vrcommon/pathtools_public.cpp (228050 => 228051)


--- trunk/Source/ThirdParty/openvr/src/vrcommon/pathtools_public.cpp	2018-02-04 03:35:18 UTC (rev 228050)
+++ trunk/Source/ThirdParty/openvr/src/vrcommon/pathtools_public.cpp	2018-02-04 08:17:17 UTC (rev 228051)
@@ -655,7 +655,7 @@
               fclose(f);
        }
 
-       return written = nSize ? true : false;
+       return written == nSize ? true : false;
 }
 
 std::string Path_ReadTextFile( const std::string &strFilename )
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to