cmake: fix ENABLE_ASAN detection
authorPeter Wu <peter@lekensteyn.nl>
Tue, 14 Jun 2016 21:52:01 +0000 (14:52 -0700)
committerAnders Broman <a.broman58@gmail.com>
Wed, 15 Jun 2016 06:02:51 +0000 (06:02 +0000)
commitc19e6c24067fd0aa1ea628de85f25ef9ece08839
tree623b2cff865b384319b0612bb3c7970f349c233b
parent3a590217ac60d626cb126aff593b43901585224c
cmake: fix ENABLE_ASAN detection

Do not add -fsanitize=undefined when ASAN is requested, UBSAN is a
different feature (which could be added later as desired). This makes
the -DENABLE_ASAN=1 option match the autotools --enable-asan option.

Fail hard if ASAN support is requested but not supported, this avoids
surprises when something is wrong. Fix ASAN detection by setting the
linker option too.

Note: if you have previously set ENABLE_ASAN=1 with the broken ASAN
detection, you have to clear your CMakeCache.txt file to redo the
detection.

Change-Id: Iba6ca0da0336eccedd0cf31a251baad9d1aff5b4
Reviewed-on: https://code.wireshark.org/review/15908
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
CMakeLists.txt