premake-core
premake-core copied to clipboard
Shared lib in seperate target folder.
This might be related to #361?
What are you trying to do? I have different configurations (debug, debugfast, release) for my workspace, but I have one project that i always want as a dll with optimizations on high.
my config looks like that
project "lib.raylib"
kind "SharedLib"
optimize "Size"
targetname "raylib"
targetsuffix ""
it would also be nice to build the project into a different folder like that
targetdir ".build/libs"
Problem is, when I do so both .lib and .dll will end up in the libs folder, what is what I want, but then my application isn't starting anymore because it can't find "raylib.dll". Is there a way in premake to add the .build/libs
folder as a searching folder for dlls?
Does this do what you need?
https://premake.github.io/docs/libdirs
The problem is that libdirs won't help with my exe not finding the dll, which isn't in the same folder
Can you use a post build command to copy the DLL to the same directory as the executable?
Guess that's what I am going to do. I was hoping there is a way to tell VS directly to load dll's from a different location.
If you can find a way to tell VS explicitly (outside of premake), let me know and I'll see what can be done to add it to premake.
dll are looked in PATH (and local directory) on windows, (*nix uses LD_LIBRARY_PATH
).
On *nix, you might prepend variable setting before launching application as PATH=$PATH:some_path my_app
.
Don't know if Windows have similar way.
Late to follow up, but here's a reference to the load order: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
I think at this point this is something that's closeable. I don't know of a way to do it without copying the files to a location on the DLL search path hierarchy, which can be done with post build commands.