[PATCH] [Cmake]

Mike Edwards mike at sqlby.me
Mon Mar 16 13:22:27 PDT 2015


Hi,
I ran into a problem the other day while running cmake.  I got confused as
to which triple I was actually targeting for a build.  After a bit of
looking and asking questions of a peer, I found that I may not be the only
person having an issue with the cmake output of triple information.  I have
attached a patch which I hope will help to clarify the Host triple being
used for the build and the default triple the build will be targeting.  I
think if we always output the Host triple and the Default Target Triple
(even when they are the same) this will remove any ambiguity.  If this
patch is acceptable, I would appreciate it if someone would commit this
patch for me as I do not have commit privileges myself.  Thanks.

Respectfully,

Mike Edwards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150316/4dfc8016/attachment.html>
-------------- next part --------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfbf956..a8084b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -365,6 +365,7 @@ include(config-ix)
 set(LLVM_DEFAULT_TARGET_TRIPLE "${LLVM_HOST_TRIPLE}" CACHE STRING
   "Default target for which LLVM will generate code." )
 set(TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}")
+message(STATUS "Default target triple: " ${LLVM_DEFAULT_TARGET_TRIPLE})
 
 include(HandleLLVMOptions)
 
diff --git a/cmake/modules/GetHostTriple.cmake b/cmake/modules/GetHostTriple.cmake
index 671a8ce..422f838 100644
--- a/cmake/modules/GetHostTriple.cmake
+++ b/cmake/modules/GetHostTriple.cmake
@@ -26,5 +26,5 @@ function( get_host_triple var )
     set( value ${TT_OUT} )
   endif( MSVC )
   set( ${var} ${value} PARENT_SCOPE )
-  message(STATUS "Target triple: ${value}")
+  message(STATUS "Host triple: ${value}")
 endfunction( get_host_triple var )


More information about the llvm-commits mailing list