Skip to content
Snippets Groups Projects
Commit 932ded46 authored by Florian Schmaus's avatar Florian Schmaus
Browse files

Optionally build with libc++

parent 6a186f37
No related branches found
No related tags found
1 merge request!307Optionally build with libc++
image: "flowdalic/debian-testing-dev:1.17" image: "flowdalic/debian-testing-dev:1.19"
before_script: before_script:
- ulimit -a - ulimit -a
...@@ -97,6 +97,14 @@ clang-tidy: ...@@ -97,6 +97,14 @@ clang-tidy:
CC: clang CC: clang
CXX: clang++ CXX: clang++
.libc++:
extends:
- .clang
variables:
EMPER_USE_BUNDLED_DEPS: "always"
EMPER_CPP_ARGS: "-stdlib=libc++"
EMPER_CPP_LINK_ARGS: "-stdlib=libc++"
.emper-ws-scheduling: .emper-ws-scheduling:
variables: variables:
EMPER_DEFAULT_SCHEDULING_STRATEGY: "work_stealing" EMPER_DEFAULT_SCHEDULING_STRATEGY: "work_stealing"
...@@ -253,6 +261,17 @@ test-clang-debug: ...@@ -253,6 +261,17 @@ test-clang-debug:
- test-clang - test-clang
- .debug-build - .debug-build
smoke-test-libc++:
stage: smoke-test
extends:
- .fast-variant-check
- .libc++
test-libc++:
extends:
- .test
- .libc++
test-worker-no-sleep: test-worker-no-sleep:
extends: extends:
- .test - .test
......
...@@ -34,6 +34,15 @@ debug: ...@@ -34,6 +34,15 @@ debug:
rm -f build rm -f build
$(MAKE) build BUILDTYPE=$@ $(MAKE) build BUILDTYPE=$@
libc++:
rm -f build
$(MAKE) build \
CC=clang CXX=clang++ \
EMPER_CPP_ARGS="-stdlib=libc++" \
EMPER_CPP_LINK_ARGS="-stdlib=libc++" \
EMPER_USE_BUNDLED_DEPS="always" \
BUILDDIR="build-libc++"
.PHONY: fast-static-analysis .PHONY: fast-static-analysis
fast-static-analysis: all check-format check-license doc fast-static-analysis: all check-format check-license doc
......
...@@ -21,11 +21,12 @@ ...@@ -21,11 +21,12 @@
using emper::io::GlobalIoContext; using emper::io::GlobalIoContext;
static const long NanosInAMinute = 60L * 1000 * 1000 * 1000;
namespace emper::log { namespace emper::log {
static void add_timestamp_to(std::ostringstream& logMessage) { static void add_timestamp_to(std::ostringstream& logMessage) {
#if defined __GLIBCXX__
static const long NanosInAMinute = 60L * 1000 * 1000 * 1000;
auto now = std::chrono::high_resolution_clock::now(); auto now = std::chrono::high_resolution_clock::now();
auto now_time_t = std::chrono::high_resolution_clock::to_time_t(now); auto now_time_t = std::chrono::high_resolution_clock::to_time_t(now);
...@@ -53,6 +54,9 @@ static void add_timestamp_to(std::ostringstream& logMessage) { ...@@ -53,6 +54,9 @@ static void add_timestamp_to(std::ostringstream& logMessage) {
long remaining_nanos = time_since_epoch_long % NanosInAMinute; long remaining_nanos = time_since_epoch_long % NanosInAMinute;
logMessage << remaining_nanos; logMessage << remaining_nanos;
#else
logMessage << "UNKN_TIME";
#endif
} }
static std::mutex log_mutex; static std::mutex log_mutex;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment