我正在尝试在 Windows 中创建动态库。我按照dart-ffi中的说明进行操作。
这是我的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"
)
您可以使用 in 克隆 repogh repo clone nivekithan/git2dart
您将CMakeFiles.txt
在目录中找到libgit2
。
如果我是cmake .
从这个目录运行的,那么我会收到这条消息
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
但是如果我要跑步,make
我会收到这条消息
make: *** No targets specified and no makefile found. Stop.
谢谢您的帮助