Library correctly building and linking to alba
Francesco Pasa 9 months ago
Francesco Pasa 9 months ago
.gitignore A +3
CMakeLists.txt A +26
1+cmake_minimum_required(VERSION 3.28)
2+project(nave C)
3+set(CMAKE_C_STANDARD 23)
4+
5+# Dependencies
6+include(FetchContent)
7+
8+FetchContent_Declare(
9+ alba
10+ GIT_REPOSITORY https://srcfort.com/fpasa/alba
11+ GIT_TAG master
12+ GIT_SHALLOW TRUE
13+)
14+
15+FetchContent_MakeAvailable(alba)
16+include_directories("${alba_SOURCE_DIR}/include")
17+
18+# Library
19+add_library(nave STATIC src/nave.c)
20+target_link_libraries(nave PRIVATE alba)
21+
22+# Examples & tests
23+include_directories(include)
24+
25+add_executable(basic examples/basic.c)
26+target_link_libraries(basic PRIVATE nave)
examples/basic.c A +8
include/nave.h A +5
+#ifndef NAVE_LIBRARY_H
+#define NAVE_LIBRARY_H
+
+
+#endif //NAVE_LIBRARY_H
src/nave.c A +8
+#include "nave.h"
+
+#include <stdio.h>
+
+void hello(void)
+{
+ printf("Hello, World!\n");
+}