Re: dub libs from home directory on windows

2020-03-18 Thread evilrat via Digitalmars-d-learn

On Wednesday, 18 March 2020 at 19:53:58 UTC, jmh530 wrote:
On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев 
wrote:

On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:


I cannot build my app, so I was wondering if there is some 
clever way to solve this without hardcoded path to my profile 
name.


Thank you very much for your help.


I see, you want without hardcoded path...


I usually something like ./folder/file.extension to avoid a 
hardcoded path.


I also recommend taking a look at some other dub files to get a 
sense of how others do it.


Even better option is to just use "libs" section as usual(no 
paths, just names) and set environment variable specific to your 
machine prior to build.
For MS linker it is 'LIB' with semicolon as delimiter, for Linux 
it is 'LIBRARY_PATH'.


This way it is much more 'portable' and CI friendly, though it 
definitely will add confusion and 'annoyance' for first time 
users.


example batch:

  set LIB=C:\someproject\libs;E:\superduper\lib64
  dub build



Re: dub libs from home directory on windows

2020-03-18 Thread jmh530 via Digitalmars-d-learn

On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев wrote:

On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:


I cannot build my app, so I was wondering if there is some 
clever way to solve this without hardcoded path to my profile 
name.


Thank you very much for your help.


I see, you want without hardcoded path...


I usually something like ./folder/file.extension to avoid a 
hardcoded path.


I also recommend taking a look at some other dub files to get a 
sense of how others do it.


Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn

On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:


I cannot build my app, so I was wondering if there is some 
clever way to solve this without hardcoded path to my profile 
name.


Thank you very much for your help.


I see, you want without hardcoded path...



Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn

On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:

Hi there,
I'm using d2sqlite3 which has dependency on sqlite3.lib. When 
I'm building my app on windows I have a dub.sdl which has a line


libs 
"%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platform="windows-x86_64-dmd"


but unless I specify full path using specific user profile name 
on windows like so


"c:/user/abby/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3"

I cannot build my app, so I was wondering if there is some 
clever way to solve this without hardcoded path to my profile 
name.


Thank you very much for your help.


I see it in CairoD.
dub.json

{
...

"configurations": [
{
"name": "unittest",
"targetType": "executable",
"mainSourceFile": "unittest.d",
"versions": ["CairoPNG"],
"targetPath": "bin",
"libs-posix": ["cairo"],
"libs-windows-x86-dmd": ["lib/32/mars/cairo"],
"libs-windows-x86-gdc": ["lib/32/msvc_mingw/cairo"],
"libs-windows-x86-ldc": ["lib/32/msvc_mingw/cairo"],
"libs-windows-x86_64": ["lib/64/cairo"],
"copyFiles-windows-x86": ["lib/32/*.dll"],
"copyFiles-windows-x86_64": ["lib/64/*.dll"]
}
]
}


folders:
./
  lib/
 32/
   mars/
 cairo.lib
   msvc_mingw/
 cairo.lib
 64/
   cairo.lib




Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn

On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote:

Hi there,
I'm using d2sqlite3 which has dependency on sqlite3.lib. When 
I'm building my app on windows I have a dub.sdl which has a line


libs 
"%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platform="windows-x86_64-dmd"


but unless I specify full path using specific user profile name 
on windows like so


"c:/user/abby/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3"

I cannot build my app, so I was wondering if there is some 
clever way to solve this without hardcoded path to my profile 
name.


Thank you very much for your help.


Of course, you will use "sqlite3.lib" instead "cairo.lib".



dub libs from home directory on windows

2020-03-18 Thread Abby via Digitalmars-d-learn

Hi there,
I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm 
building my app on windows I have a dub.sdl which has a line


libs 
"%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platform="windows-x86_64-dmd"


but unless I specify full path using specific user profile name 
on windows like so


"c:/user/abby/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3"

I cannot build my app, so I was wondering if there is some clever 
way to solve this without hardcoded path to my profile name.


Thank you very much for your help.