From 77d1cbf9356b73688bb60bc58f34c86b45c70b54 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Thu, 21 May 2026 19:28:19 +0200 Subject: [PATCH] cmake setup --- .gitignore | 4 ++++ CMakeLists.txt | 9 +++++++++ compile_flags.txt | 2 -- pkg/common/CMakeLists.txt | 3 +++ pkg/fs/CMakeLists.txt | 5 +++++ pkg/fs/src/Makefile.am | 2 -- 6 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt delete mode 100644 compile_flags.txt create mode 100644 pkg/common/CMakeLists.txt create mode 100644 pkg/fs/CMakeLists.txt delete mode 100644 pkg/fs/src/Makefile.am diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..70b834f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Clangd +/.cache + +/build \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..67008eb --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.5) +project(onus VERSION 0.1 LANGUAGES C) + +option(BUILD_SHARED_LIBS "Build using shared libraries" ON) + +set(CMAKE_C_STANDARD 90) + +add_subdirectory(pkg/common) +add_subdirectory(pkg/fs) \ No newline at end of file diff --git a/compile_flags.txt b/compile_flags.txt deleted file mode 100644 index f56d7e0..0000000 --- a/compile_flags.txt +++ /dev/null @@ -1,2 +0,0 @@ --xc --std=c89 \ No newline at end of file diff --git a/pkg/common/CMakeLists.txt b/pkg/common/CMakeLists.txt new file mode 100644 index 0000000..2f9d1df --- /dev/null +++ b/pkg/common/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(onus_common INTERFACE) +add_library(onus::common ALIAS onus_common) +target_include_directories(onus_common INTERFACE include) \ No newline at end of file diff --git a/pkg/fs/CMakeLists.txt b/pkg/fs/CMakeLists.txt new file mode 100644 index 0000000..0f89bba --- /dev/null +++ b/pkg/fs/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(onus_fs) +add_library(onus::fs ALIAS onus_fs) +target_sources(onus_fs PRIVATE src/copymove.c) +target_include_directories(onus_fs PUBLIC include) +target_link_libraries(onus_fs PRIVATE onus::common) \ No newline at end of file diff --git a/pkg/fs/src/Makefile.am b/pkg/fs/src/Makefile.am deleted file mode 100644 index 46c893b..0000000 --- a/pkg/fs/src/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -bin_PROGRAMS = hello -hello_SOURCES = copymove.c \ No newline at end of file