Since I have to ensure every external libraries I use is compiled with MSVC because LOVE is compiled with MSVC and I have to ensure (ABI) stability, I can't use the prebuilt binaries which is compiled with MinGW.
There are some modifications that needed to successfully compile it under MSVC
Add LUA_BUILD_AS_DLL compile definitions to the CMake if the toolchain is MSVC.
Add #define LUA_LIB in nuklear_love before #include <lua.h>.
Both steps is required to ensure luaopen_nuklear exported to the DLL. The build instruction, is easy.
rem Say, %LUA_DIR% is the LuaJIT dir, excluding the "src" dir
rem and you've invoked "msvcbuild.bat" under LuaJIT src directory
rem using VS command prompt, then build love-nuklear like this
cmake -Bbuild -H. -DLUA_INCLUDE_DIR=%LUA_DIR%\src -DLUA_LIBRARY=%LUA_DIR%\src\lua51.lib -DCMAKE_INSTALL_PREFIX=%CD%\install
cmake --build build --config Release --target install
Then you can found nuklear.dll in install folder ready to be used, compiled with MSVC.
I followed your instructions and ended up with a .dll that crashes on start. Maybe you could make a quick pull request so I can test things the way you have them set up?
Since I have to ensure every external libraries I use is compiled with MSVC because LOVE is compiled with MSVC and I have to ensure (ABI) stability, I can't use the prebuilt binaries which is compiled with MinGW.
There are some modifications that needed to successfully compile it under MSVC
LUA_BUILD_AS_DLL
compile definitions to the CMake if the toolchain is MSVC.#define LUA_LIB
in nuklear_love before#include <lua.h>
.Both steps is required to ensure
luaopen_nuklear
exported to the DLL. The build instruction, is easy.Then you can found nuklear.dll in
install
folder ready to be used, compiled with MSVC.