I am trying to create dynamic library in windows. I followed the instruction in dart-ffi.
This is my CMakelists.txt
cmake_minimum_required(VERSION 3.20.2 FATAL_ERROR)
project(libgit VERSION 1.0.0 LANGUAGES C)
add_library(libgit SHARED git2.h)
set_target_properties(libgit PROPERTIES
PUBLIC_HEADER git2dart.h
VERSION {PROJECT_VERSION}
SOVERSION 1
LINKER_LANGUAGE C
OUTPUT_NAME "git2dart"
)
You can clone the repo using in gh repo clone nivekithan/git2dart
You will find the CMakeFiles.txt
in the directory libgit2
.
If I were run cmake .
from this directory then I would get this message
Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.21376.
-- The C compiler identification is MSVC 19.28.29914.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/nivek/Documents/work/git2dart/libgit2
But then If I were to run make
I would get this message
make: *** No targets specified and no makefile found. Stop.
Thanks for the help
cmake /?
and you will see the list of the available generators. At the moment you generate for Visual Studio not notmake
. I personally preferninja