Skip to content

Commit

Permalink
Linking endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Shillaker committed Sep 4, 2020
1 parent 4129c37 commit 24b1ea2
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from os.path import dirname, realpath, join, exists

_PROJ_ROOT = dirname(realpath(__file__))


def Settings(**kwargs):
venv_interpreter = join(_PROJ_ROOT, "venv", "bin", "python")

if not exists(venv_interpreter):
parent_root = dirname(dirname(_PROJ_ROOT))
venv_interpreter = join(parent_root, "venv", "bin", "python")

return {"interpreter_path": venv_interpreter}
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Library funcs
if (FAABRIC_STATIC_LIBS)
Expand All @@ -34,8 +35,8 @@ endif ()
# https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/CMakeLists.txt
include(FindProtobuf)
set(protobuf_MODULE_COMPATIBLE TRUE)

find_package(Protobuf REQUIRED)

message(STATUS "Using protobuf \
${PROTOBUF_LIBRARY} \
${PROTOBUF_PROTOC_LIBRARY} \
Expand Down
2 changes: 1 addition & 1 deletion src/endpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ set(LIB_FILES

faabric_private_lib(endpoint "${LIB_FILES}")

target_link_libraries(endpoint pistache pthread)
target_link_libraries(endpoint pistache pthread util)
2 changes: 1 addition & 1 deletion src/endpoint/Endpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ namespace faabric::endpoint {

httpEndpoint.shutdown();
}
}
}
2 changes: 2 additions & 0 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from . import build
from . import container
from . import dev

ns = Collection(
build,
container,
dev,
)

59 changes: 59 additions & 0 deletions tasks/dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from os import makedirs
from shutil import rmtree
from os.path import join, exists
from subprocess import run

from invoke import task

from tasks.util.env import PROJ_ROOT


_BUILD_DIR = join(PROJ_ROOT, "build", "cmake")
_BIN_DIR = join(_BUILD_DIR, "bin")


@task
def cmake(ctx, clean=False):
if clean and exists(_BUILD_DIR):
rmtree(_BUILD_DIR)

if not exists(_BUILD_DIR):
makedirs(_BUILD_DIR)

cmd = [
"cmake",
"-GNinja",
"-DCMAKE_BUILD_TYPE=Debug",
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10",
"-DCMAKE_C_COMPILER=/usr/bin/clang-10",
"../..",
]

run(" ".join(cmd), shell=True, cwd=_BUILD_DIR)


@task
def cc(ctx, target):
run("cmake --build . --target {}".format(target), cwd=_BUILD_DIR, shell=True)


@task
def r(ctx, target):
run(
"./{}".format(target),
cwd=_BIN_DIR,
shell=True,
)


@task
def test(ctx, name, debug=False):
test_exe = join(_BUILD_DIR, "bin", "tests")

cmd = [
test_exe,
"-r console",
name,
]

run(" ".join(cmd), shell=True, cwd=PROJ_ROOT)

0 comments on commit 24b1ea2

Please sign in to comment.