First of all I have no experience with c
and its ecosystem so the questions I ask could be too basic.
I am trying to create dart
bindings for libgit2. To do that I have to create dynamic library. I followed the steps from the Official documentation (dart .dev/guides/libraries/c-interop)
discourse .cmake .org is not allowing to post more than two links, thats why above text is not link
This repo nivekithan/git2dart contains my effort on creating dynamic library.
Before posting here I have also asked the same question in stack-overflow (stackoverflow .com/questions/67505823/cmake-is-not-making-makefile?noredirect=1#67507666)
I will repeat the content in stackoverflow
here also
I am trying to create dynamic library in windows. I followed the instruction in (github .com/dart-lang/samples/tree/master/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