From b1a2182f14f7a15c5b9749dfa333b29792c6e62a Mon Sep 17 00:00:00 2001 From: Riley Date: Thu, 8 May 2025 17:58:16 -0500 Subject: [PATCH] fleshout --- README.md | 23 +++++++++++++++++++++++ build.bat | 2 +- build.sh | 5 +++++ meson.build | 6 +++--- src/include/.gitkeep | 0 5 files changed, 32 insertions(+), 4 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..e0a02bd --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# Conan-Cpp + +This is a Conan / Meson template. It's based on some online tutorials, and is a modified version of [this project](https://code.cthulhub.net/Riley/Conan-C). + +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 729ae84..d1928ff 100644 --- a/meson.build +++ b/meson.build @@ -4,8 +4,8 @@ CC = meson.get_compiler('cpp') zlib = dependency('zlib', version : '1.2.11', static: true, required: true) -target_name = 'compressor' +target_name = 'main' + files = files('src/main.cpp') - -executable(target_name, 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