mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 18:03:54 +00:00
Merge pull request #452 from carlosmn/cmake-respect-user
Assorted CMake fixes
This commit is contained in:
commit
bff5f4e396
@ -47,13 +47,17 @@ SET(INSTALL_INC include CACHE PATH "Where to install headers to.")
|
|||||||
# Build options
|
# Build options
|
||||||
OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
|
OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
|
||||||
OPTION (THREADSAFE "Build libgit2 as threadsafe" OFF)
|
OPTION (THREADSAFE "Build libgit2 as threadsafe" OFF)
|
||||||
OPTION (STDCALL "Buildl libgit2 with the __stdcall convention (Windows)" ON)
|
|
||||||
OPTION (BUILD_TESTS "Build Tests" ON)
|
OPTION (BUILD_TESTS "Build Tests" ON)
|
||||||
OPTION (BUILD_CLAY "Build Tests using the Clay suite" OFF)
|
OPTION (BUILD_CLAY "Build Tests using the Clay suite" OFF)
|
||||||
|
|
||||||
|
# Not using __stdcall with the CRT causes problems
|
||||||
|
IF (MSVC)
|
||||||
|
OPTION (STDCALL "Buildl libgit2 with the __stdcall convention" ON)
|
||||||
|
ENDIF ()
|
||||||
|
|
||||||
# Platform specific compilation flags
|
# Platform specific compilation flags
|
||||||
IF (MSVC)
|
IF (MSVC)
|
||||||
SET(CMAKE_C_FLAGS "/W4 /nologo /Zi")
|
SET(CMAKE_C_FLAGS "/W4 /nologo /Zi ${CMAKE_C_FLAGS}")
|
||||||
IF (STDCALL)
|
IF (STDCALL)
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gz")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
@ -61,7 +65,7 @@ IF (MSVC)
|
|||||||
SET(CMAKE_C_FLAGS_DEBUG "/Od /DEBUG /MTd")
|
SET(CMAKE_C_FLAGS_DEBUG "/Od /DEBUG /MTd")
|
||||||
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2")
|
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2")
|
||||||
ELSE ()
|
ELSE ()
|
||||||
SET(CMAKE_C_FLAGS "-O2 -g -Wall -Wextra -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes")
|
SET(CMAKE_C_FLAGS "-O2 -g -Wall -Wextra -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes ${CMAKE_C_FLAGS}")
|
||||||
IF (NOT MINGW) # MinGW always does PIC and complains if we tell it to
|
IF (NOT MINGW) # MinGW always does PIC and complains if we tell it to
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
@ -55,6 +55,10 @@ To install the library you can specify the install prefix by setting:
|
|||||||
$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
|
$ cmake .. -DCMAKE_INSTALL_PREFIX=/install/prefix
|
||||||
$ cmake --build . --target install
|
$ cmake --build . --target install
|
||||||
|
|
||||||
|
If you want to build a universal binary for Mac OS X, CMake sets it
|
||||||
|
all up for you if you use `-DCMAKE_OSX_ARCHITECTURES="i386;x86_64"`
|
||||||
|
when configuring.
|
||||||
|
|
||||||
For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
|
For more advanced use or questions about CMake please read <http://www.cmake.org/Wiki/CMake_FAQ>.
|
||||||
|
|
||||||
The following CMake variables are declared:
|
The following CMake variables are declared:
|
||||||
|
Loading…
Reference in New Issue
Block a user