Skip to content

Commit

Permalink
Fix includes for inclusion as an external project (faasm#44)
Browse files Browse the repository at this point in the history
* Public include dirs for libraries

* Update all includes

* Add spdlog dependency

* Formatting

* Adding linkage between object library and normal library

* Build proto headers first

* Missing dependency

* Fixing up examples build
  • Loading branch information
Shillaker authored and csegarragonz committed Dec 15, 2020
1 parent 835cc5d commit 4d101b0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
15 changes: 10 additions & 5 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ set(CMAKE_CXX_EXTENSIONS OFF)
function(add_example example_name)
add_executable(${example_name} ${example_name}.cpp)

set(FAABRIC_LIBS libfaabric.so libfaabricmpi.so)

target_link_libraries(${example_name}
${FAABRIC_LIBS}
pistache
faabric
faabricmpi
protobuf
)
pthread
pistache
hiredis
grpc++
grpc++_reflection
boost_system
boost_filesystem
)

set(ALL_EXAMPLES ${ALL_EXAMPLES} ${example_name} PARENT_SCOPE)
endfunction()
Expand Down
30 changes: 17 additions & 13 deletions tasks/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,22 @@ def build(ctx, clean=False):
makedirs(BUILD_DIR)

# Cmake
cmake_cmd = " ".join(
[
"cmake",
"-GNinja",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_CXX_FLAGS=-I{}".format(INCLUDE_DIR),
"-DCMAKE_EXE_LINKER_FLAGS=-L{}".format(LIB_DIR),
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10",
"-DCMAKE_C_COMPILER=/usr/bin/clang-10",
EXAMPLES_DIR,
]
)
print(cmake_cmd)

run(
" ".join(
[
"cmake",
"-GNinja",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_CXX_FLAGS=-I{}".format(INCLUDE_DIR),
"-DCMAKE_EXE_LINKER_FLAGS=-L{}".format(LIB_DIR),
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10",
"-DCMAKE_C_COMPILER=/usr/bin/clang-10",
EXAMPLES_DIR,
]
),
cmake_cmd,
shell=True,
cwd=BUILD_DIR,
)
Expand All @@ -49,6 +52,7 @@ def build(ctx, clean=False):
"cmake --build . --target all_examples",
cwd=BUILD_DIR,
shell=True,
check=True,
)


Expand All @@ -69,4 +73,4 @@ def execute(ctx, example):
}
)

run(exe_path, env=shell_env, shell=True)
run(exe_path, env=shell_env, shell=True, check=True)

0 comments on commit 4d101b0

Please sign in to comment.