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

feat: add conan package manager to amp-devcontainer-cpp #607

Merged
merged 8 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .devcontainer/cpp/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cmake==3.30.4
conan==2.8.1
gcovr==8.2
220 changes: 212 additions & 8 deletions .devcontainer/cpp/requirements.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .devcontainer/cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.30)
project(devcontainer-test LANGUAGES ASM C CXX)

include(CTest)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Seperate project as Conan is in the drivers seat

cmake_minimum_required(VERSION 3.30)
project(conan-test LANGUAGES CXX)

find_package(fmt REQUIRED)
add_executable(test-conan main.cpp)
target_link_libraries(test-conan PRIVATE fmt::fmt)
9 changes: 9 additions & 0 deletions .devcontainer/cpp/test/package-managers/conan/conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[requires]
fmt/11.0.2

[generators]
CMakeDeps
CMakeToolchain

[layout]
cmake_layout
7 changes: 7 additions & 0 deletions .devcontainer/cpp/test/package-managers/conan/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <fmt/core.h>

int main()
{
fmt::print("Hello, world!\n");
return 0;
}
14 changes: 13 additions & 1 deletion .devcontainer/cpp/test/testsuite.bats
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ setup() {
}

teardown() {
rm -rf build crash-*
rm -rf build crash-* /root/.conan2
}

@test "valid code input should result in working executable using host compiler" {
Expand Down Expand Up @@ -170,6 +170,18 @@ teardown() {
build_and_run_with_sanitizers clang
}

@test "using Conan as package manager should resolve external dependencies" {
pushd package-managers/conan

conan profile detect --force
conan install . --output-folder=../../build --build=missing

cmake -G Ninja --preset conan-release
cmake --build --preset conan-release

popd
}

function configure_and_build_with_ccache() {
local PRESET=${1:?}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ test-results/
*.profdata
*.profraw
**/playwright/.auth/user.json
CMakeUserPresets.json
Loading