Skip to content

Commit 0f37934

Browse files
committed
Added /profile option to CMake
1 parent 74598d1 commit 0f37934

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF)
3131

3232
option(ENABLE_CODE_COVERAGE "Build with code-coverage" OFF)
3333

34+
option(ENABLE_CODE_PROFILING "Build for profiling" OFF)
35+
3436
option(BUILD_FUZZING "Build for fuzz testing" OFF)
3537

3638
set(CMAKE_CXX_STANDARD 17)
@@ -286,6 +288,13 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
286288
endforeach()
287289
endif()
288290

291+
if(ENABLE_CODE_PROFILING)
292+
message(STATUS "Building with /PROFILE")
293+
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
294+
target_link_options(${t} PRIVATE /profile)
295+
endforeach()
296+
endif()
297+
289298
if(ENABLE_SPECTRE_MITIGATION
290299
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.13)
291300
AND (NOT WINDOWS_STORE))

0 commit comments

Comments
 (0)