Bug 143311 - make Windows CMake build for ANGLE and WebGL
Summary: make Windows CMake build for ANGLE and WebGL
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: ANGLE (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 11:35 PDT by Alex Christensen
Modified: 2015-08-04 10:50 PDT (History)
3 users (show)

See Also:


Attachments
Patch (20.86 KB, patch)
2015-08-03 16:01 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (20.97 KB, patch)
2015-08-03 16:24 PDT, Alex Christensen
ossy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-04-01 11:35:47 PDT
In https://bugs.webkit.org/show_bug.cgi?id=143293 I skipped WebGL on Windows with CMake.  To get WebGL working on Windows CMake builds, a CMake build will need to be made that is similar to what I did with the ANGLE Visual Studio files.

All of ANGLE needs to be compiled to make libGLESv2.dll, libEGL.dll, and translator libraries.
libGLESv2.dll needs to use the HLSL translator to internally translate GLSL to HLSL, while WebCore needs to use the GLSL translator to verify and translate GLSL to GLSL.
Comment 1 Alex Christensen 2015-08-03 16:01:13 PDT
Created attachment 258129 [details]
Patch
Comment 2 Alex Christensen 2015-08-03 16:24:51 PDT
Created attachment 258132 [details]
Patch
Comment 3 Csaba Osztrogonác 2015-08-04 03:33:57 PDT
Comment on attachment 258132 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258132&action=review

LGTM, r=me.

Please fix the minor style issues I mentioned before landing.

> ChangeLog:6
> +        Reviewed by Tim Horton.

???

> Source/ThirdParty/ANGLE/CMakeLists.txt:19
> +if (${CMAKE_GENERATOR} MATCHES "Ninja")
> +if (${MSVC_CXX_ARCHITECTURE_ID} STREQUAL "X86")
> +link_directories(${WINDOWSSDKDIR}Lib/${WINDOWSSDKLIBVERSION}/um/x86)
> +else ()
> +link_directories(${WINDOWSSDKDIR}Lib/${WINDOWSSDKLIBVERSION}/um/x64)
> +endif ()
> +else ()
> +if (${MSVC_CXX_ARCHITECTURE_ID} STREQUAL "X86")
> +link_directories($(WINDOWSSDKDIR)Lib/$(WINDOWSSDKLIBVERSION)/um/x86)
> +else ()
> +link_directories($(WINDOWSSDKDIR)Lib/$(WINDOWSSDKLIBVERSION)/um/x64)
> +endif ()
> +endif ()

Please indent these lines properly.

> Source/WebCore/CMakeLists.txt:3629
> -    add_library(ANGLESupport STATIC ${ANGLESupport_SOURCES})
> -    set_target_properties(ANGLESupport PROPERTIES FOLDER "WebCore")
> -
> -    # Suppress null conversion warnings for sources in Source/ThirdParty/ANGLE
> -    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
> -        ADD_TARGET_PROPERTIES(ANGLESupport COMPILE_FLAGS "-Wno-null-conversion")
> +    if (NOT WIN32)
> +        add_library(ANGLESupport STATIC ${ANGLESupport_SOURCES})
> +        set_target_properties(ANGLESupport PROPERTIES FOLDER "WebCore")
> +
> +        # Suppress null conversion warnings for sources in Source/ThirdParty/ANGLE
> +        if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
> +            ADD_TARGET_PROPERTIES(ANGLESupport COMPILE_FLAGS "-Wno-null-conversion")
> +        endif ()
> +
> +        target_include_directories(ANGLESupport PRIVATE
> +            "${THIRDPARTY_DIR}/ANGLE/include"
> +            "${THIRDPARTY_DIR}/ANGLE/src"
> +        )
> +        list(APPEND WebCore_LIBRARIES ANGLESupport)
> +        WEBKIT_SET_EXTRA_COMPILER_FLAGS(ANGLESupport IGNORECXX_WARNINGS)
>      endif ()
> -
> -    target_include_directories(ANGLESupport PRIVATE
> -        "${THIRDPARTY_DIR}/ANGLE/include"
> -        "${THIRDPARTY_DIR}/ANGLE/src"
> -    )
> -    list(APPEND WebCore_LIBRARIES ANGLESupport)
> -    WEBKIT_SET_EXTRA_COMPILER_FLAGS(ANGLESupport IGNORECXX_WARNINGS)
>  endif ()

I would prefer if (ENABLE_GRAPHICS_CONTEXT_3D AND NOT WIN32) to nested ifs.
Comment 4 Alex Christensen 2015-08-04 10:50:07 PDT
http://trac.webkit.org/changeset/187866