Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ default: run
build-c-runtime:
docker build -t fossunited/falcon-c ./runtimes/c

setup: build-c-runtime
build-cpp-runtime:
docker build -t fossunited/falcon-cpp ./runtimes/cpp

setup: build-c-runtime build-cpp-runtime
docker pull fossunited/falcon-python:3.9
docker pull fossunited/falcon-golang
docker pull fossunited/falcon-rust
Expand Down
5 changes: 5 additions & 0 deletions livecode_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
"command": [],
"code_filename": "main.c"
},
"cpp": {
"image": "fossunited/falcon-cpp",
"command": [],
"code_filename": "main.cpp"
},
"joy": {
"image": "falcon-joy",
"command": ["python", "/opt/start.py"],
Expand Down
10 changes: 10 additions & 0 deletions runtimes/cpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY run.sh /usr/local/bin/run.sh
RUN chmod +x /usr/local/bin/run.sh
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/run.sh"]

9 changes: 9 additions & 0 deletions runtimes/cpp/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

SOURCE_FILE="main.cpp"
OUTPUT_BINARY="/tmp/a.out"

g++ "${SOURCE_FILE}" -o "${OUTPUT_BINARY}"
exec "${OUTPUT_BINARY}"

10 changes: 10 additions & 0 deletions tests/runtimes/test_cpp_hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
runtime: cpp
code: |
#include <iostream>
int main() {
std::cout << "Hello from C++ runtime!" << std::endl;
return 0;
}
expected_output: "Hello from C++ runtime!\n"


Loading