added cmake again :|

This commit is contained in:
Alfie King 2024-10-23 11:06:49 +01:00
parent 19b8a1921e
commit e53fd06a68
3 changed files with 11 additions and 5 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@
# Build files
build/
.vscode/

6
CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.5)
find_program(CMAKE_C_COMPILER NAMES $ENV{CC} gcc PATHS ENV PATH NO_DEFAULT_PATH)
find_program(CMAKE_CXX_COMPILER NAMES $ENV{CXX} g++ PATHS ENV PATH NO_DEFAULT_PATH)
project(owo)
add_executable(owo src/main.cpp)
target_link_libraries(owo)

View File

@ -28,12 +28,11 @@ $ ./owo -o output.txt "Hello, world!"
```
## Building
to build the program, you will need a c++ compiler. I have no idea what im doing with cmake so this uses a very basic make file that is made to build the linux and windows binaries.
If you are on windows, good luck. I have no clue how to setup g++ on windows. I would recommend using WSL or a VM. If you are on linux, you can build the program with the following commands
(assuming you have g++ installed):
```bash
$ cmake . -B build
$ cd build && make
$ make
$ build/owo "Hello, world!"
$ ./owo "Hello, world!"
hewwo, wowld!
```