mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Compare commits
11 Commits
068cf29e67
...
v6.1.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
784f53fd7e | ||
|
|
799d8a267e | ||
|
|
f4513702b0 | ||
|
|
ba6716c6e1 | ||
|
|
694fa6bf5c | ||
|
|
625915b52c | ||
|
|
2d4c114008 | ||
|
|
aa80d8bac9 | ||
|
|
bcdcf70348 | ||
|
|
4231c4903b | ||
|
|
10d73d365f |
@@ -1,25 +1,24 @@
|
|||||||
# Copyright 2025 Arthur Sonzogni. All rights reserved.
|
# Copyright 2025 Arthur Sonzogni. All rights reserved.
|
||||||
# Use of this source code is governed by the MIT license that can be found in
|
# Use of this source code is governed by the MIT license that can be found in
|
||||||
# the LICENSE file.
|
# the LICENSE file.
|
||||||
bcr_test_module:
|
|
||||||
module_path: "."
|
|
||||||
matrix:
|
matrix:
|
||||||
platform: [
|
platform:
|
||||||
"debian11",
|
- centos7
|
||||||
"macos",
|
- debian10
|
||||||
"macos-arm64",
|
- ubuntu2004
|
||||||
"ubuntu2204",
|
- macos
|
||||||
"windows",
|
- windows
|
||||||
]
|
bazel: [6.x, 7.x, 8.x]
|
||||||
bazel: [
|
|
||||||
6.x,
|
|
||||||
7.x,
|
|
||||||
8.x,
|
|
||||||
]
|
|
||||||
tasks:
|
tasks:
|
||||||
run_tests:
|
verify_targets:
|
||||||
name: "Run test module"
|
name: Build and test.
|
||||||
platform: ${{ platform }}
|
platform: ${{ platform }}
|
||||||
bazel: ${{ bazel }}
|
bazel: ${{ bazel }}
|
||||||
|
build_targets:
|
||||||
|
- '@ftxui//:ftxui'
|
||||||
|
- '@ftxui//:screen'
|
||||||
|
- '@ftxui//:dom'
|
||||||
|
- '@ftxui//:component'
|
||||||
test_targets:
|
test_targets:
|
||||||
- "//..."
|
- '@ftxui//:tests'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"integrity": "",
|
"integrity": "",
|
||||||
"strip_prefix": "{REPO}-{VERSION}",
|
"strip_prefix": "",
|
||||||
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
|
"url": "https://github.com/ArthurSonzogni/FTXUI/releases/download/{TAG}/source.tar.gz"
|
||||||
}
|
}
|
||||||
|
|||||||
126
.github/workflows/build.yaml
vendored
126
.github/workflows/build.yaml
vendored
@@ -1,10 +1,12 @@
|
|||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
create:
|
# On new commits to main:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
# On pull requests:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -12,7 +14,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
test_bazel:
|
test_bazel:
|
||||||
name: "Test Bazel"
|
name: "Bazel, ${{ matrix.compiler }}, ${{ matrix.os }}"
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -44,7 +46,7 @@ jobs:
|
|||||||
run: bazel run tests
|
run: bazel run tests
|
||||||
|
|
||||||
test_cmake:
|
test_cmake:
|
||||||
name: "Tests CMake"
|
name: "CMake, ${{ matrix.compiler }}, ${{ matrix.os }}"
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -152,121 +154,3 @@ jobs:
|
|||||||
flags: ${{ runner.os }}
|
flags: ${{ runner.os }}
|
||||||
name: ${{ runner.os }}-coverage
|
name: ${{ runner.os }}-coverage
|
||||||
files: ./build/coverage.xml
|
files: ./build/coverage.xml
|
||||||
|
|
||||||
# Create a release on new v* tags
|
|
||||||
release:
|
|
||||||
needs:
|
|
||||||
- test_cmake
|
|
||||||
- test_bazel
|
|
||||||
if: ${{ github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v') }}
|
|
||||||
name: "Create release"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
steps:
|
|
||||||
- name: "Create release"
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: true
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
# Build artifact for the release
|
|
||||||
package:
|
|
||||||
name: "Build packages"
|
|
||||||
needs: release
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
asset_path: build/ftxui*Linux*
|
|
||||||
- os: macos-latest
|
|
||||||
asset_path: build/ftxui*Darwin*
|
|
||||||
- os: windows-latest
|
|
||||||
asset_path: build/ftxui*Win64*
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Get number of CPU cores
|
|
||||||
uses: SimenB/github-actions-cpu-cores@v1
|
|
||||||
id: cpu-cores
|
|
||||||
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Install cmake"
|
|
||||||
uses: lukka/get-cmake@latest
|
|
||||||
|
|
||||||
- name: "Build packages"
|
|
||||||
run: >
|
|
||||||
mkdir build;
|
|
||||||
cd build;
|
|
||||||
cmake ..
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
-DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }}
|
|
||||||
-DFTXUI_BUILD_DOCS=OFF
|
|
||||||
-DFTXUI_BUILD_EXAMPLES=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
|
||||||
-DFTXUI_ENABLE_INSTALL=ON
|
|
||||||
-DFTXUI_DEV_WARNINGS=ON ;
|
|
||||||
cmake --build . --target package;
|
|
||||||
|
|
||||||
- uses: shogo82148/actions-upload-release-asset@v1
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
|
||||||
asset_path: ${{ matrix.asset_path }}
|
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
documentation:
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Checkout repository"
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: "Install cmake"
|
|
||||||
uses: lukka/get-cmake@latest
|
|
||||||
|
|
||||||
- name: "Install emsdk"
|
|
||||||
uses: mymindstorm/setup-emsdk@v7
|
|
||||||
|
|
||||||
- name: "Install Doxygen/Graphviz"
|
|
||||||
run: >
|
|
||||||
sudo apt-get update;
|
|
||||||
sudo apt-get install doxygen graphviz;
|
|
||||||
|
|
||||||
- name: "Build documentation"
|
|
||||||
run: >
|
|
||||||
mkdir build;
|
|
||||||
cd build;
|
|
||||||
emcmake cmake ..
|
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
|
||||||
-DFTXUI_BUILD_DOCS=ON
|
|
||||||
-DFTXUI_BUILD_EXAMPLES=ON
|
|
||||||
-DFTXUI_BUILD_TESTS=OFF
|
|
||||||
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
|
||||||
-DFTXUI_ENABLE_INSTALL=OFF
|
|
||||||
-DFTXUI_DEV_WARNINGS=ON ;
|
|
||||||
cmake --build . --target doc;
|
|
||||||
cmake --build . ;
|
|
||||||
rsync -amv
|
|
||||||
--include='*/'
|
|
||||||
--include='*.html'
|
|
||||||
--include='*.css'
|
|
||||||
--include='*.mjs'
|
|
||||||
--include='*.js'
|
|
||||||
--include='*.wasm'
|
|
||||||
--exclude='*'
|
|
||||||
examples
|
|
||||||
doc/doxygen/html;
|
|
||||||
|
|
||||||
- name: "Deploy"
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: build/doc/doxygen/html/
|
|
||||||
enable_jekyll: false
|
|
||||||
allow_empty_commit: false
|
|
||||||
force_orphan: true
|
|
||||||
publish_branch: gh-pages
|
|
||||||
|
|||||||
60
.github/workflows/documentation.yaml
vendored
Normal file
60
.github/workflows/documentation.yaml
vendored
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
name: Documentation
|
||||||
|
|
||||||
|
on:
|
||||||
|
# On new commits to main:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
documentation:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: "Checkout repository"
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Install cmake"
|
||||||
|
uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
|
- name: "Install emsdk"
|
||||||
|
uses: mymindstorm/setup-emsdk@v7
|
||||||
|
|
||||||
|
- name: "Install Doxygen/Graphviz"
|
||||||
|
run: >
|
||||||
|
sudo apt-get update;
|
||||||
|
sudo apt-get install doxygen graphviz;
|
||||||
|
|
||||||
|
- name: "Build documentation"
|
||||||
|
run: >
|
||||||
|
mkdir build;
|
||||||
|
cd build;
|
||||||
|
emcmake cmake ..
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
-DFTXUI_BUILD_DOCS=ON
|
||||||
|
-DFTXUI_BUILD_EXAMPLES=ON
|
||||||
|
-DFTXUI_BUILD_TESTS=OFF
|
||||||
|
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
||||||
|
-DFTXUI_ENABLE_INSTALL=OFF
|
||||||
|
-DFTXUI_DEV_WARNINGS=ON ;
|
||||||
|
cmake --build . --target doc;
|
||||||
|
cmake --build . ;
|
||||||
|
rsync -amv
|
||||||
|
--include='*/'
|
||||||
|
--include='*.html'
|
||||||
|
--include='*.css'
|
||||||
|
--include='*.mjs'
|
||||||
|
--include='*.js'
|
||||||
|
--include='*.wasm'
|
||||||
|
--exclude='*'
|
||||||
|
examples
|
||||||
|
doc/doxygen/html;
|
||||||
|
|
||||||
|
- name: "Deploy"
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: build/doc/doxygen/html/
|
||||||
|
enable_jekyll: false
|
||||||
|
allow_empty_commit: false
|
||||||
|
force_orphan: true
|
||||||
|
publish_branch: gh-pages
|
||||||
24
.github/workflows/publish.yaml
vendored
Normal file
24
.github/workflows/publish.yaml
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
name: "Publish to Bazel Central Registry"
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Manual kick-off (you type the tag)
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_name:
|
||||||
|
description: "Tag to publish"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.event.inputs.tag_name }}
|
||||||
|
registry_fork: ArthurSonzogni/bazel-central-registry
|
||||||
|
attest: false
|
||||||
|
|
||||||
|
secrets:
|
||||||
|
publish_token: ${{ secrets.PUBLISH_TOKEN }}
|
||||||
28
.github/workflows/publish_to_bcr.yaml
vendored
28
.github/workflows/publish_to_bcr.yaml
vendored
@@ -1,28 +0,0 @@
|
|||||||
on:
|
|
||||||
# Run the publish workflow after a successful release.
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
# Allow manual triggering of the workflow.
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag_name:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@[version]
|
|
||||||
with:
|
|
||||||
tag_name: ${{ inputs.tag_name }}
|
|
||||||
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
|
|
||||||
registry_fork: ArthurSonzogni/bazel-central-registry
|
|
||||||
permissions:
|
|
||||||
attestations: write
|
|
||||||
contents: write
|
|
||||||
id-token: write
|
|
||||||
secrets:
|
|
||||||
publish_token: ${{ secrets.PUBLISH_TOKEN }}
|
|
||||||
100
.github/workflows/release.yaml
vendored
Normal file
100
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
# On push to a tag:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
# On manual trigger:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
# Needed to mint attestations
|
||||||
|
id-token: write
|
||||||
|
attestations: write
|
||||||
|
# Needed to upload release assets
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: "Create release"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
steps:
|
||||||
|
- name: "Create release"
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
id: create_release
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Build artifact for the release
|
||||||
|
package_compiled:
|
||||||
|
name: "Build packages"
|
||||||
|
needs: release
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
asset_path: build/ftxui*Linux*
|
||||||
|
- os: macos-latest
|
||||||
|
asset_path: build/ftxui*Darwin*
|
||||||
|
- os: windows-latest
|
||||||
|
asset_path: build/ftxui*Win64*
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Get number of CPU cores
|
||||||
|
uses: SimenB/github-actions-cpu-cores@v1
|
||||||
|
id: cpu-cores
|
||||||
|
|
||||||
|
- name: "Checkout repository"
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Install cmake"
|
||||||
|
uses: lukka/get-cmake@latest
|
||||||
|
|
||||||
|
- name: "Build packages"
|
||||||
|
run: >
|
||||||
|
mkdir build;
|
||||||
|
cd build;
|
||||||
|
cmake ..
|
||||||
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
-DCMAKE_BUILD_PARALLEL_LEVEL=${{ steps.cpu-cores.outputs.count }}
|
||||||
|
-DFTXUI_BUILD_DOCS=OFF
|
||||||
|
-DFTXUI_BUILD_EXAMPLES=OFF
|
||||||
|
-DFTXUI_BUILD_TESTS=OFF
|
||||||
|
-DFTXUI_BUILD_TESTS_FUZZER=OFF
|
||||||
|
-DFTXUI_ENABLE_INSTALL=ON
|
||||||
|
-DFTXUI_DEV_WARNINGS=ON ;
|
||||||
|
cmake --build . --target package;
|
||||||
|
|
||||||
|
- uses: shogo82148/actions-upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
|
asset_path: ${{ matrix.asset_path }}
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
|
# Build "source" artifact for the release. This is the same as the github
|
||||||
|
# "source" archive, but with a stable URL. This is useful for the Bazel
|
||||||
|
# Central Repository.
|
||||||
|
package_source:
|
||||||
|
name: "Build source package"
|
||||||
|
needs: release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: "Checkout repository"
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Create source package"
|
||||||
|
run: >
|
||||||
|
git archive --format=tar.gz -o source.tar.gz HEAD
|
||||||
|
|
||||||
|
- name: "Upload source package"
|
||||||
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||||
|
asset_path: source.tar.gz
|
||||||
|
overwrite: true
|
||||||
14
BUILD.bazel
14
BUILD.bazel
@@ -3,13 +3,9 @@
|
|||||||
# the LICENSE file.
|
# the LICENSE file.
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# - Windows/MSVC support.
|
# - Build benchmark.
|
||||||
# - Pass /utf-8 to MSVC users depending on FTXUI.
|
# - Build fuzzers.
|
||||||
# - Pass "FTXUI_MICROSOFT_TERMINAL_FALLBACK" to windows users.
|
# - Build documentation.
|
||||||
# - Support building benchmark.
|
|
||||||
# - Support building examples.
|
|
||||||
# - Support building fuzzer.
|
|
||||||
# - Support building documentation.
|
|
||||||
# - Enable the two tests timing out.
|
# - Enable the two tests timing out.
|
||||||
# - Support WebAssembly
|
# - Support WebAssembly
|
||||||
|
|
||||||
@@ -17,7 +13,7 @@ load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
|||||||
load(":bazel/ftxui.bzl", "ftxui_cc_library")
|
load(":bazel/ftxui.bzl", "ftxui_cc_library")
|
||||||
load(":bazel/ftxui.bzl", "generate_examples")
|
load(":bazel/ftxui.bzl", "generate_examples")
|
||||||
load(":bazel/ftxui.bzl", "cpp20")
|
load(":bazel/ftxui.bzl", "cpp20")
|
||||||
load(":bazel/ftxui.bzl", "msvc_copts")
|
load(":bazel/ftxui.bzl", "windows_copts")
|
||||||
load(":bazel/ftxui.bzl", "pthread_linkopts")
|
load(":bazel/ftxui.bzl", "pthread_linkopts")
|
||||||
|
|
||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
@@ -245,7 +241,7 @@ cc_test(
|
|||||||
"include",
|
"include",
|
||||||
"src",
|
"src",
|
||||||
],
|
],
|
||||||
copts = cpp20() + msvc_copts(),
|
copts = cpp20() + windows_copts(),
|
||||||
deps = [
|
deps = [
|
||||||
"//:ftxui",
|
"//:ftxui",
|
||||||
"@googletest//:gtest_main",
|
"@googletest//:gtest_main",
|
||||||
|
|||||||
30
CHANGELOG.md
30
CHANGELOG.md
@@ -1,11 +1,35 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Next release (2025-04-01)
|
Future release
|
||||||
-------------------------
|
------------
|
||||||
|
|
||||||
|
6.1.8 (2025-05-01)
|
||||||
|
------------------
|
||||||
|
|
||||||
### Build
|
### Build
|
||||||
- Feature: Support `bazel`. See #1032. Proposed by @kcc.
|
- Feature: Support `bazel` build system. See #1032.
|
||||||
|
Proposed by Kostya Serebryany @kcc
|
||||||
|
If all goes well (pending), it should appear in the Bazel central repository.
|
||||||
|
It can be imported into your project using the following lines:
|
||||||
|
|
||||||
|
**MODULE.bazel**
|
||||||
|
```bazel
|
||||||
|
bazel_dep(name = "ftxui", version = "6.1.8")
|
||||||
|
```
|
||||||
|
|
||||||
|
**BUILD.bazel**
|
||||||
|
```bazel
|
||||||
|
deps = [
|
||||||
|
// Depend on the whole library:
|
||||||
|
"@ftxui//:ftxui",
|
||||||
|
|
||||||
|
// Choose a specific submodule:
|
||||||
|
"@ftxui//:component",
|
||||||
|
"@ftxui//:dom",
|
||||||
|
"@ftxui//:screen",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
### Component
|
### Component
|
||||||
- Bugfix: Fix a crash with ResizeableSplit. See #1023.
|
- Bugfix: Fix a crash with ResizeableSplit. See #1023.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
|
|||||||
|
|
||||||
project(ftxui
|
project(ftxui
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
VERSION 6.0.2
|
VERSION 6.1.8
|
||||||
DESCRIPTION "C++ Functional Terminal User Interface."
|
DESCRIPTION "C++ Functional Terminal User Interface."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# the LICENSE file.
|
# the LICENSE file.
|
||||||
|
|
||||||
# FTXUI Module.
|
# FTXUI Module.
|
||||||
module(name = "ftxui", version = "6.0.3")
|
module(name = "ftxui", version = "6.1.8")
|
||||||
|
|
||||||
# Build deps.
|
# Build deps.
|
||||||
bazel_dep(name = "rules_cc", version = "0.1.1")
|
bazel_dep(name = "rules_cc", version = "0.1.1")
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ include(FetchContent)
|
|||||||
|
|
||||||
FetchContent_Declare(ftxui
|
FetchContent_Declare(ftxui
|
||||||
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
|
||||||
GIT_TAG v6.0.2
|
GIT_TAG v6.1.8
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_GetProperties(ftxui)
|
FetchContent_GetProperties(ftxui)
|
||||||
|
|||||||
@@ -20,23 +20,42 @@ def cpp20():
|
|||||||
"//conditions:default": ["-std=c++20"],
|
"//conditions:default": ["-std=c++20"],
|
||||||
})
|
})
|
||||||
|
|
||||||
def msvc_copts():
|
# Microsoft terminal is a bit buggy ¯\_(ツ)_/¯ and MSVC uses bad defaults.
|
||||||
|
def windows_copts():
|
||||||
MSVC_COPTS = [
|
MSVC_COPTS = [
|
||||||
# Force Microsoft Visual Studio to decode sources files in UTF-8.
|
# Microsoft Visual Studio must decode sources files as UTF-8.
|
||||||
"/utf-8",
|
"/utf-8",
|
||||||
|
|
||||||
# Force Microsoft Visual Studio to interpret the source files as
|
# Microsoft Visual Studio must interpret the codepoint using unicode.
|
||||||
# Unicode.
|
|
||||||
"/DUNICODE",
|
"/DUNICODE",
|
||||||
"/D_UNICODE",
|
"/D_UNICODE",
|
||||||
|
|
||||||
# Fallback for Microsoft Terminal.
|
# Fallback for Microsoft Terminal.
|
||||||
|
# This
|
||||||
|
# - Replace missing font symbols by others.
|
||||||
|
# - Reduce screen position pooling frequency to deals against a Microsoft
|
||||||
|
# race condition. This was fixed in 2020, but clients never not updated.
|
||||||
|
# - https://github.com/microsoft/terminal/pull/7583
|
||||||
|
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
|
||||||
"/DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
|
"/DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
WINDOWS_COPTS = [
|
||||||
|
# Fallback for Microsoft Terminal.
|
||||||
|
# This
|
||||||
|
# - Replace missing font symbols by others.
|
||||||
|
# - Reduce screen position pooling frequency to deals against a Microsoft
|
||||||
|
# race condition. This was fixed in 2020, but clients never not updated.
|
||||||
|
# - https://github.com/microsoft/terminal/pull/7583
|
||||||
|
# - https://github.com/ArthurSonzogni/FTXUI/issues/136
|
||||||
|
"-DFTXUI_MICROSOFT_TERMINAL_FALLBACK",
|
||||||
|
];
|
||||||
|
|
||||||
return select({
|
return select({
|
||||||
|
# MSVC:
|
||||||
"@rules_cc//cc/compiler:msvc-cl": MSVC_COPTS,
|
"@rules_cc//cc/compiler:msvc-cl": MSVC_COPTS,
|
||||||
"@rules_cc//cc/compiler:clang-cl": MSVC_COPTS,
|
"@rules_cc//cc/compiler:clang-cl": MSVC_COPTS,
|
||||||
|
"@platforms//os:windows": WINDOWS_COPTS,
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -69,10 +88,12 @@ def ftxui_cc_library(
|
|||||||
"include",
|
"include",
|
||||||
"src",
|
"src",
|
||||||
],
|
],
|
||||||
copts = cpp17() + msvc_copts(),
|
copts = cpp17() + windows_copts(),
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Compile all the examples in the examples/ directory.
|
||||||
|
# This is useful to check the Bazel is synchronized with CMake definitions.
|
||||||
def generate_examples():
|
def generate_examples():
|
||||||
cpp_files = native.glob(["examples/**/*.cpp"])
|
cpp_files = native.glob(["examples/**/*.cpp"])
|
||||||
|
|
||||||
@@ -90,5 +111,5 @@ def generate_examples():
|
|||||||
name = name,
|
name = name,
|
||||||
srcs = [src],
|
srcs = [src],
|
||||||
deps = ["//:component"],
|
deps = ["//:component"],
|
||||||
copts = cpp20() + msvc_copts(),
|
copts = cpp20() + windows_copts(),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user