![]() NOTE: It’s highly recommended that you build libgit2 as a static library for Xcode projects. ![]() You can do this with a post-build script (check “Build Events”), or by including the git2.vcxproj file in your solution, and changing its output directory to match where the rest of your binaries go. If it’s a DLL, you’ll have to make sure that git2.dll gets into the same directory as your output EXE file. If you built libgit2 as a static library, you’re done! You may want to configure this path differently for a Release build.įinally, add git2.lib to the list of libraries to link in: The linker will need to know where to find the git2.lib file.Īdd C:\path\to\libgit2\build\Debug to “Linker > General > Additional Library Directories”. Make sure you’re configuring the proper build configuration:Īdd C:\path\to\libgit2\include to “Additional Include Directories” under “C/C++ > General”. Open up the project settings by clicking on the project in the Solution Explorer, and selecting Properties. Your Visual Studio project will need to know where to find the libgit2 headers and link libraries. You’ll need to include git2.h, and link to the binaries you built previously. Once you have a build, you probably want to use it from within your application. Take a look at the CMakeLists.txt file for more information. (MSVC Only) libgit2 will link the static CRT libraries. If you’re working with Win32 or the CLR, set this to ON to build with the stdcall convention. (MSVC Only) By default, libgit2 builds with the cdecl calling convention. This option is useful to know what version of libgit2 was built, if your build system doesn’t embed that information into the binary. ![]() For example, if this is set to foo, the output will be something like foo.dll or foo.so. This defaults to ON, unless you know your application will only be single-threaded, it’s recommended you leave it ON. Selects whether libgit2 tries to be threadsafe. This defaults to ON set to OFF for a faster build. Selects whether the unit-test suite is built. In the case of Visual Studio and other multi-configuration project systems, this selects the default build configuration. This selects the build configuration available options are Debug (the default), Release, and RelWithDebInfo. Set it to OFF if you want the build to generate static libraries. This defaults to ON, which produces dynamic libraries (DLLs on Windows). These are set by passing -D= to CMake during the project-file generation step. The CMake build system provides lots of options to configure the libgit2 build for your particular needs. If you want to change either of these defaults, you have to specify a “generator” to CMake using the -G flag. The default set of commands above result in a build that’s the same bitness as your command prompt – a command prompt configured for 64-bit cross-compile tools will result in a 64-bit git2.dll.Īlso note that CMake is generating a Visual Studio solution file and several project files, and by default it chooses the latest version of Visual Studio that’s installed on your machine. The commands above should be run from within a Visual Studio command prompt an SDK prompt will not work. This also builds libgit2’s unit-test suite to run it, just run. libgit2.so on Windows, it’s usually Debug\git2.dll. ) includes target "SDL2_mixer" which requires target "SDL2" that is not in any export set.īut when re-running this command without cleaning build folder the error disappears.On posix-type systems, the output is typically. ) includes target "SDL2_image" which requires target "SDL2" that is not in any export set.ĬMake Error: install(EXPORT "SDL2MixerTargets". Target_link_libraries(sdlproject SDL2 SDL2_image SDL2_mixer)Īfter building it, copying SDL2.dll, SDL2_image.dll, SDL2_mixer.dll into build folder and running executable I get the following error:Īlso when generating makefiles with cmake -G "MinGW Makefiles" it throws following error: CMake Error: install(EXPORT "SDL2ImageExports". Target_link_libraries(sdlproject SDL2main) Here is my CMakeLists: cmake_minimum_required(VERSION 3.6)įile(GLOB_RECURSE SDLPROJECT_SRC CONFIGURE_DEPENDS "src/*.h" "src/*.cpp")Īdd_executable(sdlproject $) I have an Android SDL2 project and I want to build it for Windows using MSYS2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |