Skip to content

Commit

Permalink
Use distinct directory when multiple use= flags are enabled
Browse files Browse the repository at this point in the history
Prior to this commit, the output directory used when multiple
`use=` flags were enabled would be the directory for the last
`use=` flag enabled in source code order.

This commit changes it so that the output directory uses a distinct
name that concats all the `use=` flags enabled together (i.e. the
output directory will be `debug-valgrind-runtimestats` instead of
`debug-runtimestats`).
  • Loading branch information
dipinhora committed Jul 15, 2023
1 parent b6c3c61 commit 722eec6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,30 @@ endif()

# Uses
if(PONY_USE_VALGRIND)
set(PONY_OUTPUT_SUFFIX "-valgrind")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-valgrind")
add_compile_options(-DUSE_VALGRIND)
endif()

if(PONY_USE_THREAD_SANITIZER)
set(PONY_OUTPUT_SUFFIX "-thread_sanitizer")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-thread_sanitizer")
add_compile_options(-fsanitize=thread -DPONY_SANITIZER=\"thread\")
add_link_options(-fsanitize=thread -DPONY_SANITIZER=\"thread\")
endif()

if(PONY_USE_ADDRESS_SANITIZER)
set(PONY_OUTPUT_SUFFIX "-address_sanitizer")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-address_sanitizer")
add_compile_options(-fsanitize=address -DPONY_SANITIZER=\"address\")
add_link_options(-fsanitize=address -DPONY_SANITIZER=\"address\")
endif()

if(PONY_USE_UNDEFINED_BEHAVIOR_SANITIZER)
set(PONY_OUTPUT_SUFFIX "-undefined_behavior_sanitizer")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-undefined_behavior_sanitizer")
add_compile_options(-fsanitize=undefined -DPONY_SANITIZER=\"undefined\")
add_link_options(-fsanitize=undefined -DPONY_SANITIZER=\"undefined\")
endif()

if(PONY_USE_COVERAGE)
set(PONY_OUTPUT_SUFFIX "-coverage")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-coverage")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-O0 -fprofile-instr-generate -fcoverage-mapping)
add_link_options(-fprofile-instr-generate -fcoverage-mapping)
Expand All @@ -65,32 +65,32 @@ if(PONY_USE_COVERAGE)
endif()

if(PONY_USE_POOLTRACK)
set(PONY_OUTPUT_SUFFIX "-pooltrack")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-pooltrack")
add_compile_options(-DUSE_POOLTRACK)
endif()

if(PONY_USE_DTRACE)
set(PONY_OUTPUT_SUFFIX "-dtrace")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-dtrace")
add_compile_options(-DUSE_DYNAMIC_TRACE)
endif()

if(PONY_USE_RUNTIMESTATS)
set(PONY_OUTPUT_SUFFIX "-runtimestats")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-runtimestats")
add_compile_options(-DUSE_RUNTIMESTATS)
endif()

if(PONY_USE_SCHEDULER_SCALING_PTHREADS)
set(PONY_OUTPUT_SUFFIX "-scheduler_scaling_pthreads")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-scheduler_scaling_pthreads")
add_compile_options(-DUSE_SCHEDULER_SCALING_PTHREADS)
endif()

if(PONY_USE_SYSTEMATIC_TESTING)
set(PONY_OUTPUT_SUFFIX "-systematic_testing")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-systematic_testing")
add_compile_options(-DUSE_SYSTEMATIC_TESTING)
endif()

if(PONY_USE_RUNTIMESTATS_MESSAGES)
set(PONY_OUTPUT_SUFFIX "-runtimestats_messages")
set(PONY_OUTPUT_SUFFIX "${PONY_OUTPUT_SUFFIX}-runtimestats_messages")
add_compile_options(-DUSE_RUNTIMESTATS -DUSE_RUNTIMESTATS_MESSAGES)
endif()

Expand Down

0 comments on commit 722eec6

Please sign in to comment.