mirror of
https://github.com/jcefmaven/jcefbuild.git
synced 2025-11-11 11:43:45 +08:00
Proper cmake patching
This commit is contained in:
44
patch/CMakeLists.txt.patch
Normal file
44
patch/CMakeLists.txt.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
# Determine the platform.
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
if("${PROJECT_ARCH}" STREQUAL "arm64")
|
||||
set(CEF_PLATFORM "macosarm64")
|
||||
else()
|
||||
set(CEF_PLATFORM "macosx64")
|
||||
endif()
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
if("${PROJECT_ARCH}" STREQUAL "amd64")
|
||||
set(CEF_PLATFORM "linux64")
|
||||
elseif("${PROJECT_ARCH}" STREQUAL "arm64")
|
||||
set(CEF_PLATFORM "linuxarm64")
|
||||
elseif("${PROJECT_ARCH}" STREQUAL "arm/v6")
|
||||
set(CEF_PLATFORM "linuxarm")
|
||||
else()
|
||||
set(CEF_PLATFORM "linux32")
|
||||
endif()
|
||||
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
||||
#Stolen from Jetbrains jcef repository for the arm64 windows build
|
||||
if(MSVC)
|
||||
include(CheckSymbolExists)
|
||||
|
||||
# MSVC predefines _M_ARM64 for compilations that target ARM64
|
||||
# and _M_AMD64 for compilations that target x86_64.
|
||||
check_symbol_exists("_M_ARM64" "" CEF_PLATFORM_WINARM64)
|
||||
check_symbol_exists("_M_AMD64" "" CEF_PLATFORM_WIN64)
|
||||
|
||||
# We also should set PROJECT_ARCH explicitly because FindCEF.cmake deduces it incorrectly for
|
||||
# cross-compilation cases.
|
||||
if(CEF_PLATFORM_WINARM64)
|
||||
set(CEF_PLATFORM "windowsarm64")
|
||||
set(PROJECT_ARCH "arm64")
|
||||
elseif(CEF_PLATFORM_WIN64)
|
||||
set(CEF_PLATFORM "windows64")
|
||||
set(PROJECT_ARCH "x86_64")
|
||||
else()
|
||||
set(CEF_PLATFORM "windows32")
|
||||
set(PROJECT_ARCH "x86")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Building JCEF for Windows using non-MSVC compiler is not supported.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user