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
629515a8
Unverified
Commit
629515a8
authored
Jun 01, 2020
by
Patrick Steinhardt
Committed by
GitHub
Jun 01, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5481 from pks-t/pks/cmake-cleanups
CMake cleanups
parents
17641f1f
511fb9e6
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
20 additions
and
58 deletions
+20
-58
CMakeLists.txt
+20
-58
cmake/AddCFlagIfSupported.cmake
+0
-0
cmake/CheckPrototypeDefinition.c.in
+0
-0
cmake/CheckPrototypeDefinition.cmake
+0
-0
cmake/EnableWarnings.cmake
+0
-0
cmake/FindCoreFoundation.cmake
+0
-0
cmake/FindGSSAPI.cmake
+0
-0
cmake/FindGSSFramework.cmake
+0
-0
cmake/FindHTTP_Parser.cmake
+0
-0
cmake/FindIconv.cmake
+0
-0
cmake/FindPCRE.cmake
+0
-0
cmake/FindPCRE2.cmake
+0
-0
cmake/FindPkgLibraries.cmake
+0
-0
cmake/FindSecurity.cmake
+0
-0
cmake/FindStatNsec.cmake
+0
-0
cmake/FindmbedTLS.cmake
+0
-0
cmake/IdeSplitSources.cmake
+0
-0
cmake/PkgBuildConfig.cmake
+0
-0
cmake/SanitizeBool.cmake
+0
-0
cmake/SelectGSSAPI.cmake
+0
-0
cmake/SelectHTTPSBackend.cmake
+0
-0
cmake/SelectHashes.cmake
+0
-0
No files found.
CMakeLists.txt
View file @
629515a8
...
...
@@ -11,21 +11,12 @@
# Install:
# > cmake --build . --target install
PROJECT
(
libgit2 C
)
CMAKE_MINIMUM_REQUIRED
(
VERSION 3.5.1
)
CMAKE_POLICY
(
SET CMP0015 NEW
)
IF
(
POLICY CMP0051
)
CMAKE_POLICY
(
SET CMP0051 NEW
)
ENDIF
()
IF
(
POLICY CMP0042
)
CMAKE_POLICY
(
SET CMP0042 NEW
)
ENDIF
()
IF
(
POLICY CMP0054
)
CMAKE_POLICY
(
SET CMP0054 NEW
)
ENDIF
()
project
(
libgit2 C
)
# Add find modules to the path
SET
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
libgit2_SOURCE_DIR
}
/cmake/Modules
/"
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
libgit2_SOURCE_DIR
}
/cmake
/"
)
INCLUDE
(
CheckLibraryExists
)
INCLUDE
(
CheckFunctionExists
)
...
...
@@ -49,8 +40,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
OPTION
(
BUILD_CLAR
"Build Tests using the Clar suite"
ON
)
OPTION
(
BUILD_EXAMPLES
"Build library usage example apps"
OFF
)
OPTION
(
BUILD_FUZZERS
"Build the fuzz targets"
OFF
)
OPTION
(
TAGS
"Generate tags"
OFF
)
OPTION
(
PROFILE
"Generate profiling information"
OFF
)
OPTION
(
ENABLE_TRACE
"Enables tracing support"
ON
)
OPTION
(
LIBGIT2_FILENAME
"Name of the produced binary"
OFF
)
OPTION
(
USE_SSH
"Link with libssh2 to enable SSH support"
ON
)
...
...
@@ -242,35 +231,27 @@ ELSE ()
ADD_DEFINITIONS
(
-D__USE_MINGW_ANSI_STDIO=1
)
ENDIF
()
ENABLE_WARNINGS
(
documentation
)
DISABLE_WARNINGS
(
missing-field-initializers
)
ENABLE_WARNINGS
(
strict-aliasing
)
ENABLE_WARNINGS
(
strict-prototypes
)
ENABLE_WARNINGS
(
declaration-after-statement
)
ENABLE_WARNINGS
(
shift-count-overflow
)
ENABLE_WARNINGS
(
unused-const-variable
)
ENABLE_WARNINGS
(
unused-function
)
ENABLE_WARNINGS
(
int-conversion
)
enable_warnings
(
documentation
)
disable_warnings
(
documentation-deprecated-sync
)
disable_warnings
(
missing-field-initializers
)
enable_warnings
(
strict-aliasing
)
enable_warnings
(
strict-prototypes
)
enable_warnings
(
declaration-after-statement
)
enable_warnings
(
shift-count-overflow
)
enable_warnings
(
unused-const-variable
)
enable_warnings
(
unused-function
)
enable_warnings
(
int-conversion
)
# MinGW uses gcc, which expects POSIX formatting for printf, but
# uses the Windows C library, which uses its own format specifiers.
# Disable format specifier warnings.
IF
(
MINGW
)
DISABLE_WARNINGS
(
format
)
DISABLE_WARNINGS
(
format-security
)
ELSE
()
ENABLE_WARNINGS
(
format
)
ENABLE_WARNINGS
(
format-security
)
ENDIF
()
IF
(
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"Clang"
)
DISABLE_WARNINGS
(
documentation-deprecated-sync
)
ENDIF
()
IF
(
PROFILE
)
SET
(
CMAKE_C_FLAGS
"-pg
${
CMAKE_C_FLAGS
}
"
)
SET
(
CMAKE_EXE_LINKER_FLAGS
"-pg
${
CMAKE_EXE_LINKER_FLAGS
}
"
)
ENDIF
()
if
(
MINGW
)
disable_warnings
(
format
)
disable_warnings
(
format-security
)
else
()
enable_warnings
(
format
)
enable_warnings
(
format-security
)
endif
()
ENDIF
()
# Ensure that MinGW provides the correct header files.
...
...
@@ -310,25 +291,6 @@ IF (BUILD_CLAR)
ADD_SUBDIRECTORY
(
tests
)
ENDIF
()
IF
(
TAGS
)
FIND_PROGRAM
(
CTAGS ctags
)
IF
(
NOT CTAGS
)
MESSAGE
(
FATAL_ERROR
"Could not find ctags command"
)
ENDIF
()
FILE
(
GLOB_RECURSE SRC_ALL *.[ch]
)
ADD_CUSTOM_COMMAND
(
OUTPUT tags
COMMAND
${
CTAGS
}
-a
${
SRC_ALL
}
DEPENDS
${
SRC_ALL
}
)
ADD_CUSTOM_TARGET
(
do_tags ALL
DEPENDS tags
)
ENDIF
()
IF
(
BUILD_EXAMPLES
)
ADD_SUBDIRECTORY
(
examples
)
ENDIF
()
...
...
cmake/
Modules/
AddCFlagIfSupported.cmake
→
cmake/AddCFlagIfSupported.cmake
View file @
629515a8
File moved
cmake/
Modules/
CheckPrototypeDefinition.c.in
→
cmake/CheckPrototypeDefinition.c.in
View file @
629515a8
File moved
cmake/
Modules/
CheckPrototypeDefinition.cmake
→
cmake/CheckPrototypeDefinition.cmake
View file @
629515a8
File moved
cmake/
Modules/
EnableWarnings.cmake
→
cmake/EnableWarnings.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindCoreFoundation.cmake
→
cmake/FindCoreFoundation.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindGSSAPI.cmake
→
cmake/FindGSSAPI.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindGSSFramework.cmake
→
cmake/FindGSSFramework.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindHTTP_Parser.cmake
→
cmake/FindHTTP_Parser.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindIconv.cmake
→
cmake/FindIconv.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindPCRE.cmake
→
cmake/FindPCRE.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindPCRE2.cmake
→
cmake/FindPCRE2.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindPkgLibraries.cmake
→
cmake/FindPkgLibraries.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindSecurity.cmake
→
cmake/FindSecurity.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindStatNsec.cmake
→
cmake/FindStatNsec.cmake
View file @
629515a8
File moved
cmake/
Modules/
FindmbedTLS.cmake
→
cmake/FindmbedTLS.cmake
View file @
629515a8
File moved
cmake/
Modules/
IdeSplitSources.cmake
→
cmake/IdeSplitSources.cmake
View file @
629515a8
File moved
cmake/
Modules/
PkgBuildConfig.cmake
→
cmake/PkgBuildConfig.cmake
View file @
629515a8
File moved
cmake/
Modules/
SanitizeBool.cmake
→
cmake/SanitizeBool.cmake
View file @
629515a8
File moved
cmake/
Modules/
SelectGSSAPI.cmake
→
cmake/SelectGSSAPI.cmake
View file @
629515a8
File moved
cmake/
Modules/
SelectHTTPSBackend.cmake
→
cmake/SelectHTTPSBackend.cmake
View file @
629515a8
File moved
cmake/
Modules/
SelectHashes.cmake
→
cmake/SelectHashes.cmake
View file @
629515a8
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