Skip to content

Commit

Permalink
cleaning cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstink committed Aug 3, 2023
1 parent f749283 commit bcc9734
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
cmake_minimum_required(VERSION 3.10)

# Read version from the package.xml file.
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/package.xml package_xml_str)

if(NOT package_xml_str MATCHES "<version>([0-9]+.[0-9]+.[0-9]+)</version>")
message(FATAL_ERROR "Could not parse project version from package.xml. Aborting.")
endif()

project(symmetri VERSION ${CMAKE_MATCH_1})

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized -Wno-psabi -Wno-unused-parameter -Werror -Wall -Wextra -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -pedantic -flto -O3")

if(BUILD_TESTING)
enable_testing()

if(ASAN_BUILD AND NOT TSAN_BUILD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address,undefined -fno-omit-frame-pointer -O0")
elseif(TSAN_BUILD AND NOT ASAN_BUILD)
Expand All @@ -26,7 +30,7 @@ add_subdirectory(symmetri)

# some examples using the lib
if(BUILD_EXAMPLES)
add_subdirectory(examples/flight)
add_subdirectory(examples/hello_world)
add_subdirectory(examples/model_benchmark)
add_subdirectory(examples/flight)
add_subdirectory(examples/hello_world)
add_subdirectory(examples/model_benchmark)
endif()
2 changes: 1 addition & 1 deletion symmetri/eventlog_parsers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ std::string mermaidFromEventlog(symmetri::Eventlog el) {

std::stringstream mermaid;
mermaid << "\n---\ndisplayMode : compact\n---\ngantt\ntitle A Gantt "
"Diagram\ndateFormat x\naxisFormat \%H:\%M:\%S\n";
"Diagram\ndateFormat x\naxisFormat %H:%M:%S\n";
std::string current_section("");
for (auto it = el.begin(); std::next(it) != el.end(); it = std::next(it)) {
const auto &start = *it;
Expand Down

0 comments on commit bcc9734

Please sign in to comment.