aboutsummaryrefslogtreecommitdiff
path: root/conanfile.py
diff options
context:
space:
mode:
authorfelix.morgner@ost.ch <felix.morgner@gmail.com>2023-10-07 10:45:45 +0200
committerfelix.morgner@ost.ch <felix.morgner@gmail.com>2023-10-07 10:45:45 +0200
commit68db123a2f37a66aea218fa48a5bab8ea6b12951 (patch)
tree911c21ba6ab3694ab6339186001a14c04fe889ea /conanfile.py
parentfa1f8636d2e2368c9cb446284946570565563f4f (diff)
downloadteachos-68db123a2f37a66aea218fa48a5bab8ea6b12951.tar.xz
teachos-68db123a2f37a66aea218fa48a5bab8ea6b12951.zip
x86_64: implement first bootable kernel
Diffstat (limited to 'conanfile.py')
-rw-r--r--conanfile.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 0000000..4712156
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,54 @@
+from conan import ConanFile
+from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
+from conan.tools.env import VirtualBuildEnv
+
+class KernelConan(ConanFile):
+ name = "kernel"
+ description = "The kernel of TeachOS"
+ version = "0.0.1"
+ package_type = "application"
+ homepage = "https://gitlab.ost.ch/teachos/kernel"
+
+ settings = [
+ "arch",
+ "build_type",
+ "compiler",
+ ]
+
+ tool_requires = [
+ "cmake/[~3.27]",
+ "gcc/13.2.0@teachos/stable",
+ ]
+
+ def build(self):
+ cmake = CMake(self)
+ cmake.configure()
+ cmake.build()
+
+ def generate(self):
+ build_environment = VirtualBuildEnv(self)
+ build_environment.generate()
+
+ dependencies = CMakeDeps(self)
+ dependencies.generate()
+
+ toolchain = CMakeToolchain(self)
+ toolchain.cache_variables["CMAKE_TRY_COMPILE_TARGET_TYPE"] = "STATIC_LIBRARY"
+ toolchain.variables["TEACHOS_DESCRIPTION"] = self.description
+ toolchain.variables["TEACHOS_HOMEPAGE_URL"] = self.homepage
+ toolchain.variables["TEACHOS_VERSION"] = self.version
+ toolchain.blocks["teachos_platform"] = PlatformIncludeBlock
+ toolchain.blocks["teachos_platform"].values["platform"] = self.settings.arch
+ toolchain.blocks.remove("cmake_flags_init")
+ toolchain.blocks.remove("arch_flags")
+ toolchain.generate()
+
+ def layout(self):
+ cmake_layout(self, src_folder="source")
+
+class PlatformIncludeBlock:
+ template = "include(\"../cmake/Platforms/{{platform}}.cmake\")"
+
+def context(self):
+ return { "platform": None }
+