Skip to content

Commit

Permalink
Merge pull request #14 from fix8mt/dev
Browse files Browse the repository at this point in the history
Dev update to v1.0.2a
  • Loading branch information
dakka authored Jul 30, 2024
2 parents fd07101 + a95e625 commit 4f71363
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 135 deletions.
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ message("-- Build with all warnings : ${BUILD_ALL_WARNINGS}")
option(BUILD_UNITTESTS "enable building unit tests" true)
message("-- Build unit tests: ${BUILD_UNITTESTS}")

# to enable clang build profiler:
# cmake -DBUILD_CLANG_PROFILER=true ..
# see examples/cbenchmark.sh
option(BUILD_CLANG_PROFILER "enable clang build profiler" false)
message("-- Build clang profiler: ${BUILD_CLANG_PROFILER}")
if(BUILD_CLANG_PROFILER)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-ftime-trace)
else()
message(WARNING "BUILD_CLANG_PROFILER only available with Clang")
endif()
endif()

function(build loc x)
add_executable(${x} ${loc}/${x}.cpp)
if(NOT ${x} STREQUAL srcloctest)
Expand All @@ -66,7 +79,7 @@ function(build loc x)
message("-- adding ${x}.cpp CXX_STANDARD: C++${cppstd} (${CMAKE_CXX_COMPILER_ID})")
endfunction()

foreach(x srcloctest example statictest)
foreach(x srcloctest example statictest cbenchmark)
build(examples ${x})
if(BUILD_STRIP_EXE)
add_custom_command(TARGET ${x} POST_BUILD COMMAND ${CMAKE_STRIP} ${x})
Expand Down
Loading

0 comments on commit 4f71363

Please sign in to comment.