forked from MaurycyLiebner/enve
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only tested on Linux, will probably need fixes on Windows.
- Loading branch information
Showing
5 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# | ||
# Friction - https://friction.graphics | ||
# | ||
# Copyright (c) Friction contributors | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.9) | ||
|
||
include(ExternalProject) | ||
include(ProcessorCount) | ||
|
||
ProcessorCount(N) | ||
|
||
option(USE_SKIA_SYSTEM_LIBS "Use skia (third-party) system libraries on Linux" ON) | ||
|
||
set(SKIA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/skia") | ||
set(SKIA_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/skia") | ||
|
||
if(${USE_SKIA_SYSTEM_LIBS} AND UNIX) | ||
set(SKIA_ENABLE_EXTERNAL "true") | ||
else() | ||
set(SKIA_ENABLE_EXTERNAL "false") | ||
endif() | ||
|
||
# skia_use_egl= | ||
# skia_use_gl= | ||
# skia_use_x11= | ||
|
||
if(WIN32) | ||
set(GN_PATH ${SKIA_SRC}/bin/gn.exe) | ||
set(SKIA_ARGS_EXTRA --ide=vs) | ||
set(SKIA_BUILD_CMD msbuild all.sln) | ||
set(SKIA_UPDATE_CMD python.exe tools\git-sync-deps) | ||
set(SKIA_ARGS "target_os=\"windows\" host_os=\"win\" current_os=\"win\" target_cpu=\"x64\"") | ||
set(SKIA_ARGS "${SKIA_ARGS} clang_win=\"C:\Program Files\LLVM\" cc=\"clang-cl\" cxx=\"clang-cl\"") | ||
set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\",\"/MD\",\"/O2\"]") | ||
else() | ||
set(GN_PATH ${SKIA_SRC}/bin/gn) | ||
set(SKIA_BUILD_CMD ninja -j${N}) | ||
set(SKIA_UPDATE_CMD true) | ||
set(SKIA_ARGS "ar=\"${CMAKE_AR}\" cc=\"${CMAKE_C_COMPILER}\" cxx=\"${CMAKE_CXX_COMPILER}\"") | ||
set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\"]") | ||
endif() | ||
|
||
set(SKIA_ARGS "${SKIA_ARGS} is_official_build=true is_debug=false") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_enable_pdf=false skia_enable_skottie=false skia_enable_tools=false skia_use_dng_sdk=false") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_expat=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_freetype2=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_libjpeg_turbo=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_libpng=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_libwebp=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_icu=${SKIA_ENABLE_EXTERNAL}") | ||
set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_harfbuzz=${SKIA_ENABLE_EXTERNAL}") | ||
#set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_zlib=${SKIA_ENABLE_EXTERNAL}") | ||
|
||
message("-- skia args: ${SKIA_ARGS}") | ||
|
||
ExternalProject_Add( | ||
Engine | ||
LIST_SEPARATOR "," | ||
SOURCE_DIR ${SKIA_SRC} | ||
BINARY_DIR ${SKIA_BUILD_DIR} | ||
DOWNLOAD_COMMAND true | ||
UPDATE_COMMAND ${SKIA_UPDATE_CMD} | ||
PATCH_COMMAND true | ||
CONFIGURE_COMMAND ${GN_PATH} gen --root=${SKIA_SRC} ${SKIA_BUILD_DIR} "--args=${SKIA_ARGS}" ${SKIA_ARGS_EXTRA} | ||
BUILD_COMMAND ${SKIA_BUILD_CMD} | ||
INSTALL_COMMAND true | ||
USES_TERMINAL_CONFIGURE true | ||
USES_TERMINAL_BUILD true | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters