Skip to content

Commit 4f71363

Browse files
authored
Merge pull request #14 from fix8mt/dev
Dev update to v1.0.2a
2 parents fd07101 + a95e625 commit 4f71363

File tree

8 files changed

+338
-135
lines changed

8 files changed

+338
-135
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ message("-- Build with all warnings : ${BUILD_ALL_WARNINGS}")
5050
option(BUILD_UNITTESTS "enable building unit tests" true)
5151
message("-- Build unit tests: ${BUILD_UNITTESTS}")
5252

53+
# to enable clang build profiler:
54+
# cmake -DBUILD_CLANG_PROFILER=true ..
55+
# see examples/cbenchmark.sh
56+
option(BUILD_CLANG_PROFILER "enable clang build profiler" false)
57+
message("-- Build clang profiler: ${BUILD_CLANG_PROFILER}")
58+
if(BUILD_CLANG_PROFILER)
59+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
60+
add_compile_options(-ftime-trace)
61+
else()
62+
message(WARNING "BUILD_CLANG_PROFILER only available with Clang")
63+
endif()
64+
endif()
65+
5366
function(build loc x)
5467
add_executable(${x} ${loc}/${x}.cpp)
5568
if(NOT ${x} STREQUAL srcloctest)
@@ -66,7 +79,7 @@ function(build loc x)
6679
message("-- adding ${x}.cpp CXX_STANDARD: C++${cppstd} (${CMAKE_CXX_COMPILER_ID})")
6780
endfunction()
6881

69-
foreach(x srcloctest example statictest)
82+
foreach(x srcloctest example statictest cbenchmark)
7083
build(examples ${x})
7184
if(BUILD_STRIP_EXE)
7285
add_custom_command(TARGET ${x} POST_BUILD COMMAND ${CMAKE_STRIP} ${x})

0 commit comments

Comments
 (0)