Skip to content
Snippets Groups Projects
Commit 8f9b9cd8 authored by Felix Morgner's avatar Felix Morgner
Browse files

build: migrate away from conan

parent c16a3739
No related branches found
No related tags found
No related merge requests found
Showing
with 48 additions and 47 deletions
File moved
{
"image": "registry.gitlab.ost.ch:45023/teachos/devcontainers/x86-64:14.2.0",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools"
]
}
}
}
{
"cmake.sourceDirectory": "/home/sophia/Projects/os/teachos/kernel/source",
"cmake.useCMakePresets": "always",
"cmake.options.statusBarVisibility": "visible",
"C_Cpp.autoAddFileAssociations": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
......
......@@ -15,6 +15,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules")
set(CMAKE_CXX_STANDARD "20")
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
#[============================================================================[
# Documentation
#]============================================================================]
......
{
"version": 6,
"configurePresets": [
{
"name": "default",
"binaryDir": "${sourceDir}/build",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_CONFIGURATION_TYPES": "Debug;MinSizeRel",
"CMAKE_TOOLCHAIN_FILE": "cmake/Platforms/x86_64.cmake"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "default",
"configuration": "Debug"
},
{
"name": "release",
"configurePreset": "default",
"configuration": "MinSizeRel"
}
]
}
......@@ -11,59 +11,17 @@ Development
Development happens primarily on Linux.
Other platforms (e.g. Windows, macOS) may allow building of the kernel as well, however at the time of this writing they are not officially supported.
To manage the toolchain and dependencies of the kernel, conan is used as a package manager.
Required Tools
~~~~~~~~~~~~~~
In orer to build the kernel, the following tools are required:
In order to build the kernel, the following tools are required:
- Python 3 to run conan
- A C and C++ toolchain to build the kernel toolchain
- GRUB2 to build the bootable ISO image
- Docker to run the development container
- Visual Studio Code for development
Setup
~~~~~
Create an activate a Python virtual environment, for example by using the ``venv`` module:
Open this directory in Visual Studio Code and then reopen the project in the development container
.. code-block:: bash
$ python -m venv .venv
$ source .venv/bin/activate
With the virtual environment activated, install the required Python package from the ``requirements.txt`` file:
.. code-block:: bash
$ pip install -r requirements.txt
Next, prepare the default conan profile and install the required packages (note: the example below assumes x86_64 is being targeted as the kernel's platform):
.. code-block:: bash
$ conan profile new --detect default
$ conan install -if .conan/install -pr:b default -pr:h .conan/profiles/x86_64-gcc -b missing
The second command may need to be rerun in case the conan dependencies change.
Building
~~~~~~~~
With the setup performed, the kernel can now be built:
.. code-block:: bash
$ conan build -if .conan/install .
Developing in an IDE
~~~~~~~~~~~~~~~~~~~~
This repository includes a configuration for Visual Studio Code.
In order to work on the kernel from within Visual Studio Code, activation of the conan build environment is required:
.. code-block:: bash
$ source build/generators/conanbuild.sh
Afterward the IDE can be started from the same shell and will automatically pick up the required environment variables.
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment