aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2009-01-22 01:20:31 +0000
committerOscar Fuentes <ofv@wanadoo.es>2009-01-22 01:20:31 +0000
commit1271b9f071755eefcffce25d507cad43941cf566 (patch)
tree4d7b6a66d832a506deaac560811529c384a4f1b5 /cmake
parent2b5326e7240ac524812016bc3700e12045bf0eb1 (diff)
downloadexternal_llvm-1271b9f071755eefcffce25d507cad43941cf566.zip
external_llvm-1271b9f071755eefcffce25d507cad43941cf566.tar.gz
external_llvm-1271b9f071755eefcffce25d507cad43941cf566.tar.bz2
CMake: Tests PERL availability with PERL_EXECUTABLE variable.
On MSVC 64bits, does not put underscore before the symbol name on the /INCLUDE linker parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rwxr-xr-xcmake/modules/LLVMConfig.cmake17
1 files changed, 12 insertions, 5 deletions
diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake
index 6ed89ba..72c4dca 100755
--- a/cmake/modules/LLVMConfig.cmake
+++ b/cmake/modules/LLVMConfig.cmake
@@ -1,3 +1,5 @@
+include(FindPerl)
+
macro(llvm_config executable)
# extra args is the list of link components.
if( MSVC )
@@ -10,16 +12,21 @@ endmacro(llvm_config)
function(msvc_llvm_config executable)
set( link_components ${ARGN} )
+ if( CMAKE_CL_64 )
+ set(include_lflag "/INCLUDE:")
+ else( CMAKE_CL_64 )
+ set(include_lflag "/INCLUDE:_")
+ endif()
foreach(c ${link_components})
if( c STREQUAL "jit" )
- set(lfgs "${lfgs} /INCLUDE:_X86TargetMachineModule")
+ set(lfgs "${lfgs} ${include_lflag}X86TargetMachineModule")
endif( c STREQUAL "jit" )
list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
if( NOT idx LESS 0 )
- set(lfgs "${lfgs} /INCLUDE:_${c}TargetMachineModule")
+ set(lfgs "${lfgs} ${include_lflag}${c}TargetMachineModule")
list(FIND LLVM_ASMPRINTERS_FORCE_LINK ${c} idx)
if( NOT idx LESS 0 )
- set(lfgs "${lfgs} /INCLUDE:_${c}AsmPrinterForceLink")
+ set(lfgs "${lfgs} ${include_lflag}${c}AsmPrinterForceLink")
endif()
endif()
endforeach(c)
@@ -108,9 +115,9 @@ macro(nix_llvm_config executable)
"`${LLVM_TOOLS_BINARY_DIR}/llvm-config --libs ${lc}`")
else( NOT HAVE_LLVM_CONFIG )
# tbi: Error handling.
- if( NOT PERL_FOUND )
+ if( NOT PERL_EXECUTABLE )
message(FATAL_ERROR "Perl required but not found!")
- endif( NOT PERL_FOUND )
+ endif( NOT PERL_EXECUTABLE )
execute_process(
COMMAND sh -c "${PERL_EXECUTABLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-config --libs ${lc}"
RESULT_VARIABLE rv