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
25804185
Commit
25804185
authored
May 23, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #716 from scottjg/examples-cleanup
Build fixes for examples/
parents
33593265
62986ff6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
.travis.yml
+1
-1
CMakeLists.txt
+16
-0
examples/general.c
+1
-1
No files found.
.travis.yml
View file @
25804185
...
...
@@ -7,7 +7,7 @@ language: erlang
# Settings to try
env
:
-
OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release"
-
OPTIONS="-DBUILD_CLAR=ON"
-
OPTIONS="-DBUILD_CLAR=ON
-DBUILD_EXAMPLES=ON
"
# Make sure CMake is installed
install
:
...
...
CMakeLists.txt
View file @
25804185
...
...
@@ -52,6 +52,7 @@ SET(INSTALL_INC include CACHE PATH "Where to install headers to.")
OPTION
(
BUILD_SHARED_LIBS
"Build Shared Library (OFF for Static)"
ON
)
OPTION
(
THREADSAFE
"Build libgit2 as threadsafe"
OFF
)
OPTION
(
BUILD_CLAR
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
TAGS
"Generate tags"
OFF
)
OPTION
(
PROFILE
"Generate profiling information"
OFF
)
...
...
@@ -183,3 +184,18 @@ IF (TAGS)
DEPENDS tags
)
ENDIF ()
IF (BUILD_EXAMPLES)
FILE(GLOB_RECURSE EXAMPLE_SRC examples/network/*.c)
ADD_EXECUTABLE(cgit2
${
EXAMPLE_SRC
}
)
TARGET_LINK_LIBRARIES(cgit2 git2 pthread)
ADD_EXECUTABLE(git-diff examples/diff.c)
TARGET_LINK_LIBRARIES(git-diff git2)
ADD_EXECUTABLE(git-general examples/general.c)
TARGET_LINK_LIBRARIES(git-general git2)
ADD_EXECUTABLE(git-showindex examples/showindex.c)
TARGET_LINK_LIBRARIES(git-showindex git2)
ENDIF ()
examples/general.c
View file @
25804185
...
...
@@ -392,7 +392,7 @@ int main (int argc, char** argv)
// Here we will implement something like `git for-each-ref` simply listing out all available
// references and the object SHA they resolve to.
git_strarray
ref_list
;
git_reference_list
all
(
&
ref_list
,
repo
,
GIT_REF_LISTALL
);
git_reference_list
(
&
ref_list
,
repo
,
GIT_REF_LISTALL
);
const
char
*
refname
;
git_reference
*
ref
;
...
...
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