From 075867d7a41162c4749a81e36895fec728cfedd2 Mon Sep 17 00:00:00 2001 From: Riley Date: Thu, 8 May 2025 18:02:49 -0500 Subject: [PATCH] fleshout --- README.md | 23 +++++++++++++++++++++++ build.bat | 2 +- build.sh | 5 +++++ meson.build | 4 +++- src/include/.gitkeep | 0 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 README.md create mode 100644 build.sh create mode 100644 src/include/.gitkeep diff --git a/README.md b/README.md new file mode 100644 index 0000000..12e8ee4 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Conan-C + +This is a Conan / Meson template. It's based on some online tutorials. + +I made this when I wanted to make more C / C++ projects but with a more "pythonic" build system. + +# Setup + +## Linux / Windows + +1. Install CMake +2. Install Meson +3. Install GCC (UCRT MSYS2) + +## Windows +4. Edit `~\.conan2\profiles\default` to match [docs/default](docs/default) + +## Linux +4. If you run linux you can probably figure this out. It should work mostly out of the box. + +## Both Again +5. Run `build.bat` or `build.sh` respectively. +6. Edit your intellisense to read the compile_commands from `${workspaceFolder}/build/meson-src/compile_commands.json` \ No newline at end of file diff --git a/build.bat b/build.bat index 7eb4771..bfda0ec 100644 --- a/build.bat +++ b/build.bat @@ -2,4 +2,4 @@ conan install . --output-folder=build --build=missing cd build meson setup --native-file conan_meson_native.ini .. meson-src meson compile -C meson-src -meson-src\compressor.exe \ No newline at end of file +meson-src\main.exe \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..ea02ffc --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +conan install . --output-folder=build --build=missing +cd build +meson setup --native-file conan_meson_native.ini .. meson-src +meson compile -C meson-src +./meson-src/main \ No newline at end of file diff --git a/meson.build b/meson.build index 02c195f..855fbcd 100644 --- a/meson.build +++ b/meson.build @@ -4,6 +4,8 @@ CC = meson.get_compiler('c') zlib = dependency('zlib', version : '1.2.11', static: true, required: true) +target_name = 'main' + files = files('src/main.c') -executable('compressor', files, dependencies: zlib) \ No newline at end of file +executable(target_name, files, dependencies: [zlib], include_directories: include_directories('src/include')) \ No newline at end of file diff --git a/src/include/.gitkeep b/src/include/.gitkeep new file mode 100644 index 0000000..e69de29