Skip to content

Commit

Permalink
Retire ibis color (#62) (#65)
Browse files Browse the repository at this point in the history
Retirement of the ibis::color code base
- retired ibis::color
- add quick&dirty replacement with {fmt} lib, the 'printing' API needs to be reconsidered
- minor information added to docs
- fmt lib replaced by std::format where possible
- add ToDo tree labels for CMake (.vscode/settings)
  • Loading branch information
ibis-hdl authored Dec 27, 2024
1 parent f042321 commit 7b8f4d8
Show file tree
Hide file tree
Showing 48 changed files with 275 additions and 1,497 deletions.
14 changes: 8 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"BUG", "HACK", "FIXME", "TODO", "XXX",
"@todo", "@fixme",
"FixMe [C++20]", "FixMe: [C++20]", "@todo [C++20]",
"FixMe [C++23]", "FixMe: [C++20]", "@todo [C++23]",
"FixMe [C++23]", "FixMe: [C++23]", "@todo [C++23]",
"FixMe [CMake]", "ToDo [CMake]", "@fixme [CMake]", "@todo [CMake]",
"<<<<<<<"
],
"todo-tree.general.tagGroups": {
Expand All @@ -61,6 +62,9 @@
"FixMe [C++20]", "FixMe: [C++20]", "@todo [C++20]",
"FixMe [C++23]", "FixMe: [C++20]", "@todo [C++23]",
],
"CMake": [
"FixMe [CMake]", "ToDo [CMake]", "@fixme [CMake]", "@todo [CMake]"
],
"git-conflict": [
"<<<<<<<"
]
Expand Down Expand Up @@ -107,8 +111,8 @@
{
"language": "cpp",
"lineLength": 100,
"begin": "",
"end": "",
"begin": "//",
"end": "//",
"prefix": "// "
},
{
Expand Down Expand Up @@ -136,7 +140,5 @@
"**/settings.json",
"*"
]
},
// others
{}
}
}
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
add_subdirectory(source/pch)
add_subdirectory(source/util)
add_subdirectory(source/common)
add_subdirectory(source/color)
add_subdirectory(source/vhdl)
add_subdirectory(source/frontend)
add_subdirectory(l10n)
Expand Down
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ The best to continue is to install [Python's virtual environment](https://docs.p
and activate Python's virtual environment depend on the OS using:

On Windows:
```shell
> .venv\Scripts\activate
```powershell
> .win64-venv\Scripts\activate
```

On Linux `bash`:
```shell
> source .venv/bin/activate
```

Check that you are running the right virtual environment (in PowerShell you may use `(Get-Command python).path`)
by using `pip` (notice capital `V` here)
Check that you are running the right virtual environment by using `pip` (notice capital `V` here),
on PowerShell you may also use `(Get-Command python).path`:

```shell
> pip -V
Expand Down
2 changes: 1 addition & 1 deletion cmake/external_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ find_package(range-v3 0.12.0 REQUIRED)
# strong typedef library for C++14/17/20
#
find_package(strong_type REQUIRED)
# ToDo: use explicit version: find_package(strong_type 15 REQUIRED)
# @todo [CMake] use explicit version: find_package(strong_type 15 REQUIRED)
4 changes: 2 additions & 2 deletions cmake/options_developer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ add_compile_options(
## -----------------------------------------------------------------------------
# Sanitize support and compiler options
#
# FixMe: Check and test flags, only added
# FixMe [CMake]: Check and test flags, only added

# --- ThreadSanitizer ---
option(IBIS_ENABLE_TSAN "Enable ThreadSanitizer builds." OFF)
Expand Down Expand Up @@ -201,7 +201,7 @@ mark_as_advanced(IBIS_ENABLE_UBSAN)
set(CMAKE_CXX_FLAGS_UBSAN "-fsanitize=undefined")
set(CMAKE_LINK_FLAGS_UBSAN "-fsanitize=undefined")

# FixMe: Sanity checks
# FixMe [CMake]: Sanity checks
# Clang: [Controlling Code Generation](https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/clang/docs/UsersManual.rst#id108)
# It is not possible to combine more than one of the -fsanitize=address,
# -fsanitize=thread, and -fsanitize=memory checkers in the same program.
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_custom_target(doc-testsuite
VERBATIM
)
# also clean up test matrix output, CMake doesn't know about it.
# FixMe: This prevents from ninja's error about permission denied (on Windows)
# FixMe [CMake]: This prevents from ninja's error about permission denied (on Windows)
# recreating is cheap ...
set_target_properties(doc-testsuite
PROPERTIES
Expand Down
46 changes: 42 additions & 4 deletions doc/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,45 @@ Generally honor:
partially expressive, but outdated. A documentation marathon is required if the
source base is **stable**.

## Building: Customize CMake build
## Build: Requisites

For Ubuntu please have a look at the files in [`.devcontainer`](../.devcontainer) and the scripts.

For Fedora:

```shell
sudo dnf install gcc clang clang-tools-extra cmake ninja-build
```

## Build: Conan Profile

It is important to set up the right Conan profile, e.g. setup the right compiler and path. E.g.
for Clang profile `clang`, `[buildenv]`and `[conf]` are added manually:

```shell
$ cat .conan2/profiles/clang
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=19
os=Linux

[buildenv]
CC=clang
CXX=clang++

[conf]
tools.build:compiler_executables={ "c": "/usr/bin/clang", "cpp": "/usr/bin/clang++" }
```

Further, if during `conan install` one gets
`c++: error: unrecognized command-line option ‘-stdlib=libstdc++’`
then the compiler aren't correctly setup - it's not a valid flag for GCC.

## Build: Customize CMake build

CMake supports two files, `CMakePresets.json` and `CMakeUserPresets.json`, that allow users to
specify common configure, build, and test options and share them with others. For more
Expand Down Expand Up @@ -81,7 +119,7 @@ To use, e.g. [CCache (a fast C/C++ compiler cache)](https://ccache.dev/) for CMa
}
```

The [`cmake/presets/common.json`](/cmake/presets/common.json) presets already
The [`cmake/presets/common.json`](../cmake/presets/common.json) presets already
contains a predefined "ccache" section:

```json
Expand All @@ -98,10 +136,10 @@ contains a predefined "ccache" section:
},
```

Also, there are some already pre-configured CMake presets below
Also, there are some already pre-configured user CMake presets below
[`cmake/presets/user`](/cmake/presets/user). Simply copy one of your
choice to `${source_dir}` as `CMakeUserPresets.json` - this file
is excluded from *git*, see [`.gitignore`](/.gitignore).
is excluded from *git*, see [`.gitignore`](../.gitignore).

## Linting: Clang Tidy

Expand Down
2 changes: 1 addition & 1 deletion l10n/run_xgettext.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ set(l10n_email "https://github.com/eda/ibis/issues")
# Note: running in -P script mode, CMake sets the variables CMAKE_BINARY_DIR etc.
# to the current working directory (https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_SOURCE_DIR.html).
execute_process(
COMMAND xgettext # XXXX ${GETTEXT_XGETTEXT_EXECUTABLE}
COMMAND xgettext # FixMe [CMake] ${GETTEXT_XGETTEXT_EXECUTABLE}
--add-comments=TRANSLATORS
--package-name="${PROJECT_NAME}"
--package-version="${eda_VERSION_MAJOR}.${eda_VERSION_MINOR}.${eda_VERSION_REVISION}"
Expand Down
46 changes: 0 additions & 46 deletions source/color/CMakeLists.txt

This file was deleted.

79 changes: 0 additions & 79 deletions source/color/include/ibis/color/attribute.hpp

This file was deleted.

34 changes: 0 additions & 34 deletions source/color/include/ibis/color/decorator.hpp

This file was deleted.

53 changes: 0 additions & 53 deletions source/color/include/ibis/color/detail/ansi_esc_printer.hpp

This file was deleted.

Loading

0 comments on commit 7b8f4d8

Please sign in to comment.