Skip to content

Commit

Permalink
standalone example that shows multiple declaration issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasw committed Dec 14, 2023
1 parent 4ef823f commit 590483f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ jobs:
cmake ../examples -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHCXX_SOURCE=PACKAGE
cmake --build . --config Release
- name: make standalone example with zenoh-cpp as installed package
shell: bash
run: |
mkdir -p build_examples_standalone_findproj && cd build_examples_standalone_findproj
cmake ../examples/standalone -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHCXX_SOURCE=PACKAGE
cmake --build . --config Release
- name: make tests
shell: bash
run: |
Expand Down
9 changes: 9 additions & 0 deletions examples/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.16)
project(zenoh_foo)

find_package(zenohc REQUIRED)
find_package(zenohcxx REQUIRED)

add_executable(foo main.cpp foo.cpp)
target_link_libraries(foo zenohcxx::zenohc::lib)
set_property(TARGET foo PROPERTY CXX_STANDARD 17)
4 changes: 4 additions & 0 deletions examples/standalone/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <iostream>
#include <zenohc.hxx>

#include "foo.hpp"
6 changes: 6 additions & 0 deletions examples/standalone/foo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef FOO_HXX
#define FOO_HXX

#include "zenohc.hxx"

#endif // FOO_HXX
10 changes: 10 additions & 0 deletions examples/standalone/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>

#include <zenohc.hxx>

#include "foo.hpp"

int main()
{
return 0;
}

0 comments on commit 590483f

Please sign in to comment.