llvm.org GIT mirror llvm / 1271b9f
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 Oscar Fuentes 10 years ago
1 changed file(s) with 12 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
0 include(FindPerl)
1
2 macro(llvm_config executable)
13 # extra args is the list of link components.
24 if( MSVC )
911
1012 function(msvc_llvm_config executable)
1113 set( link_components ${ARGN} )
14 if( CMAKE_CL_64 )
15 set(include_lflag "/INCLUDE:")
16 else( CMAKE_CL_64 )
17 set(include_lflag "/INCLUDE:_")
18 endif()
1219 foreach(c ${link_components})
1320 if( c STREQUAL "jit" )
14 set(lfgs "${lfgs} /INCLUDE:_X86TargetMachineModule")
21 set(lfgs "${lfgs} ${include_lflag}X86TargetMachineModule")
1522 endif( c STREQUAL "jit" )
1623 list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
1724 if( NOT idx LESS 0 )
18 set(lfgs "${lfgs} /INCLUDE:_${c}TargetMachineModule")
25 set(lfgs "${lfgs} ${include_lflag}${c}TargetMachineModule")
1926 list(FIND LLVM_ASMPRINTERS_FORCE_LINK ${c} idx)
2027 if( NOT idx LESS 0 )
21 set(lfgs "${lfgs} /INCLUDE:_${c}AsmPrinterForceLink")
28 set(lfgs "${lfgs} ${include_lflag}${c}AsmPrinterForceLink")
2229 endif()
2330 endif()
2431 endforeach(c)
107114 "`${LLVM_TOOLS_BINARY_DIR}/llvm-config --libs ${lc}`")
108115 else( NOT HAVE_LLVM_CONFIG )
109116 # tbi: Error handling.
110 if( NOT PERL_FOUND )
117 if( NOT PERL_EXECUTABLE )
111118 message(FATAL_ERROR "Perl required but not found!")
112 endif( NOT PERL_FOUND )
119 endif( NOT PERL_EXECUTABLE )
113120 execute_process(
114121 COMMAND sh -c "${PERL_EXECUTABLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/llvm-config --libs ${lc}"
115122 RESULT_VARIABLE rv