diff --git a/FCHost/CMakeLists.txt b/FCHost/CMakeLists.txt index e8e97f00f283eb4c8419b2a424ef9e1fbac24f5b..d54e523a94771a1177590ed273364744ccb63889 100644 --- a/FCHost/CMakeLists.txt +++ b/FCHost/CMakeLists.txt @@ -24,7 +24,7 @@ # # The below requirements must be met to build this project. # -# - Chromium Embedded Framework (CEF) 76.1.5 or newer. +# - Chromium Embedded Framework (CEF) 89.0 or newer. # # - CMake version 2.8.12.1 or newer. # @@ -33,7 +33,7 @@ # distribution and treat FCHost like tests/cefsimple (from which it is derived). # # - Windows requirements: -# Visual Studio 2015 or newer. +# Visual Studio 2019 or newer. # # BUILD EXAMPLES # @@ -64,24 +64,24 @@ # > ninja cefclient cefsimple # # To perform a Windows build using a 32-bit CEF binary distribution: -# Using the Visual Studio 2015 IDE: -# > cmake -G "Visual Studio 14" .. +# Using the Visual Studio 2019 IDE: +# > cmake -G "Visual Studio 16" .. # Open build\cef.sln in Visual Studio and select Build > Build Solution. # -# Using Ninja with Visual Studio 2015 command-line tools: +# Using Ninja with Visual Studio 2019 command-line tools: # (this path may be different depending on your Visual Studio installation) -# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" +# > "C:\Program Files (x86)\Microsoft Visual Studio 16.0\VC\bin\vcvars32.bat" # > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. # > ninja cefclient cefsimple # # To perform a Windows build using a 64-bit CEF binary distribution: -# Using the Visual Studio 2015 IDE: -# > cmake -G "Visual Studio 14 Win64" .. +# Using the Visual Studio 2019 IDE: +# > cmake -G "Visual Studio 16 Win64" .. # Open build\cef.sln in Visual Studio and select Build > Build Solution. # -# Using Ninja with Visual Studio 2015 command-line tools: +# Using Ninja with Visual Studio 2019 command-line tools: # (this path may be different depending on your Visual Studio installation) -# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" +# > "C:\Program Files (x86)\Microsoft Visual Studio 16.0\VC\bin\amd64\vcvars64.bat" # > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug .. # > ninja cefclient cefsimple diff --git a/FCHost/cmake/cef_macros.cmake b/FCHost/cmake/cef_macros.cmake index 1b667e1cd1c6ea723f16e805589fb16326bf83cd..3ff7c15284f9aa385c81a5bfaf1e3a343e8d63ce 100644 --- a/FCHost/cmake/cef_macros.cmake +++ b/FCHost/cmake/cef_macros.cmake @@ -25,7 +25,7 @@ macro(PRINT_CEF_CONFIG) message(STATUS "Binary distribution root: ${_CEF_ROOT}") - if(OS_MACOSX) + if(OS_MAC) message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}") message(STATUS "Target SDK: ${CEF_TARGET_SDK}") endif() @@ -75,8 +75,8 @@ macro(APPEND_PLATFORM_SOURCES name_of_list) if(OS_WINDOWS AND ${name_of_list}_WINDOWS) list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS}) endif() - if(OS_MACOSX AND ${name_of_list}_MACOSX) - list(APPEND ${name_of_list} ${${name_of_list}_MACOSX}) + if(OS_MAC AND ${name_of_list}_MAC) + list(APPEND ${name_of_list} ${${name_of_list}_MAC}) endif() endmacro() @@ -184,10 +184,10 @@ endif(OS_LINUX) # Mac OS X macros. # -if(OS_MACOSX) +if(OS_MAC) # Manually process and copy over resource files. -macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path) +macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path) foreach(FILENAME ${resource_list}) # Remove one or more prefixes from the source paths. set(TARGET_FILENAME "${FILENAME}") @@ -229,7 +229,7 @@ macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path endforeach() endmacro() -endif(OS_MACOSX) +endif(OS_MAC) # @@ -298,7 +298,7 @@ macro(SET_COMMON_TARGET_PROPERTIES target) set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str}) endif() - if(OS_MACOSX) + if(OS_MAC) # Set Xcode target properties. set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO diff --git a/FCHost/cmake/cef_variables.cmake b/FCHost/cmake/cef_variables.cmake index 079e885ce10254032c54253506a61c91099c74bd..fb9552428e8acd4f38eba149e3bbc569a11aceee 100644 --- a/FCHost/cmake/cef_variables.cmake +++ b/FCHost/cmake/cef_variables.cmake @@ -14,7 +14,8 @@ endif() # Determine the platform. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - set(OS_MACOSX 1) + set(OS_MAC 1) + set(OS_MACOSX 1) # For backwards compatibility. set(OS_POSIX 1) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(OS_LINUX 1) @@ -25,13 +26,15 @@ endif() # Determine the project architecture. if(NOT DEFINED PROJECT_ARCH) - if(CMAKE_SIZEOF_VOID_P MATCHES 8) + if(OS_WINDOWS AND "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64") + set(PROJECT_ARCH "arm64") + elseif(CMAKE_SIZEOF_VOID_P MATCHES 8) set(PROJECT_ARCH "x86_64") else() set(PROJECT_ARCH "x86") endif() - if(OS_MACOSX) + if(OS_MAC) # PROJECT_ARCH should be specified on Mac OS X. message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}") endif() @@ -60,7 +63,7 @@ set(CEF_LIBCEF_DLL_WRAPPER_PATH "${_CEF_ROOT}/libcef_dll") # Shared compiler/linker flags. list(APPEND CEF_COMPILER_DEFINES - # Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't + # Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't # in the C++ standard (e.g. UINT8_MAX, INT64_MIN, etc) __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS ) @@ -218,7 +221,6 @@ if(OS_LINUX) libcef.so libEGL.so libGLESv2.so - natives_blob.bin snapshot_blob.bin v8_context_snapshot.bin swiftshader @@ -247,7 +249,7 @@ endif() # Mac OS X configuration. # -if(OS_MACOSX) +if(OS_MAC) # Platform-specific compiler/linker flags. # See also Xcode target properties in cef_macros.cmake. set(CEF_LIBTYPE SHARED) @@ -311,7 +313,7 @@ if(OS_MACOSX) # Find the newest available base SDK. execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) - foreach(OS_VERSION 10.11 10.10 10.9) + foreach(OS_VERSION 10.15 10.14 10.13 10.12 10.11) set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk") if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}") set(CMAKE_OSX_SYSROOT ${SDK}) @@ -319,7 +321,7 @@ if(OS_MACOSX) endforeach() # Target SDK. - set(CEF_TARGET_SDK "10.9") + set(CEF_TARGET_SDK "10.11") list(APPEND CEF_COMPILER_FLAGS -mmacosx-version-min=${CEF_TARGET_SDK} ) @@ -328,10 +330,15 @@ if(OS_MACOSX) # Target architecture. if(PROJECT_ARCH STREQUAL "x86_64") set(CMAKE_OSX_ARCHITECTURES "x86_64") + elseif(PROJECT_ARCH STREQUAL "arm64") + set(CMAKE_OSX_ARCHITECTURES "arm64") else() set(CMAKE_OSX_ARCHITECTURES "i386") endif() + # Prevent Xcode 11 from doing automatic codesigning. + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "") + # CEF directory paths. set(CEF_BINARY_DIR "${_CEF_ROOT}/$<CONFIGURATION>") set(CEF_BINARY_DIR_DEBUG "${_CEF_ROOT}/Debug") @@ -346,6 +353,15 @@ if(OS_MACOSX) set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a") set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a") endif() + + # CEF Helper app suffixes. + # Format is "<name suffix>:<target suffix>:<plist suffix>". + set(CEF_HELPER_APP_SUFFIXES + "::" + " (GPU):_gpu:.gpu" + " (Plugin):_plugin:.plugin" + " (Renderer):_renderer:.renderer" + ) endif() @@ -364,22 +380,8 @@ if(OS_WINDOWS) if(USE_SANDBOX) # Check if the current MSVC version is compatible with the cef_sandbox.lib - # static library. For a list of all version numbers see - # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering - list(APPEND supported_msvc_versions - 1900 # VS2015 and updates 1, 2, & 3 - 1910 # VS2017 version 15.1 & 15.2 - 1911 # VS2017 version 15.3 & 15.4 - 1912 # VS2017 version 15.5 - 1913 # VS2017 version 15.6 - 1914 # VS2017 version 15.7 - 1915 # VS2017 version 15.8 - 1916 # VS2017 version 15.9 - 1920 # VS2019 version 16.0 - 1921 # VS2018 version 16.1 - ) - list(FIND supported_msvc_versions ${MSVC_VERSION} _index) - if (${_index} EQUAL -1) + # static library. We require VS2015 or newer. + if(MSVC_VERSION LESS 1900) message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})") set(USE_SANDBOX OFF) endif() @@ -462,7 +464,6 @@ if(OS_WINDOWS) # List of CEF binary files. set(CEF_BINARY_FILES chrome_elf.dll - d3dcompiler_47.dll libcef.dll libEGL.dll libGLESv2.dll @@ -471,6 +472,12 @@ if(OS_WINDOWS) swiftshader ) + if(NOT PROJECT_ARCH STREQUAL "arm64") + list(APPEND CEF_BINARY_FILES + d3dcompiler_47.dll + ) + endif() + # List of CEF resource files. set(CEF_RESOURCE_FILES cef.pak @@ -490,8 +497,15 @@ if(OS_WINDOWS) # Libraries required by cef_sandbox.lib. set(CEF_SANDBOX_STANDARD_LIBS + Advapi32.lib dbghelp.lib + Delayimp.lib + OleAut32.lib + PowrProf.lib + Propsys.lib psapi.lib + SetupAPI.lib + Shell32.lib version.lib wbemuuid.lib winmm.lib diff --git a/FCHost/cmake_vs2015.bat b/FCHost/cmake_vs2015.bat deleted file mode 100644 index 2f63e4e5fa051862946ed8e27c57fe6c42cf7365..0000000000000000000000000000000000000000 --- a/FCHost/cmake_vs2015.bat +++ /dev/null @@ -1,5 +0,0 @@ -@ECHO OFF -REM Quickly rebuild 64-bit VS2015 solution/project files from the CMake files. - -cmake -G "Visual Studio 14 Win64" -pause \ No newline at end of file diff --git a/FCHost/cmake_vs2019.bat b/FCHost/cmake_vs2019.bat new file mode 100644 index 0000000000000000000000000000000000000000..a3630349e29820ba7e427a9bc5be21204065e993 --- /dev/null +++ b/FCHost/cmake_vs2019.bat @@ -0,0 +1,5 @@ +@ECHO OFF +REM Quickly rebuild 64-bit VS2019 solution/project files from the CMake files. + +cmake -G "Visual Studio 16" -A x64 +pause \ No newline at end of file