From f2e9dfb757b802e7d7c3993b35a753e8653fb465 Mon Sep 17 00:00:00 2001 From: danimtb <danimanzaneque@gmail.com> Date: Wed, 12 Mar 2025 13:08:10 +0100 Subject: [PATCH 1/7] add lesson5 --- lesson5/CMakeLists.txt | 9 +++++++++ lesson5/conanfile.py | 15 +++++++++++++++ lesson5/profiles/raspberry | 12 ++++++++++++ lesson5/src/main.cpp | 19 +++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 lesson5/CMakeLists.txt create mode 100644 lesson5/conanfile.py create mode 100644 lesson5/profiles/raspberry create mode 100644 lesson5/src/main.cpp diff --git a/lesson5/CMakeLists.txt b/lesson5/CMakeLists.txt new file mode 100644 index 0000000..c2792de --- /dev/null +++ b/lesson5/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) +project(formatter CXX) + +find_package(fmt REQUIRED) + +message(NOTICE "==> Building with CMake version: ${CMAKE_VERSION} <== ") + +add_executable(formatter src/main.cpp) +target_link_libraries(formatter fmt::fmt) diff --git a/lesson5/conanfile.py b/lesson5/conanfile.py new file mode 100644 index 0000000..b452c4c --- /dev/null +++ b/lesson5/conanfile.py @@ -0,0 +1,15 @@ +from conan import ConanFile +from conan.tools.cmake import cmake_layout + +class FormatterRecipe(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeToolchain", "CMakeDeps" + + def requirements(self): + self.requires("fmt/11.0.2") + + def build_requirements(self): + self.tool_requires("cmake/3.31.5") + + def layout(self): + cmake_layout(self) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry new file mode 100644 index 0000000..456adc3 --- /dev/null +++ b/lesson5/profiles/raspberry @@ -0,0 +1,12 @@ +[settings] +os=Linux +arch=armv7hf +compiler=gcc +build_type=Release +compiler.cppstd=gnu14 +compiler.libcxx=libstdc++11 +compiler.version=9 +[buildenv] +CC=arm-linux-gnueabihf-gcc-9 +CXX=arm-linux-gnueabihf-g++-9 +LD=arm-linux-gnueabihf-ld \ No newline at end of file diff --git a/lesson5/src/main.cpp b/lesson5/src/main.cpp new file mode 100644 index 0000000..c86bff1 --- /dev/null +++ b/lesson5/src/main.cpp @@ -0,0 +1,19 @@ +#include <fmt/core.h> +#include <fmt/color.h> + +int main() { + fmt::print(fmt::fg(fmt::color::cyan) | fmt::emphasis::bold, + "Conan is a MIT-licensed, Open Source "); + fmt::print(fmt::fg(fmt::color::white), + "package manager for C and C++ development\n"); + + #ifdef NDEBUG + fmt::print(fmt::fg(fmt::color::green) | fmt::emphasis::italic, + "Release configuration!\n"); + #else + fmt::print(fmt::fg(fmt::color::yellow) | fmt::emphasis::italic, + "Debug configuration!\n"); + #endif + + return 0; +} From 636e0e1dab00ba8a6e2e0c7437bd6e62391c6d7c Mon Sep 17 00:00:00 2001 From: danimtb <danimanzaneque@gmail.com> Date: Thu, 13 Mar 2025 12:09:32 +0100 Subject: [PATCH 2/7] remove message from cmake --- lesson5/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/lesson5/CMakeLists.txt b/lesson5/CMakeLists.txt index c2792de..2aa29f1 100644 --- a/lesson5/CMakeLists.txt +++ b/lesson5/CMakeLists.txt @@ -3,7 +3,5 @@ project(formatter CXX) find_package(fmt REQUIRED) -message(NOTICE "==> Building with CMake version: ${CMAKE_VERSION} <== ") - add_executable(formatter src/main.cpp) target_link_libraries(formatter fmt::fmt) From 9cd28bbe3743cc7bf228bc0b3245c1641261412b Mon Sep 17 00:00:00 2001 From: danimtb <danimanzaneque@gmail.com> Date: Thu, 13 Mar 2025 12:20:40 +0100 Subject: [PATCH 3/7] update to gcc 13 --- lesson5/profiles/raspberry | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry index 456adc3..55a8bec 100644 --- a/lesson5/profiles/raspberry +++ b/lesson5/profiles/raspberry @@ -5,8 +5,8 @@ compiler=gcc build_type=Release compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 -compiler.version=9 +compiler.version=13 [buildenv] -CC=arm-linux-gnueabihf-gcc-9 -CXX=arm-linux-gnueabihf-g++-9 +CC=arm-linux-gnueabihf-gcc-13 +CXX=arm-linux-gnueabihf-g++-13 LD=arm-linux-gnueabihf-ld \ No newline at end of file From a5ad135c5a7463b016298f8fc41a1a20c5f32994 Mon Sep 17 00:00:00 2001 From: danimtb <danimanzaneque@gmail.com> Date: Fri, 14 Mar 2025 14:11:20 +0100 Subject: [PATCH 4/7] use 12 --- lesson5/profiles/raspberry | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry index 55a8bec..870eb13 100644 --- a/lesson5/profiles/raspberry +++ b/lesson5/profiles/raspberry @@ -7,6 +7,6 @@ compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=13 [buildenv] -CC=arm-linux-gnueabihf-gcc-13 -CXX=arm-linux-gnueabihf-g++-13 +CC=arm-linux-gnueabihf-gcc-12 +CXX=arm-linux-gnueabihf-g++-12 LD=arm-linux-gnueabihf-ld \ No newline at end of file From b35d3fcdb733e59dfa5ee5a1eec5c76c855d1c79 Mon Sep 17 00:00:00 2001 From: danimtb <danimanzaneque@gmail.com> Date: Fri, 14 Mar 2025 14:15:42 +0100 Subject: [PATCH 5/7] 12 --- lesson5/profiles/raspberry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry index 870eb13..7128d62 100644 --- a/lesson5/profiles/raspberry +++ b/lesson5/profiles/raspberry @@ -5,7 +5,7 @@ compiler=gcc build_type=Release compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 -compiler.version=13 +compiler.version=12 [buildenv] CC=arm-linux-gnueabihf-gcc-12 CXX=arm-linux-gnueabihf-g++-12 From 09311df9f26a952c0d088cb4bf170e9aa47bd8f0 Mon Sep 17 00:00:00 2001 From: czoido <mrgalleta@gmail.com> Date: Wed, 19 Mar 2025 16:18:21 +0100 Subject: [PATCH 6/7] do not define LD --- lesson5/profiles/raspberry | 1 - 1 file changed, 1 deletion(-) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry index 7128d62..c699801 100644 --- a/lesson5/profiles/raspberry +++ b/lesson5/profiles/raspberry @@ -9,4 +9,3 @@ compiler.version=12 [buildenv] CC=arm-linux-gnueabihf-gcc-12 CXX=arm-linux-gnueabihf-g++-12 -LD=arm-linux-gnueabihf-ld \ No newline at end of file From 1d04d4794b2dc3238ec5fd552c1d2f89eddad3a8 Mon Sep 17 00:00:00 2001 From: czoido <mrgalleta@gmail.com> Date: Thu, 20 Mar 2025 11:32:19 +0100 Subject: [PATCH 7/7] add ld --- lesson5/profiles/raspberry | 1 + 1 file changed, 1 insertion(+) diff --git a/lesson5/profiles/raspberry b/lesson5/profiles/raspberry index c699801..55bc290 100644 --- a/lesson5/profiles/raspberry +++ b/lesson5/profiles/raspberry @@ -9,3 +9,4 @@ compiler.version=12 [buildenv] CC=arm-linux-gnueabihf-gcc-12 CXX=arm-linux-gnueabihf-g++-12 +LD=arm-linux-gnueabihf-ld