OSDN Git Service

[llvm-config] Canonicalize CMake booleans to 0/1
authorMichal Gorny <mgorny@gentoo.org>
Tue, 10 Jan 2017 19:55:51 +0000 (19:55 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Tue, 10 Jan 2017 19:55:51 +0000 (19:55 +0000)
commit71b86987035621cd18b1025eb57f2866373243cd
tree7c14249c97c63dbabadf2bc7eb93f68fdf64b8df
parent8548be38d13b6aafb361efffb8e621618b0d50e3
[llvm-config] Canonicalize CMake booleans to 0/1

Following the similar change to lit configuration, ensure that all CMake
booleans are canonicalized to 0/1 when being passed to llvm-config. This
fixes the incorrect interpretation of values when user passes another
value than the ON/OFF, and simplifies the code by removing unnecessary
string matching.

Furthermore, the code for --has-rtti and --has-global-isel has been
modified to print consistent values indepdently of the boolean used by
passed by the user to CMake. Sadly, the code already implicitly used
different values for the two (YES/NO for --has-rtti, ON/OFF for
--has-global-isel).

Include tests for all booleans and multi-value options in llvm-config.

Differential Revision: https://reviews.llvm.org/D28366

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291593 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-config/booleans.test [new file with mode: 0644]
tools/llvm-config/BuildVariables.inc.in
tools/llvm-config/CMakeLists.txt
tools/llvm-config/llvm-config.cpp