HELLO WORLD!!!

This commit is contained in:
Benjamin Palko 2024-08-03 22:58:07 -04:00
parent 13cabebe5f
commit 76befbfdc8
7 changed files with 53 additions and 0 deletions

14
CMakeLists.txt Normal file
View file

@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.29.6)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(HelloWorld CXX)
find_package(fmt CONFIG REQUIRED)
add_executable(HelloWorld main.cpp)
target_link_libraries(HelloWorld PRIVATE fmt::fmt)

3
build.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cmake --build build

3
cmake.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cmake -B build -S .

3
compile-commands.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=1

6
main.cpp Normal file
View file

@ -0,0 +1,6 @@
#include <fmt/core.h>
int main() {
fmt::print("Hello world!\n");
return 0;
}

21
shell.nix Normal file
View file

@ -0,0 +1,21 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs.buildPackages; [
bear
gnumake
cmake
vcpkg
clang
clang-tools
pkg-config
];
shellHook = ''
export VCPKG_ROOT="${pkgs.vcpkg.outPath}/share/vcpkg";
export CC="${pkgs.clang.outPath}/bin/clang";
export CXX="${pkgs.clang.outPath}/bin/clang++";
'';
}

3
vcpkg.json Normal file
View file

@ -0,0 +1,3 @@
{
"dependencies": ["fmt"]
}