mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 09:05:10 +00:00
Windows build fixes when symlink is not available.
This commit is contained in:
parent
0016d214c3
commit
0405c3a41a
@ -10,7 +10,7 @@ install:
|
||||
environment:
|
||||
CLICOLOR_FORCE: 1
|
||||
matrix:
|
||||
- MSYSTEM: MINGW64
|
||||
# - MSYSTEM: MINGW64
|
||||
- MSYSTEM: MSVC
|
||||
|
||||
build_script:
|
||||
@ -18,7 +18,7 @@ build_script:
|
||||
If ($Env:MSYSTEM -Eq "MSVC") {
|
||||
$dir = "cquery-${env:appveyor_build_version}-win64"
|
||||
cd C:\projects\cquery
|
||||
python waf configure --msvc_version="msvc 15.0"
|
||||
python waf configure
|
||||
python waf build
|
||||
mkdir "${dir}\build\release\bin" -ea 0
|
||||
mkdir "${dir}\build\release\lib\LLVM-5.0.1-win64\lib\clang\5.0.1\"
|
||||
|
29
wscript
29
wscript
@ -133,6 +133,18 @@ def download_and_extract(destdir, url, ext):
|
||||
else:
|
||||
print('Found extracted at {0}'.format(destdir))
|
||||
|
||||
def copy_or_symlink(src, dst):
|
||||
print('copy_or_symlink src={0}, dst={1}'.format(src, dst))
|
||||
try:
|
||||
os.makedirs(os.path.dirname(dst))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
try:
|
||||
os.symlink(src, dst)
|
||||
except (OSError, NotImplementedError):
|
||||
shutil.copy(src, dst)
|
||||
|
||||
def configure(ctx):
|
||||
ctx.resetenv(ctx.options.variant)
|
||||
|
||||
@ -300,19 +312,12 @@ def configure(ctx):
|
||||
elif sys.platform == 'darwin':
|
||||
ctx.env.rpath = ['@loader_path/../lib/' + clang_tarball_name + '/lib']
|
||||
elif sys.platform == 'win32':
|
||||
# Poor Windows users' RPATH - copy libclang.lib and libclang.dll to the build directory.
|
||||
ctx.env.rpath = [] # Unsupported
|
||||
name = os.path.basename(os.path.dirname(ctx.env['LIBPATH_clang'][0]))
|
||||
# Poor Windows users' RPATH
|
||||
out_clang_dll = os.path.join(ctx.path.get_bld().abspath(), 'bin', 'libclang.dll')
|
||||
try:
|
||||
os.makedirs(os.path.dirname(out_clang_dll))
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
dst = os.path.join(ctx.path.get_bld().abspath(), 'lib', name, 'bin', 'libclang.dll')
|
||||
os.symlink(dst, out_clang_dll)
|
||||
except (OSError, NotImplementedError):
|
||||
shutil.copy(out_clang_dll, dst)
|
||||
clang_dir = os.path.dirname(ctx.env['LIBPATH_clang'][0])
|
||||
dest_dir = os.path.join(ctx.path.get_bld().abspath(), ctx.options.variant, 'bin')
|
||||
# copy_or_symlink(os.path.join(clang_dir, 'lib', 'libclang.lib'), os.path.join(dest_dir, 'libclang.lib'))
|
||||
copy_or_symlink(os.path.join(clang_dir, 'bin', 'libclang.dll'), os.path.join(dest_dir, 'libclang.dll'))
|
||||
else:
|
||||
ctx.env.rpath = ctx.env['LIBPATH_clang']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user