⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294906 in webkit


Ignore:
Timestamp:
May 26, 2022, 4:13:12 PM (4 years ago)
Author:
don.olmstead@sony.com
Message:

[CMake][PlayStation] Base find_package checks on whether WebCore is being built
​https://bugs.webkit.org/show_bug.cgi?id=240974

Reviewed by Ross Kirsling.

Move any find_package for WebCore libraries under a check for
ENABLE_WEBCORE. Shift the find_package checks to the top of the
file. This will allow us to base ENABLE flags on whether or not a
package is found. Fix a couple style issues while there.

  • Source/cmake/OptionsPlayStation.cmake:

Canonical link: ​https://commits.webkit.org/251029@main

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/cmake/OptionsPlayStation.cmake

    r292313 r294906  
    1919set(ENABLE_WEBKIT_LEGACY OFF)
    2020set(ENABLE_WEBINSPECTORUI OFF)
     21
     22# Specify third party library directory
     23if (NOT WEBKIT_LIBRARIES_DIR)
     24    if (DEFINED ENV{WEBKIT_LIBRARIES})
     25        set(WEBKIT_LIBRARIES_DIR "$ENV{WEBKIT_LIBRARIES}" CACHE PATH "Path to PlayStationRequirements")
     26    else ()
     27        set(WEBKIT_LIBRARIES_DIR "${CMAKE_SOURCE_DIR}/WebKitLibraries/playstation" CACHE PATH "Path to PlayStationRequirements")
     28    endif ()
     29endif ()
     30
     31if (DEFINED ENV{WEBKIT_IGNORE_PATH})
     32    set(CMAKE_IGNORE_PATH $ENV{WEBKIT_IGNORE_PATH})
     33endif ()
     34
     35list(APPEND CMAKE_PREFIX_PATH ${WEBKIT_LIBRARIES_DIR})
     36
     37# Find libraries
     38find_library(C_STD_LIBRARY c)
     39find_library(KERNEL_LIBRARY kernel)
     40find_package(ICU 61.2 REQUIRED COMPONENTS data i18n uc)
     41
     42set(USE_WPE_BACKEND_PLAYSTATION OFF)
     43
     44if (ENABLE_WEBCORE)
     45    set(WebKitRequirements_COMPONENTS
     46        JPEG
     47        LibPSL
     48        LibXml2
     49        ProcessLauncher
     50        SQLite3
     51        ZLIB
     52    )
     53
     54    find_package(WPEBackendPlayStation)
     55    if (WPEBackendPlayStation_FOUND)
     56        # WPE::libwpe is compiled into the PlayStation backend
     57        set(WPE_NAMES SceWPE)
     58        find_package(WPE REQUIRED)
     59
     60        SET_AND_EXPOSE_TO_BUILD(USE_WPE_BACKEND_PLAYSTATION ON)
     61    else ()
     62        list(APPEND WebKitRequirements_COMPONENTS libwpe)
     63    endif ()
     64
     65    find_package(WebKitRequirements REQUIRED COMPONENTS ${WebKitRequirements_COMPONENTS})
     66
     67    # The OpenGL ES implementation is in the same library as the EGL implementation
     68    set(OpenGLES2_NAMES ${EGL_NAMES})
     69
     70    find_package(CURL 7.77.0 REQUIRED)
     71    find_package(Cairo REQUIRED)
     72    find_package(EGL REQUIRED)
     73    find_package(Fontconfig REQUIRED)
     74    find_package(Freetype REQUIRED)
     75    find_package(HarfBuzz REQUIRED COMPONENTS ICU)
     76    find_package(OpenGLES2 REQUIRED)
     77    find_package(OpenSSL REQUIRED)
     78    find_package(PNG REQUIRED)
     79    find_package(Threads REQUIRED)
     80    find_package(WebP REQUIRED COMPONENTS demux)
     81endif ()
    2182
    2283WEBKIT_OPTION_BEGIN()
    … …  
    94155WEBKIT_OPTION_END()
    95156
    96 if (DEFINED ENV{WEBKIT_IGNORE_PATH})
    97     set(CMAKE_IGNORE_PATH $ENV{WEBKIT_IGNORE_PATH})
    98 endif ()
    99 
    100157# Do not use a separate directory based on configuration when building
    101158# with the Visual Studio generator
    … …  
    111168set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
    112169
    113 # Specify third party library directory
    114 if (NOT WEBKIT_LIBRARIES_DIR)
    115     if (DEFINED ENV{WEBKIT_LIBRARIES})
    116         set(WEBKIT_LIBRARIES_DIR "$ENV{WEBKIT_LIBRARIES}" CACHE PATH "Path to PlayStationRequirements")
    117     else ()
    118         set(WEBKIT_LIBRARIES_DIR "${CMAKE_SOURCE_DIR}/WebKitLibraries/playstation" CACHE PATH "Path to PlayStationRequirements")
    119     endif ()
    120 endif ()
    121 
    122 list(APPEND CMAKE_PREFIX_PATH ${WEBKIT_LIBRARIES_DIR})
    123 
    124 set(WebKitRequirements_COMPONENTS
    125     JPEG
    126     LibPSL
    127     LibXml2
    128     ProcessLauncher
    129     SQLite3
    130     ZLIB
    131 )
    132 
    133 find_package(WPEBackendPlayStation)
    134 if (WPEBackendPlayStation_FOUND)
    135     # WPE::libwpe is compiled into the PlayStation backend
    136     set(WPE_NAMES SceWPE)
    137     find_package(WPE REQUIRED)
    138 
    139     SET_AND_EXPOSE_TO_BUILD(USE_WPE_BACKEND_PLAYSTATION ON)
    140 else ()
    141     list(APPEND WebKitRequirements_COMPONENTS libwpe)
    142 endif ()
    143 
    144 find_library(C_STD_LIBRARY c)
    145 find_library(KERNEL_LIBRARY kernel)
    146 find_package(WebKitRequirements REQUIRED COMPONENTS ${WebKitRequirements_COMPONENTS})
    147 
    148 # The OpenGL ES implementation is in the same library as the EGL implementation
    149 set(OpenGLES2_NAMES ${EGL_NAMES})
    150 
    151 find_package(Cairo REQUIRED)
    152 find_package(CURL 7.77.0 REQUIRED)
    153 find_package(EGL REQUIRED)
    154 find_package(Fontconfig REQUIRED)
    155 find_package(Freetype REQUIRED)
    156 find_package(HarfBuzz REQUIRED COMPONENTS ICU)
    157 find_package(ICU 61.2 REQUIRED COMPONENTS data i18n uc)
    158 find_package(OpenGLES2 REQUIRED)
    159 find_package(OpenSSL REQUIRED)
    160 find_package(PNG REQUIRED)
    161 find_package(Threads REQUIRED)
    162 find_package(WebP REQUIRED COMPONENTS demux)
    163 
    164170set(CMAKE_C_STANDARD_LIBRARIES
    165171    "${CMAKE_C_STANDARD_LIBRARIES} ${C_STD_LIBRARY}"
    166   )
     172)
    167173set(CMAKE_CXX_STANDARD_LIBRARIES
    168174    "${CMAKE_CXX_STANDARD_LIBRARIES} ${C_STD_LIBRARY}"
    169   )
     175)
    170176
    171177SET_AND_EXPOSE_TO_BUILD(HAVE_PTHREAD_SETNAME_NP ON)
    172178
     179# Platform options
    173180SET_AND_EXPOSE_TO_BUILD(USE_CAIRO ON)
    174181SET_AND_EXPOSE_TO_BUILD(USE_CURL ON)
    … …  
    191198SET_AND_EXPOSE_TO_BUILD(USE_TILED_BACKING_STORE ON)
    192199
     200# WebDriver options
    193201if (ENABLE_WEBDRIVER)
    194202    SET_AND_EXPOSE_TO_BUILD(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS ON)
Note: See TracChangeset for help on using the changeset viewer.