Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
rocm_bandwidth_test
Commits
1530cac3
Commit
1530cac3
authored
Mar 01, 2021
by
Ramesh Errabolu
Browse files
Add support for address sanitizer flags
parent
10995d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
CMakeLists.txt
CMakeLists.txt
+12
-0
No files found.
CMakeLists.txt
View file @
1530cac3
...
@@ -80,6 +80,18 @@ endif()
...
@@ -80,6 +80,18 @@ endif()
set
(
CMAKE_EXE_LINKER_FLAGS
"-Wl,-Bdynamic -Wl,-z,noexecstack"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"-Wl,-Bdynamic -Wl,-z,noexecstack"
)
set
(
CMAKE_SKIP_BUILD_RPATH TRUE
)
set
(
CMAKE_SKIP_BUILD_RPATH TRUE
)
## Address Sanitize Flag
if
(
${
ADDRESS_SANITIZER
}
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=address"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-fsanitize=address"
)
else
()
if
(
CMAKE_COMPILER_IS_GNUCC
)
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-Wl,-no-undefined"
)
else
()
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-Wl,-undefined,error"
)
endif
()
endif
()
# Check Env vars
# Check Env vars
if
(
NOT DEFINED CMAKE_BUILD_TYPE OR
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
""
)
if
(
NOT DEFINED CMAKE_BUILD_TYPE OR
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
""
)
if
(
DEFINED ENV{CMAKE_BUILD_TYPE}
)
if
(
DEFINED ENV{CMAKE_BUILD_TYPE}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment