Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 1 | # Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 2 | # reserved. Use of this source code is governed by a BSD-style license that |
| 3 | # can be found in the LICENSE file. |
| 4 | |
| 5 | # OVERVIEW |
| 6 | # |
| 7 | # CMake is a cross-platform open-source build system that can generate project |
| 8 | # files in many different formats. It can be downloaded from |
| 9 | # http://www.cmake.org or installed via a platform package manager. |
| 10 | # |
| 11 | # CMake-generated project formats that have been tested with JCEF include: |
| 12 | # |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 13 | # Linux: Ninja, GCC 7.5.0+, Unix Makefiles |
| 14 | # MacOS: Ninja, Xcode 12.2 to 13.0 |
| 15 | # Windows: Ninja, Visual Studio 2019+ |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 16 | # |
| 17 | # Ninja is a cross-platform open-source tool for running fast builds using |
| 18 | # pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be |
| 19 | # downloaded from http://martine.github.io/ninja/ or installed via a platform |
| 20 | # package manager. |
| 21 | # |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 22 | # BUILD REQUIREMENTS |
| 23 | # |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 24 | # The below requirements must be met to build JCEF. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 25 | # |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 26 | # - CMake version 3.19 or newer. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 27 | # |
| 28 | # - Linux requirements: |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 29 | # Currently supported distributions include Debian 10 (Buster), Ubuntu 18 |
| 30 | # (Bionic Beaver), and related. Ubuntu 18.04 64-bit with GCC 7.5.0+ is |
| 31 | # recommended. Newer versions will likely also work but may not have been |
| 32 | # tested. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 33 | # Required packages include: |
| 34 | # build-essential |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 35 | # libgtk3.0-dev (required by the cefclient target only) |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 36 | # |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 37 | # - MacOS requirements: |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 38 | # Xcode 12.2 to 13.0 building on MacOS 10.15.4 (Catalina) or newer. Only |
| 39 | # 64-bit builds are supported. The Xcode command-line tools must also be |
| 40 | # installed. Newer Xcode versions may not have been been tested and are not |
| 41 | # recommended. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 42 | # |
| 43 | # - Windows requirements: |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 44 | # Visual Studio 2019 or newer building on Windows 7 or newer. Windows 10 |
| 45 | # 64-bit is recommended. Newer versions will likely also work but may not have |
| 46 | # been tested. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 47 | # |
| 48 | # BUILD EXAMPLES |
| 49 | # |
| 50 | # The below commands will generate project files and create a Debug build of all |
| 51 | # JCEF native targets using CMake and the platform toolchain. |
| 52 | # |
| 53 | # Start by creating and entering the CMake build output directory. The |
| 54 | #`jcef_build` directory name is required by other JCEF tooling (specifically the |
| 55 | # tools/make_distrib.[bat|sh] and tools/run.[bat|sh] scripts) and should not be |
| 56 | # changed. |
| 57 | # > cd path/to/java-cef/src |
| 58 | # > mkdir jcef_build && cd jcef_build |
| 59 | # |
| 60 | # To perform a Linux build using a 32-bit CEF binary distribution on a 32-bit |
| 61 | # Linux platform or a 64-bit CEF binary distribution on a 64-bit Linux platform: |
| 62 | # Using Unix Makefiles: |
| 63 | # > cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug .. |
| 64 | # > make -j4 |
| 65 | # |
| 66 | # Using Ninja: |
| 67 | # > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. |
| 68 | # > ninja |
| 69 | # |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 70 | # To perform a MacOS build using a 64-bit CEF binary distribution: |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 71 | # Using the Xcode IDE: |
| 72 | # > cmake -G "Xcode" -DPROJECT_ARCH="x86_64" .. |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 73 | # Open jcef.xcodeproj in Xcode and select Product > Build. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 74 | # |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 75 | # Using Ninja: |
| 76 | # > cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=Debug .. |
| 77 | # > ninja |
| 78 | # |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 79 | # To perform a MacOS build using an ARM64 CEF binary distribution: |
| 80 | # Using the Xcode IDE: |
| 81 | # > cmake -G "Xcode" -DPROJECT_ARCH="arm64" .. |
| 82 | # Open jcef.xcodeproj in Xcode and select Product > Build. |
| 83 | # |
| 84 | # Using Ninja: |
| 85 | # > cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=Debug .. |
| 86 | # > ninja |
| 87 | # |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 88 | # To perform a Windows build using a 32-bit CEF binary distribution: |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 89 | # Using the Visual Studio 2019 IDE: |
| 90 | # > cmake -G "Visual Studio 16" -A Win32 .. |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 91 | # Open jcef.sln in Visual Studio and select Build > Build Solution. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 92 | # |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 93 | # Using Ninja with Visual Studio 2019 command-line tools: |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 94 | # (this path may be different depending on your Visual Studio installation) |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 95 | # > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat" |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 96 | # > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. |
| 97 | # > ninja |
| 98 | # |
| 99 | # To perform a Windows build using a 64-bit CEF binary distribution: |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 100 | # Using the Visual Studio 2019 IDE: |
| 101 | # > cmake -G "Visual Studio 16" -A x64 .. |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 102 | # Open jcef.sln in Visual Studio and select Build > Build Solution. |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 103 | # |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 104 | # Using Ninja with Visual Studio 2019 command-line tools: |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 105 | # (this path may be different depending on your Visual Studio installation) |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 106 | # > "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 107 | # > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. |
| 108 | # > ninja |
| 109 | |
| 110 | # |
| 111 | # Shared configuration. |
| 112 | # |
| 113 | |
Marshall Greenblatt | 544024e | 2021-12-13 12:47:00 -0500 | [diff] [blame] | 114 | # For VS2019 and Xcode 12+ support. |
| 115 | cmake_minimum_required(VERSION 3.19) |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 116 | |
| 117 | # Only generate Debug and Release configuration types. |
| 118 | set(CMAKE_CONFIGURATION_TYPES Debug Release) |
| 119 | |
| 120 | # Project name. |
| 121 | project(jcef) |
| 122 | |
| 123 | # Use folders in the resulting project files. |
| 124 | set_property(GLOBAL PROPERTY OS_FOLDERS ON) |
| 125 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 126 | |
| 127 | # |
| 128 | # CEF configuration. |
| 129 | # |
| 130 | |
| 131 | # Specify the CEF distribution version. |
Rene Schneider | 9f354b6 | 2019-04-24 15:02:05 +0000 | [diff] [blame] | 132 | if(NOT DEFINED CEF_VERSION) |
Artem Bochkarev | 2aa0df1 | 2023-03-06 20:40:19 +0700 | [diff] [blame] | 133 | set(CEF_VERSION "111.2.1+g870da30+chromium-111.0.5563.64") |
Rene Schneider | 9f354b6 | 2019-04-24 15:02:05 +0000 | [diff] [blame] | 134 | endif() |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 135 | |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 136 | # Determine the platform. |
| 137 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 138 | if("${PROJECT_ARCH}" STREQUAL "arm64") |
| 139 | set(CEF_PLATFORM "macosarm64") |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 140 | elseif("${PROJECT_ARCH}" STREQUAL "x86_64") |
| 141 | set(CEF_PLATFORM "macosx64") |
| 142 | elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") |
| 143 | set(PROJECT_ARCH "arm64") |
| 144 | set(CEF_PLATFORM "macosarm64") |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 145 | else() |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 146 | set(PROJECT_ARCH "x86_64") |
Marshall Greenblatt | 0e666a6 | 2020-12-30 13:35:47 -0500 | [diff] [blame] | 147 | set(CEF_PLATFORM "macosx64") |
| 148 | endif() |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 149 | elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") |
Vladislav Rassokhin | 3172dc1 | 2022-04-22 21:04:12 +0300 | [diff] [blame] | 150 | if("${PROJECT_ARCH}" STREQUAL "x86_64") |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 151 | set(CEF_PLATFORM "linux64") |
Vladislav Rassokhin | 3172dc1 | 2022-04-22 21:04:12 +0300 | [diff] [blame] | 152 | elseif("${PROJECT_ARCH}" STREQUAL "arm64") |
| 153 | set(CEF_PLATFORM "linuxarm64") |
| 154 | elseif("${PROJECT_ARCH}" STREQUAL "arm/v6") |
| 155 | set(CEF_PLATFORM "linuxarm") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 156 | else() |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 157 | set(CEF_PLATFORM "linux32") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 158 | endif() |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 159 | elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") |
Nikita Provotorov | 2ac786c | 2021-07-28 23:33:06 +0700 | [diff] [blame] | 160 | if(MSVC) |
| 161 | include(CheckSymbolExists) |
| 162 | |
| 163 | # MSVC predefines _M_ARM64 for compilations that target ARM64 |
| 164 | # and _M_AMD64 for compilations that target x86_64. |
| 165 | check_symbol_exists("_M_ARM64" "" CEF_PLATFORM_WINARM64) |
| 166 | check_symbol_exists("_M_AMD64" "" CEF_PLATFORM_WIN64) |
| 167 | |
| 168 | # We also should set PROJECT_ARCH explicitly because FindCEF.cmake deduces it incorrectly for |
| 169 | # cross-compilation cases. |
| 170 | if(CEF_PLATFORM_WINARM64) |
| 171 | set(CEF_PLATFORM "windowsarm64") |
| 172 | set(PROJECT_ARCH "arm64") |
| 173 | elseif(CEF_PLATFORM_WIN64) |
| 174 | set(CEF_PLATFORM "windows64") |
| 175 | set(PROJECT_ARCH "x86_64") |
| 176 | else() |
| 177 | set(CEF_PLATFORM "windows32") |
| 178 | set(PROJECT_ARCH "x86") |
| 179 | endif() |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 180 | else() |
Nikita Provotorov | 2ac786c | 2021-07-28 23:33:06 +0700 | [diff] [blame] | 181 | message(FATAL_ERROR "Building JCEF for Windows using non-MSVC compiler is not supported.") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 182 | endif() |
| 183 | endif() |
| 184 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 185 | # Add this project's cmake/ directory to the module path. |
| 186 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 187 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 188 | # Download and extract the CEF binary distribution (executes DownloadCEF.cmake). |
| 189 | include(DownloadCEF) |
| 190 | DownloadCEF("${CEF_PLATFORM}" "${CEF_VERSION}" "${CMAKE_SOURCE_DIR}/third_party/cef") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 191 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 192 | # Add the CEF binary distribution's cmake/ directory to the module path. |
| 193 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 194 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 195 | # Load the CEF configuration (executes FindCEF.cmake). |
| 196 | find_package(CEF REQUIRED) |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 197 | |
| 198 | |
| 199 | # |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 200 | # Python configuration. |
| 201 | # |
| 202 | |
| 203 | # Support specification of the Python executable path via the command-line. |
| 204 | if(DEFINED ENV{PYTHON_EXECUTABLE}) |
| 205 | file(TO_CMAKE_PATH "$ENV{PYTHON_EXECUTABLE}" PYTHON_EXECUTABLE) |
| 206 | endif() |
| 207 | |
| 208 | if(NOT PYTHON_EXECUTABLE) |
| 209 | unset(PYTHON_EXECUTABLE) |
| 210 | |
| 211 | # Find the python interpreter. |
| 212 | find_package(PythonInterp) |
| 213 | |
| 214 | if(NOT ${PYTHONINTERP_FOUND}) |
| 215 | message(FATAL_ERROR "A Python installation is required. Set the " |
| 216 | "PYTHON_EXECUTABLE environment variable to explicitly " |
| 217 | "specify the Python executable path.") |
| 218 | endif() |
| 219 | endif() |
| 220 | |
Marshall Greenblatt | 6d7ad9d | 2020-01-14 15:29:42 +0100 | [diff] [blame] | 221 | message(STATUS "Using Python: ${PYTHON_EXECUTABLE}") |
| 222 | |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 223 | |
| 224 | # |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 225 | # Java configuration. |
| 226 | # |
| 227 | |
| 228 | # Minimum required Java version. |
| 229 | set(JDK_MIN_VERSION 1.7) |
| 230 | |
| 231 | set(JAVA_FATAL_ERROR "A Java installation is required. Set the JAVA_HOME " |
| 232 | "environment variable to explicitly specify the Java " |
| 233 | "installation directory.") |
| 234 | |
| 235 | # Find the Java Native Interface (JNI) installation. |
| 236 | find_package(JNI ${JDK_MIN_VERSION}) |
| 237 | if(NOT ${JNI_FOUND}) |
| 238 | message(FATAL_ERROR ${JAVA_FATAL_ERROR}) |
| 239 | endif() |
| 240 | |
| 241 | if(OS_MACOSX) |
| 242 | # OS X stores the Java binaries separately from the JNI includes/libraries. |
| 243 | # Find the Java development installation. |
| 244 | find_package(Java ${JDK_MIN_VERSION} COMPONENTS Development) |
| 245 | |
| 246 | if(NOT ${Java_FOUND}) |
| 247 | message(FATAL_ERROR ${JAVA_FATAL_ERROR}) |
| 248 | endif() |
| 249 | |
| 250 | # Determine the root path for the Java installation. |
| 251 | # Remove "bin/javac" from the path. |
| 252 | get_filename_component(JAVA_DIR ${Java_JAVAC_EXECUTABLE} DIRECTORY) |
| 253 | get_filename_component(JAVA_DIR ${JAVA_DIR} DIRECTORY) |
| 254 | else() |
| 255 | # Determine the root path for the Java installation. |
| 256 | # Remove "include" from the path. |
| 257 | get_filename_component(JAVA_DIR ${JAVA_INCLUDE_PATH} DIRECTORY) |
| 258 | endif() |
| 259 | |
| 260 | |
| 261 | # |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 262 | # Post-configuration actions. |
| 263 | # |
| 264 | |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 265 | # Generate the JCEF version header. |
| 266 | message(STATUS "Generating native/jcef_version.h file...") |
| 267 | execute_process( |
| 268 | COMMAND "${PYTHON_EXECUTABLE}" |
| 269 | "tools/make_version_header.py" |
| 270 | "--header" |
| 271 | "native/jcef_version.h" |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 272 | "--cef-path" |
| 273 | "${CEF_ROOT}" |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 274 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 275 | RESULT_VARIABLE EXECUTE_RV |
| 276 | ) |
| 277 | if(NOT EXECUTE_RV STREQUAL "0") |
| 278 | message(FATAL_ERROR "Execution failed with unexpected result: ${EXECUTE_RV}") |
| 279 | endif() |
| 280 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 281 | # Copy the CEF README.txt file to the cmake build directory for use by the |
| 282 | # make_readme.py script. |
| 283 | file(COPY "${CEF_ROOT}/README.txt" DESTINATION "${CMAKE_BINARY_DIR}") |
| 284 | |
Marshall Greenblatt | 99931b2 | 2017-05-18 14:50:10 +0200 | [diff] [blame] | 285 | # Download clang-format from Google Storage. |
| 286 | if(OS_WINDOWS) |
| 287 | set(GS_PLATFORM "win32") |
| 288 | set(GS_HASHPATH "win/clang-format.exe.sha1") |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 289 | set(GS_OUTPATH "win/clang-format.exe") |
Marshall Greenblatt | 99931b2 | 2017-05-18 14:50:10 +0200 | [diff] [blame] | 290 | elseif(OS_MACOSX) |
| 291 | set(GS_PLATFORM "darwin") |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 292 | if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") |
| 293 | set(GS_HASHPATH "mac/clang-format.arm64.sha1") |
| 294 | else() |
| 295 | set(GS_HASHPATH "mac/clang-format.x64.sha1") |
| 296 | endif() |
| 297 | set(GS_OUTPATH "mac/clang-format") |
Marshall Greenblatt | 99931b2 | 2017-05-18 14:50:10 +0200 | [diff] [blame] | 298 | elseif(OS_LINUX) |
| 299 | set(GS_PLATFORM "linux*") |
| 300 | set(GS_HASHPATH "linux64/clang-format.sha1") |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 301 | set(GS_OUTPATH "linux64/clang-format") |
Marshall Greenblatt | 99931b2 | 2017-05-18 14:50:10 +0200 | [diff] [blame] | 302 | endif() |
| 303 | |
| 304 | message(STATUS "Downloading clang-format from Google Storage...") |
| 305 | execute_process( |
| 306 | COMMAND "${PYTHON_EXECUTABLE}" |
| 307 | "tools/buildtools/download_from_google_storage.py" |
| 308 | "--no_resume" |
| 309 | "--platform=${GS_PLATFORM}" |
| 310 | "--no_auth" |
| 311 | "--bucket" "chromium-clang-format" |
| 312 | "-s" "tools/buildtools/${GS_HASHPATH}" |
Marshall Greenblatt | 6a2f6c0 | 2022-10-03 14:46:43 -0400 | [diff] [blame] | 313 | "-o" "tools/buildtools/${GS_OUTPATH}" |
Marshall Greenblatt | 99931b2 | 2017-05-18 14:50:10 +0200 | [diff] [blame] | 314 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 315 | RESULT_VARIABLE EXECUTE_RV |
| 316 | ) |
| 317 | if(NOT EXECUTE_RV STREQUAL "0") |
| 318 | message(FATAL_ERROR "Execution failed with unexpected result: ${EXECUTE_RV}") |
| 319 | endif() |
| 320 | |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 321 | |
| 322 | # |
| 323 | # Include target subdirectories. |
| 324 | # |
| 325 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 326 | add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper) |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 327 | add_subdirectory(native) |
| 328 | |
| 329 | |
| 330 | # |
| 331 | # Display configuration settings. |
| 332 | # |
| 333 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 334 | PRINT_CEF_CONFIG() |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 335 | |
Marshall Greenblatt | 15bf020 | 2016-06-14 16:28:05 -0400 | [diff] [blame] | 336 | message(STATUS "*** JCEF CONFIGURATION SETTINGS ***") |
Marshall Greenblatt | d68c613 | 2015-09-27 15:11:57 +0300 | [diff] [blame] | 337 | message(STATUS "Python executable: ${PYTHON_EXECUTABLE}") |
Marshall Greenblatt | a1e06a4 | 2015-09-24 18:38:18 +0300 | [diff] [blame] | 338 | message(STATUS "Java directory: ${JAVA_DIR}") |
| 339 | message(STATUS "JNI libraries: ${JNI_LIBRARIES}") |
| 340 | message(STATUS "JNI include directories: ${JNI_INCLUDE_DIRS}") |