[PATCH] [go] Teach the go cmake build functions to funnel the include directories down into the cgo-setup variables of llvm-go.
Chandler Carruth
chandlerc at gmail.com
Mon Dec 29 14:51:47 PST 2014
REPOSITORY
rL LLVM
http://reviews.llvm.org/D6798
Files:
llvm/trunk/cmake/modules/AddLLVM.cmake
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -628,9 +628,14 @@
set(binpath ${CMAKE_BINARY_DIR}/bin/${binary}${CMAKE_EXECUTABLE_SUFFIX})
set(cc "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}")
set(cxx "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}")
+ set(cppflags "")
+ get_property(include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+ foreach(d ${include_dirs})
+ set(cppflags "${cppflags} -I${d}")
+ endforeach(d)
set(ldflags "${CMAKE_EXE_LINKER_FLAGS}")
add_custom_command(OUTPUT ${binpath}
- COMMAND ${CMAKE_BINARY_DIR}/bin/llvm-go "cc=${cc}" "cxx=${cxx}" "ldflags=${ldflags}"
+ COMMAND ${CMAKE_BINARY_DIR}/bin/llvm-go "cc=${cc}" "cxx=${cxx}" "cppflags=${cppflags}" "ldflags=${ldflags}"
${ARG_GOFLAGS} build -o ${binpath} ${pkgpath}
DEPENDS llvm-config ${CMAKE_BINARY_DIR}/bin/llvm-go${CMAKE_EXECUTABLE_SUFFIX}
${llvmlibs} ${ARG_DEPENDS}
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6798.17682.patch
Type: text/x-patch
Size: 1093 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141229/8d55e296/attachment.bin>
More information about the llvm-commits
mailing list