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

CMake error with many project languages #19

Open
apmanol opened this issue Jul 10, 2018 · 2 comments
Open

CMake error with many project languages #19

apmanol opened this issue Jul 10, 2018 · 2 comments

Comments

@apmanol
Copy link

apmanol commented Jul 10, 2018

Hello all,

in case you set

+++ b/CMakeLists.txt
@@ -33,7 +33,7 @@
 cmake_minimum_required(VERSION 2.8)
 
 # project name
-project("CMake-sanitizers")
+project("CMake-sanitizers" C CXX ASM)

then

mkdir build && cd build && cmake .. 
cmake -DSANITIZE_ADDRESS:BOOL=ON ..
-- Try GNU AddressSanitizer flag = [-g -fsanitize=address -fno-omit-frame-pointer]
-- Try GNU AddressSanitizer flag = [-g -fsanitize=address]
-- Try GNU AddressSanitizer flag = [-g -faddress-sanitizer]
CMake Warning at cmake/sanitize-helpers.cmake:143 (message):
  AddressSanitizer is not available for GNU compiler.  Targets using this
  compiler will be compiled without AddressSanitizer.
Call Stack (most recent call first):
  cmake/FindASan.cmake:46 (sanitizer_check_compiler_flags)
  cmake/FindSanitizers.cmake:37 (find_package)
  CMakeLists.txt:50 (find_package)

Although without the ASM works as it should.

@alehaa
Copy link
Contributor

alehaa commented Jul 10, 2018

Oh, I don‘t think that was the intention of my implementation. ;)

I guess Sanitizers aren‘t available for assembler, the result is cached for gcc, so the module prints a warning about gcc doesn‘t support sanitizers et all.

@apmanol
Copy link
Author

apmanol commented Jul 10, 2018

Indeed, that's the case and the flag is not added anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants