Skip to content

Commit

Permalink
Merge pull request #4 from deniskovalchuk/build-scripts
Browse files Browse the repository at this point in the history
Add build scripts
  • Loading branch information
deniskovalchuk authored Jul 21, 2023
2 parents 03fd5fe + e5d457b commit 3021dcc
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,51 @@ FTP may run in active or passive mode, which determines how the data connection

<h2>Build and Run (Linux, macOS)</h2>

First of all you need to satisfy prerequisites listed above.

<h3>Build Debug</h3>

```bash
./scripts/build-debug.sh
```

The produced executable file can be found at the following path:

```
/build/debug/bin/ftp
```

<h3>Build Release</h3>

```bash
./scripts/build-release.sh
```

The produced executable file can be found at the following path:

```
/build/release/bin/ftp
```

<h3>Build on custom environment</h3>

```bash
mkdir build && cd build
mkdir -p build
cd build
cmake ..
cmake --build .
./bin/ftp
```

The produced executable file can be found at the following path:

```
/build/bin/ftp
```

<h3>Clean the builds</h3>

```bash
./scripts/clean.sh
```

<h2>Session Example</h2>
Expand Down
5 changes: 5 additions & 0 deletions scripts/build-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BUILD_DIR=build/debug

mkdir -p ${BUILD_DIR}
cmake -S . -B ${BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug
cmake --build ${BUILD_DIR}
5 changes: 5 additions & 0 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BUILD_DIR=build/release

mkdir -p ${BUILD_DIR}
cmake -S . -B ${BUILD_DIR} -DCMAKE_BUILD_TYPE=Release
cmake --build ${BUILD_DIR}
3 changes: 3 additions & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BASE_BUILD_DIR=build

rm -rf ${BASE_BUILD_DIR}

0 comments on commit 3021dcc

Please sign in to comment.