Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update build script #122

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**/*.inc
.DS_Store
.idea/
cmake-build-debug/
cmake-build-debug
cmake-build/
lib/spectator/
spectator-cpp-*.zip
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ Due to the nature of what this agent is, it does not compile cleanly on MacOS. I
machine:

```shell
# setup python venv and activate, to gain access to conan cli
./setup-venv.sh
source venv/bin/activate
./build.sh # [clean|skiptest]

# link clion default build directory to our build directory
ln -s cmake-build cmake-build-debug

./build.sh # [clean|clean --force|skiptest]
```

* CLion version 2022.1.3 required until the Conan plugin is updated
* CLion > Preferences > Plugins > Marketplace > Conan > Install
* CLion > Preferences > Build, Execution, Deploy > Conan > Conan Executable: $PROJECT_HOME/venv/bin/conan
* CLion > Bottom Bar: Conan > Left Button: Match Profile > CMake Profile: Debug, Conan Profile: default

## Debugging

```
```shell
# attach gdb to the test process
gdb ./cmake-build/bin/sysagent_test

Expand Down
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# usage: ./build.sh [clean|clean --force|skiptest]

BUILD_DIR=cmake-build
# Choose: Debug, Release, RelWithDebInfo and MinSizeRel
BUILD_TYPE=Debug
Expand All @@ -12,8 +14,10 @@ if [[ "$1" == "clean" ]]; then
rm -rf $BUILD_DIR
rm -f spectator-cpp-*.zip
rm -rf lib/spectator
# remove all packages and binaries from the local cache, to allow swapping between Debug/Release builds
conan remove '*' --force
if [[ "$2" == "--force" ]]; then
# remove all packages and binaries from the local cache, to allow swapping between Debug/Release builds
conan remove '*' --force
fi
fi

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
Expand Down
Loading