llvm.org GIT mirror llvm / 48be38f
Revert r351833 and r352250. They were breaking the Windows build when using MSBuild, see the discussion on D56781. r351833: "Use response file when generating LLVM-C.dll" > Use response file when generating LLVM-C.dll > > As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me. > > Commited on behalf of Jakob Bornecrantz > > Differential Revision: https://reviews.llvm.org/D56781 r352250: "Build LLVM-C.dll by default on windows and enable in release package" > Build LLVM-C.dll by default on windows and enable in release package > > With the fixes to the building of LLVM-C.dll in D56781 this should now > be safe to land. This will greatly simplify dealing with LLVM for people > that just want to use the C API on windows. This is a follow up from > D35077. > > Patch by Jakob Bornecrantz! > > Differential revision: https://reviews.llvm.org/D56774 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352492 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 1 year, 8 months ago
4 changed file(s) with 5 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
533533 endif()
534534 option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
535535 if(MSVC)
536 option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON)
536 option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" OFF)
537537 else()
538538 option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
539539 endif()
136136 list(APPEND FULL_LIB_NAMES ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${lib}.lib)
137137 endforeach()
138138
139 # Need to seperate lib names with newlines.
140 string(REPLACE ";" "\n" FILE_CONTENT "${FULL_LIB_NAMES}")
141
142 # Write out the full lib names into file to be read by the python script.
143 set(LIBSFILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.args)
144 file(WRITE ${LIBSFILE} "${FILE_CONTENT}")
145
146139 # Generate the exports file dynamically.
147140 set(GEN_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/gen-msvc-exports.py)
148141
149142 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports)
150143
151144 add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
152 COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
145 COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} ${FULL_LIB_NAMES} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
153146 DEPENDS ${LIB_NAMES} llvm-nm
154147 COMMENT "Generating export list for LLVM-C"
155148 VERBATIM )
8282 parser = argparse.ArgumentParser('gen-msvc-exports')
8383
8484 parser.add_argument(
85 '-i', '--libsfile', help='file with list of libs, new line separated',
86 action='store', default=None
87 )
88 parser.add_argument(
8985 '-o', '--output', help='output filename', default='LLVM-C.exports'
9086 )
9187 parser.add_argument('-u', '--underscore',
9692 '--nm', help='path to the llvm-nm executable', default='llvm-nm'
9793 )
9894 parser.add_argument(
99 'libs', metavar='LIBS', nargs='*', help='list of libraries to generate export from'
95 'libs', metavar='LIBS', nargs='+', help='list of libraries to generate export from'
10096 )
10197
10298 ns = parser.parse_args()
10399
104 libs = ns.libs
105
106 # Add if we where given a libsfile add it to the libs.
107 if ns.libsfile:
108 with open(ns.libsfile) as f:
109 libs.extend(f.read().splitlines())
110
111 gen_llvm_c_export(ns.output, ns.underscore, libs, ns.nm)
100 gen_llvm_c_export(ns.output, ns.underscore, ns.libs, ns.nm)
112101
113102
114103 if __name__ == '__main__':
5151
5252
5353 REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
54 set cmake_flags=^
55 -DCMAKE_BUILD_TYPE=Release ^
56 -DLLVM_ENABLE_ASSERTIONS=ON ^
57 -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ^
58 -DLLVM_BUILD_LLVM_C_DYLIB=ON ^
59 -DCMAKE_INSTALL_UCRT_LIBRARIES=ON ^
60 -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% ^
61 -DPACKAGE_VERSION=%package_version% ^
62 -DLLDB_RELOCATABLE_PYTHON=1 ^
63 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe ^
64 -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
54 set cmake_flags=-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DCMAKE_INSTALL_UCRT_LIBRARIES=ON -DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% -DPACKAGE_VERSION=%package_version% -DLLDB_RELOCATABLE_PYTHON=1 -DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe -DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
6555
6656 REM TODO: Run the "check-all" tests.
6757