mirror of
https://github.com/janet-lang/janet
synced 2024-09-07 21:16:58 +00:00
Make meson build work on windows.
By default, use more traditional linking pattern with meson. The janet.exe will now link to janet-x.x.dll on windows (and similar for linux/posix) when built with meson. This is slightly less efficient and means that janet.exe built this way is no longer standalone (you would need to move the dll along with the exe), but plays better with most build systems.
This commit is contained in:
parent
e00a461c26
commit
2f4a6214a2
@ -64,10 +64,6 @@ rc /nologo /fobuild\janet_win.res janet_win.rc
|
||||
%JANET_LINK% /out:janet.exe build\janet.obj build\shell.obj build\janet_win.res
|
||||
@if errorlevel 1 goto :BUILDFAIL
|
||||
|
||||
@rem Build dynamic library (dlljanet.dll)
|
||||
%JANET_LINK% /DLL /out:build\dlljanet.dll build\janet.obj
|
||||
@if errorlevel 1 goto :BUILDFAIL
|
||||
|
||||
@rem Build static library (libjanet.lib)
|
||||
%JANET_LINK_STATIC% /out:build\libjanet.lib build\janet.obj
|
||||
@if errorlevel 1 goto :BUILDFAIL
|
||||
@ -126,8 +122,6 @@ copy janet.def dist\janet.def
|
||||
janet.exe tools\patch-header.janet src\include\janet.h src\conf\janetconf.h build\janet.h
|
||||
copy build\janet.h dist\janet.h
|
||||
copy build\libjanet.lib dist\libjanet.lib
|
||||
copy build\dlljanet.dll dist\dlljanet.dll
|
||||
copy build\dlljanet.lib dist\dlljanet.lib
|
||||
|
||||
@rem Create installer
|
||||
janet.exe -e "(->> janet/version (peg/match ''(* :d+ `.` :d+ `.` :d+)) first print)" > build\version.txt
|
||||
|
13
meson.build
13
meson.build
@ -182,23 +182,30 @@ if not get_option('single_threaded')
|
||||
janet_dependencies += thread_dep
|
||||
endif
|
||||
|
||||
if cc.has_argument('-fvisibility=hidden')
|
||||
lib_cflags = ['-fvisibility=hidden']
|
||||
else
|
||||
lib_cflags = []
|
||||
endif
|
||||
libjanet = library('janet', janetc,
|
||||
include_directories : incdir,
|
||||
dependencies : janet_dependencies,
|
||||
version: meson.project_version(),
|
||||
soversion: version_parts[0] + '.' + version_parts[1],
|
||||
c_args : lib_cflags,
|
||||
install : true)
|
||||
|
||||
# Extra c flags - adding -fvisibility=hidden matches the Makefile and
|
||||
# shaves off about 10k on linux x64, likely similar on other platforms.
|
||||
if cc.has_argument('-fvisibility=hidden')
|
||||
extra_cflags = ['-fvisibility=hidden']
|
||||
extra_cflags = ['-fvisibility=hidden', '-DJANET_DLL_IMPORT']
|
||||
else
|
||||
extra_cflags = []
|
||||
extra_cflags = ['-DJANET_DLL_IMPORT']
|
||||
endif
|
||||
janet_mainclient = executable('janet', janetc, mainclient_src,
|
||||
janet_mainclient = executable('janet', mainclient_src,
|
||||
include_directories : incdir,
|
||||
dependencies : janet_dependencies,
|
||||
link_with: [libjanet],
|
||||
c_args : extra_cflags,
|
||||
install : true)
|
||||
|
||||
|
@ -132,12 +132,6 @@
|
||||
<Component Directory="CDir">
|
||||
<File Source="dist\libjanet.lib"/>
|
||||
</Component>
|
||||
<Component Directory="CDir">
|
||||
<File Source="dist\dlljanet.dll"/>
|
||||
</Component>
|
||||
<Component Directory="CDir">
|
||||
<File Source="dist\dlljanet.lib"/>
|
||||
</Component>
|
||||
|
||||
<Component Id="LibraryComponent" Directory="LibraryDir" Guid="3860e981-5f94-4002-b5d5-2d9ec0d2792d" KeyPath="yes">
|
||||
<RemoveFolder Id="RemoveLibraryDir" On="uninstall" />
|
||||
|
Loading…
Reference in New Issue
Block a user