Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
17d52304
Commit
17d52304
authored
Jul 01, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: Simplify build structure
This will make libgit2 more suitable for embedding.
parent
b2cef77c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
CMakeLists.txt
+4
-6
src/hash.c
+1
-3
src/map_posix.c
+4
-1
src/sha1.c
+0
-0
src/sha1.h
+0
-0
No files found.
CMakeLists.txt
View file @
17d52304
...
...
@@ -60,22 +60,20 @@ IF (THREADSAFE)
ENDIF
()
# Collect sourcefiles
FILE
(
GLOB SRC src/*.c
src/backends/*.c
)
FILE
(
GLOB SRC src/*.c
)
FILE
(
GLOB SRC_ZLIB deps/zlib/*.c
)
FILE
(
GLOB SRC_SHA1 src/block-sha1/*.c
)
FILE
(
GLOB SRC_PLAT src/unix/*.c
)
FILE
(
GLOB SRC_H include/git2/*.h
)
# On Windows use specific platform sources
IF
(
WIN32 AND NOT CYGWIN
)
ADD_DEFINITIONS
(
-DWIN32 -D_DEBUG -D_LIB
)
FILE
(
GLOB SRC_PLAT
src/win32/*.c
)
FILE
(
GLOB SRC src/*.c
src/win32/*.c
)
ENDIF
()
ADD_DEFINITIONS
(
-D_FILE_OFFSET_BITS=64
)
# Compile and link libgit2
ADD_LIBRARY
(
git2
${
SRC
}
${
SRC_
PLAT
}
${
SRC_SHA1
}
${
SRC_
ZLIB
}
)
ADD_LIBRARY
(
git2
${
SRC
}
${
SRC_ZLIB
}
)
TARGET_LINK_LIBRARIES
(
git2
${
CMAKE_THREAD_LIBS_INIT
}
)
SET_TARGET_PROPERTIES
(
git2 PROPERTIES VERSION
${
LIBGIT2_VERSION_STRING
}
)
SET_TARGET_PROPERTIES
(
git2 PROPERTIES SOVERSION
${
LIBGIT2_VERSION_MAJOR
}
)
...
...
@@ -97,7 +95,7 @@ IF (BUILD_TESTS)
INCLUDE_DIRECTORIES(tests)
FILE(GLOB SRC_TEST tests/t??-*.c)
ADD_EXECUTABLE(libgit2_test tests/test_main.c tests/test_lib.c tests/test_helpers.c
${
SRC
}
${
SRC_
PLAT
}
${
SRC_SHA1
}
${
SRC_
TEST
}
${
SRC_ZLIB
}
)
ADD_EXECUTABLE(libgit2_test tests/test_main.c tests/test_lib.c tests/test_helpers.c
${
SRC
}
${
SRC_TEST
}
${
SRC_ZLIB
}
)
TARGET_LINK_LIBRARIES(libgit2_test
${
CMAKE_THREAD_LIBS_INIT
}
)
ENABLE_TESTING()
...
...
src/hash.c
View file @
17d52304
...
...
@@ -28,10 +28,8 @@
#if defined(PPC_SHA1)
# include "ppc/sha1.h"
#elif defined(OPENSSL_SHA1)
# include <openssl/sha.h>
#else
# include "
block-sha1/
sha1.h"
# include "sha1.h"
#endif
struct
git_hash_ctx
{
...
...
src/
unix/map
.c
→
src/
map_posix
.c
View file @
17d52304
#include <git2/common.h>
#ifndef GIT_WIN32
#include "map.h"
#include <sys/mman.h>
#include <errno.h>
int
git__mmap
(
git_map
*
out
,
size_t
len
,
int
prot
,
int
flags
,
int
fd
,
git_off_t
offset
)
{
int
mprot
=
0
;
...
...
@@ -58,4 +60,5 @@ int git__munmap(git_map *map)
return
GIT_SUCCESS
;
}
#endif
src/
block-sha1/
sha1.c
→
src/sha1.c
View file @
17d52304
File moved
src/
block-sha1/
sha1.h
→
src/sha1.h
View file @
17d52304
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment