Skip to content

Commit

Permalink
Add a dependency (fmt) and use it
Browse files Browse the repository at this point in the history
  • Loading branch information
cryos committed Feb 3, 2024
1 parent f3fdf6b commit 73e5043
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 29 deletions.
53 changes: 26 additions & 27 deletions CMakePresets.json
@@ -1,30 +1,29 @@
{
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 28,
"patch": 1
},
"configurePresets": [
{
"name": "default",
"binaryDir": "${sourceDir}/build",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "PATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"VCPKG_INSTALLED_DIR": {
"type": "PATH",
"value": "${sourceDir}/../angohr-installed"
},
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-linux-shared"
}
"version": 8,
"cmakeMinimumRequired": {
"major": 3,
"minor": 28,
"patch": 1
},
"configurePresets": [
{
"name": "default",
"binaryDir": "${sourceDir}/build",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "PATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
"VCPKG_INSTALLED_DIR": {
"type": "PATH",
"value": "${sourceDir}/vcpkg-installed"
},
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-linux-dynamic"
}
}
]
}
}
]
}
3 changes: 3 additions & 0 deletions angohr/CMakeLists.txt
@@ -1,9 +1,12 @@
find_package(fmt CONFIG REQUIRED)

add_library(core)
target_sources(core
PUBLIC
FILE_SET CXX_MODULES FILES
core.cpp
ello.cpp)
target_link_libraries(core PRIVATE fmt::fmt)

add_executable(angohr angohr.cpp)

Expand Down
4 changes: 2 additions & 2 deletions angohr/ello.cpp
@@ -1,6 +1,6 @@
module;

#include <iostream>
#include <fmt/core.h>

export module core : iface.ello;

Expand All @@ -13,6 +13,6 @@ export class ello {

ello::ello() = default;
void ello::hello() {
std::cout << "Why hello!\n";
fmt::print("Why hello!!!\n");
}
}

0 comments on commit 73e5043

Please sign in to comment.