[libc++] Fix a few incorrect CMake configuration options
authorLouis Dionne <ldionne.2@gmail.com>
Mon, 14 Aug 2023 22:14:02 +0000 (18:14 -0400)
committerTobias Hieta <tobias@hieta.se>
Mon, 21 Aug 2023 08:01:22 +0000 (10:01 +0200)
commit271731ed706511b501a22e2df909cbdc27219846
tree50f433b3eb12ffc89f1107417d50a72ccb3bdb3b
parentdb0bf3b664422b758e659f93cc1cfda49cbaa507
[libc++] Fix a few incorrect CMake configuration options

This patch fixes a few CMake options that were set using incorrect
mechanisms.

CMake's man page for the -D <var>=<value> option states: If a command in
the project sets the type to PATH or FILEPATH, then the <value> will be
converted to an absolute path. That's not what we want for most of the
paths we have as configuration options. Otherwise, using -D to set the
configuration option results in an absolute path being used, which
breaks things.

option() denotes a boolean variable, but what was desired was a
string/list variable. Fix this to prevent cmake from changing any
non-empty user provided values to 'ON'.

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

(cherry picked from commit 760261a3daf98882ccbd177e3133fb4a058f47ad)
libcxx/CMakeLists.txt
libcxxabi/CMakeLists.txt