OSDN Git Service

cmake: Use "set" instead of "option" for LLVM_ENABLE_LTO
authorJustin Bogner <mail@justinbogner.com>
Mon, 8 Feb 2016 21:55:19 +0000 (21:55 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 8 Feb 2016 21:55:19 +0000 (21:55 +0000)
Apparently option is for bools and cmake-gui will display this
strangely with option.

Pointed out by edward-san - thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260154 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake

index 8156e8c..1ec16e8 100644 (file)
@@ -656,7 +656,7 @@ append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
   CMAKE_EXE_LINKER_FLAGS
   CMAKE_SHARED_LINKER_FLAGS)
 
-option(LLVM_ENABLE_LTO "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO" OFF)
+set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO")
 string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)
 if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
   append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS