Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake support for code coverage build type #2393

Merged
merged 1 commit into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cmake/modules/TTMLIRBuildTypes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ set(CMAKE_SHARED_LINKER_FLAGS_ASAN
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fsanitize=address -shared-libasan" CACHE STRING
"Linker lags to be used to create shared libraries for Asan build type." FORCE)

# Code coverage build type
set(CMAKE_C_FLAGS_COVERAGE
"${CMAKE_C_FLAGS_DEBUG} --coverage" CACHE STRING
"Flags used by the C compiler for code coverage build type or configuration." FORCE)
set(CMAKE_CXX_FLAGS_COVERAGE
"${CMAKE_CXX_FLAGS_DEBUG} --coverage" CACHE STRING
"Flags used by the C++ compiler for code coverage build type or configuration." FORCE)
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage" CACHE STRING
"Linker flags to be used to create executables for code coverage build type." FORCE)
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} --coverage" CACHE STRING
"Linker lags to be used to create shared libraries for code coverage build type." FORCE)

# Assert build type
set(CMAKE_C_FLAGS_ASSERT
"${CMAKE_C_FLAGS_RELEASE}" CACHE STRING
Expand Down
1 change: 1 addition & 0 deletions test/ttmlir/Translate/LLVM/dylib.mlir
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: ttmlir-translate --llvm-to-dylib %s | llvm-nm -g - | FileCheck %s
// UNSUPPORTED: system-darwin

module attributes {ttir.cpu_module} {
llvm.func @memrefCopy(i64, !llvm.ptr, !llvm.ptr)
Expand Down
Loading