This commit is contained in:
Attila Body 2025-05-26 10:22:03 +02:00
parent 0c66ff89b3
commit 9b8308eb4a
Signed by: abody
GPG key ID: BD0C6214E68FB5CF
11 changed files with 121 additions and 0 deletions

10
libs/lib2/CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
# Defines a static library target named 'lib2' from its source file.
add_library(lib2 STATIC src/lib2.c)
# Specifies include directories that are part of lib2's public interface.
# - PUBLIC: Means that targets linking to lib2 (like cmake_tutorialApp or lib1) will
# inherit this include path. This allows them to find lib2.h.
target_include_directories(lib2 PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/inc
)

3
libs/lib2/inc/lib2.h Normal file
View file

@ -0,0 +1,3 @@
#pragma once
void lib2_function(); // Function declaration for lib2

7
libs/lib2/src/lib2.c Normal file
View file

@ -0,0 +1,7 @@
#include "lib2.h" // Include lib2's own header
#include <stdio.h> // Include standard I/O here, as printf is used in this source file.
void lib2_function()
{
printf("This is a function from Library 2.\n");
}