diff options
author | crupest <crupest@outlook.com> | 2019-03-31 15:02:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-31 15:02:22 +0800 |
commit | 877f65e2e2c40eecc7cfeb194dc9d391af60711b (patch) | |
tree | 3d229f451aef6f551df3558cdf2e5d9cba586d5a | |
parent | 4c32118df08223dac19f3cf0b10bf187275f0d94 (diff) | |
download | cru-877f65e2e2c40eecc7cfeb194dc9d391af60711b.tar.gz cru-877f65e2e2c40eecc7cfeb194dc9d391af60711b.tar.bz2 cru-877f65e2e2c40eecc7cfeb194dc9d391af60711b.zip |
Remove skia.
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | azure-pipelines.yml | 13 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/build.py | 79 |
5 files changed, 11 insertions, 107 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f932f0d..df3e99f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,23 +2,6 @@ cmake_minimum_required(VERSION 3.12) # use 3.12 because VS internal cmake is 3.1 project(CruUI) - -if(NOT CRU_CPU_ARCH) - set(CRU_CPU_ARCH x64) - message(STATUS "CPU arch not specified, use x64.") -endif() - set(CMAKE_CXX_STANDARD 17) -add_library(skia STATIC IMPORTED) -if(${CRU_SKIA_USE_CLANG}) - set_target_properties(skia PROPERTIES IMPORTED_LOCATION_DEBUG ${PROJECT_SOURCE_DIR}/skia/out/Debug_${CRU_CPU_ARCH}_clang/skia.lib - IMPORTED_LOCATION_RELEASE ${PROJECT_SOURCE_DIR}/skia/out/Release_${CRU_CPU_ARCH}_clang/skia.lib) -else() - set_target_properties(skia PROPERTIES IMPORTED_LOCATION_DEBUG ${PROJECT_SOURCE_DIR}/skia/out/Debug_${CRU_CPU_ARCH}/skia.lib - IMPORTED_LOCATION_RELEASE ${PROJECT_SOURCE_DIR}/skia/out/Release_${CRU_CPU_ARCH}/skia.lib) -endif() - -target_include_directories(skia INTERFACE skia/include) - add_subdirectory(src) @@ -4,17 +4,13 @@ ## overview -CruUI is a UI library using [*skia*](https://skia.org/). +CruUI is a UI library. It is **under construction**. ## build -Set python**2** on path to allow skia build tool work. Use python**3** to run `tool/build.py`. Run with `-h` to see the options. - -Notice: x86 is **not** currently supported! - -Tips: You can run the build script with `--only-skia` to build the skia dependency fisrt. Then feel free to open an ide and edit the source code of cruui and build it with command in ide. +Use python3 to run `tool/build.py`. Run with `-h` to see the options. ## structure of repository diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 15b320af..d4824188 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,13 +7,12 @@ jobs: vmImage: 'VS2017-Win2016' strategy: matrix: -# currently x86 not work because fuck skia build system -# x86_debug: -# buildPlatform: 'x86' -# buildConfiguration: 'Debug' -# x86_release: -# buildPlatform: 'x86' -# buildConfiguration: 'Release' + x86_debug: + buildPlatform: 'x86' + buildConfiguration: 'Debug' + x86_release: + buildPlatform: 'x86' + buildConfiguration: 'Release' x64_debug: buildPlatform: 'x64' buildConfiguration: 'Debug' diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63faca66..b89e5202 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -25,7 +25,6 @@ add_library(cru_ui STATIC target_include_directories(cru_ui PUBLIC .) -target_link_libraries(cru_ui PUBLIC skia) if(WIN32) target_link_libraries(cru_ui PRIVATE D3D11 D2d1 DWrite) diff --git a/tools/build.py b/tools/build.py index 186099e9..ec71fc87 100644 --- a/tools/build.py +++ b/tools/build.py @@ -9,80 +9,12 @@ parser.add_argument('-a', '--arch', choices=['x86', 'x64'], default='x64', help='specify target cpu architecture') parser.add_argument('-c', '--config', choices=['Debug', 'Release'], required=True, help='specify build configuration') -parser.add_argument('--only-skia', action='store_true', - help='when this option is specified, only skia is built') -parser.add_argument('--clang-build-skia', action='store_true', - help='whether use clang to build skia') args = parser.parse_args() -class ConflictArgumentError(Exception): - def __init__(self, message): - self.message = message - - -if args.arch == 'x86' and args.clang_build_skia: - raise ConflictArgumentError('clang does not support to build skia in x86') - project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) -def detect_ninja(): - try: - subprocess.check_call('ninja --version') - except: - print('No ninja, install ninja.') - subprocess.check_call('choco install ninja', - stdout=sys.stdout, stderr=sys.stderr) - - -def build_skia(): - os.chdir(project_root) - - detect_ninja() - - subprocess.check_call('py -2 .\\skia\\tools\\git-sync-deps', - stdout=sys.stdout, stderr=sys.stderr) - - gn_args = ''' - is_debug = {debug} - - skia_enable_ccpr = false - skia_enable_discrete_gpu = false - skia_enable_gpu = false - skia_enable_nvpr = false - skia_enable_particles = false - skia_enable_pdf = false - skia_enable_skottie = false - skia_use_dng_sdk = false - skia_use_lua = false - skia_use_sfntly = false - skia_use_xps = false - '''.format(debug='true' if args.config == 'Debug' else 'false') - - if args.arch == 'x86': - gn_args += 'target_cpu="x86"\n' - - if args.clang_build_skia: - gn_args += 'clang_win = "C:/Program Files/LLVM"\n' - - out_dir = '{}_{}'.format(args.config, args.arch) - if args.clang_build_skia: - out_dir += '_clang' - - os.makedirs("skia/out/{}".format(out_dir), exist_ok=True) - gn_arg_file_path = os.path.join( - project_root, 'skia/out', out_dir, 'args.gn') - - with open(gn_arg_file_path, 'w+') as f: - f.write(gn_args) - - os.chdir('./skia') - subprocess.check_call('.\\bin\\gn.exe gen .\\out\\{}\\'.format( - out_dir), stdout=sys.stdout, stderr=sys.stderr) - subprocess.check_call('ninja -C .\\out\\{} skia'.format(out_dir)) - - def build_cru_ui(): os.chdir(project_root) @@ -93,17 +25,12 @@ def build_cru_ui(): 'x64': 'x64' } - subprocess.run('cmake -S . -B build -G "Visual Studio 15 2017" -A {arch} {clang}' - .format(arch=generater_vs_arch_map[args.arch], - clang="-DCRU_SKIA_USE_CLANG=TRUE" if args.clang_build_skia else ""), + subprocess.run('cmake -S . -B build -G "Visual Studio 15 2017" -A {arch}' + .format(arch=generater_vs_arch_map[args.arch]), stdout=sys.stdout, stderr=sys.stderr) subprocess.run('cmake --build build --target ALL_BUILD --config {config}'.format(config=args.config), stdout=sys.stdout, stderr=sys.stderr) -if args.only_skia: - build_skia() -else: - build_skia() - build_cru_ui() +build_cru_ui() |