You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Running CMake with the Xcode generator seems to fails the compilation for Address sanitizer on macOS:
❯ cmake .. -G "Xcode" -DUSE_SANITIZER=Address
-- The C compiler identification is AppleClang 13.1.6.13160021
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode13.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode13.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Testing with Address sanitizer
CMake Error at /Users/jedumas/external/git/cmake-scripts/sanitizers.cmake:77 (message):
Address sanitizer not available for
/Applications/Xcode13.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
Call Stack (most recent call first):
CMakeLists.txt:10 (include)
-- Configuring incomplete, errors occurred!
Furthermore it looks like the -fsanitize=address flag should also be passed to linker options. I would generally recommend setting global options via add_compile_options() and add_link_options() rather than mucking around with CMAKE_CXX_FLAGS or CMAKE_EXE_LINKER_FLAGS directly though, but that's probably a separate issue.
The text was updated successfully, but these errors were encountered:
Hi. Running CMake with the Xcode generator seems to fails the compilation for Address sanitizer on macOS:
Furthermore it looks like the
-fsanitize=address
flag should also be passed to linker options. I would generally recommend setting global options viaadd_compile_options()
andadd_link_options()
rather than mucking around withCMAKE_CXX_FLAGS
orCMAKE_EXE_LINKER_FLAGS
directly though, but that's probably a separate issue.The text was updated successfully, but these errors were encountered: