Skip to content

Commit 81675c8

Browse files
committed
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 llvm-svn: 352492
1 parent d442500 commit 81675c8

File tree

4 files changed

+5
-33
lines changed

4 files changed

+5
-33
lines changed

llvm/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ if(NOT DEFINED LLVM_DYLIB_COMPONENTS)
534534
endif()
535535
option(LLVM_LINK_LLVM_DYLIB "Link tools against the libllvm dynamic library" OFF)
536536
if(MSVC)
537-
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" ON)
537+
option(LLVM_BUILD_LLVM_C_DYLIB "Build LLVM-C.dll (Windows only)" OFF)
538538
else()
539539
option(LLVM_BUILD_LLVM_C_DYLIB "Build libllvm-c re-export library (Darwin only)" OFF)
540540
endif()

llvm/tools/llvm-shlib/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,13 @@ if(MSVC)
137137
list(APPEND FULL_LIB_NAMES ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib/${lib}.lib)
138138
endforeach()
139139

140-
# Need to seperate lib names with newlines.
141-
string(REPLACE ";" "\n" FILE_CONTENT "${FULL_LIB_NAMES}")
142-
143-
# Write out the full lib names into file to be read by the python script.
144-
set(LIBSFILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.args)
145-
file(WRITE ${LIBSFILE} "${FILE_CONTENT}")
146-
147140
# Generate the exports file dynamically.
148141
set(GEN_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/gen-msvc-exports.py)
149142

150143
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libllvm-c.exports)
151144

152145
add_custom_command(OUTPUT ${LLVM_EXPORTED_SYMBOL_FILE}
153-
COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} --libsfile ${LIBSFILE} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
146+
COMMAND ${PYTHON_EXECUTABLE} ${GEN_SCRIPT} ${FULL_LIB_NAMES} ${GEN_UNDERSCORE} --nm ${LLVM_TOOLS_BINARY_DIR}/llvm-nm -o ${LLVM_EXPORTED_SYMBOL_FILE}
154147
DEPENDS ${LIB_NAMES} llvm-nm
155148
COMMENT "Generating export list for LLVM-C"
156149
VERBATIM )

llvm/tools/llvm-shlib/gen-msvc-exports.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ def gen_llvm_c_export(output, underscore, libs, nm):
8282
def main():
8383
parser = argparse.ArgumentParser('gen-msvc-exports')
8484

85-
parser.add_argument(
86-
'-i', '--libsfile', help='file with list of libs, new line separated',
87-
action='store', default=None
88-
)
8985
parser.add_argument(
9086
'-o', '--output', help='output filename', default='LLVM-C.exports'
9187
)
@@ -97,19 +93,12 @@ def main():
9793
'--nm', help='path to the llvm-nm executable', default='llvm-nm'
9894
)
9995
parser.add_argument(
100-
'libs', metavar='LIBS', nargs='*', help='list of libraries to generate export from'
96+
'libs', metavar='LIBS', nargs='+', help='list of libraries to generate export from'
10197
)
10298

10399
ns = parser.parse_args()
104100

105-
libs = ns.libs
106-
107-
# Add if we where given a libsfile add it to the libs.
108-
if ns.libsfile:
109-
with open(ns.libsfile) as f:
110-
libs.extend(f.read().splitlines())
111-
112-
gen_llvm_c_export(ns.output, ns.underscore, libs, ns.nm)
101+
gen_llvm_c_export(ns.output, ns.underscore, ns.libs, ns.nm)
113102

114103

115104
if __name__ == '__main__':

llvm/utils/release/build_llvm_package.bat

+1-11
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,7 @@ svn.exe export -r %revision% http://llvm.org/svn/llvm-project/lldb/%branch% llvm
5252

5353

5454
REM Setting CMAKE_CL_SHOWINCLUDES_PREFIX to work around PR27226.
55-
set cmake_flags=^
56-
-DCMAKE_BUILD_TYPE=Release ^
57-
-DLLVM_ENABLE_ASSERTIONS=ON ^
58-
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ^
59-
-DLLVM_BUILD_LLVM_C_DYLIB=ON ^
60-
-DCMAKE_INSTALL_UCRT_LIBRARIES=ON ^
61-
-DCLANG_FORMAT_VS_VERSION=%clang_format_vs_version% ^
62-
-DPACKAGE_VERSION=%package_version% ^
63-
-DLLDB_RELOCATABLE_PYTHON=1 ^
64-
-DLLDB_TEST_COMPILER=%cd%\build32_stage0\bin\clang.exe ^
65-
-DCMAKE_CL_SHOWINCLUDES_PREFIX="Note: including file: "
55+
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: "
6656

6757
REM TODO: Run the "check-all" tests.
6858

0 commit comments

Comments
 (0)