diff options
author | Ben Straub <bstraub@github.com> | 2012-06-13 14:22:33 -0700 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-06-13 14:28:47 -0700 |
commit | 73aaf67439a04ca4888dfa1948f8425b2f79307d (patch) | |
tree | 9c7b1cf588bd69a550b1bc166794afd74f3e19a1 | |
parent | 53774eb8185e08da46cd322dc8fefaff7676fea4 (diff) | |
download | libgit2-73aaf67439a04ca4888dfa1948f8425b2f79307d.tar.gz |
Precompile headers for MSVC.
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/win32/precompiled.c | 1 | ||||
-rw-r--r-- | src/win32/precompiled.h | 19 |
3 files changed, 32 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b09729364..6db18269b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,12 @@ SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING}) SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY) +IF (MSVC) + # Precompiled headers + SET_TARGET_PROPERTIES(git2 PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h") + SET_SOURCE_FILES_PROPERTIES(src/win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h") +ENDIF () + # Install INSTALL(TARGETS git2 RUNTIME DESTINATION ${INSTALL_BIN} @@ -165,6 +171,12 @@ IF (BUILD_CLAR) ) ADD_EXECUTABLE(libgit2_clar ${SRC} ${CLAR_PATH}/clar_main.c ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX}) TARGET_LINK_LIBRARIES(libgit2_clar ${CMAKE_THREAD_LIBS_INIT} ${SSL_LIBRARIES}) + + IF (MSVC) + # Precompiled headers + SET_TARGET_PROPERTIES(libgit2_clar PROPERTIES COMPILE_FLAGS "/Yuprecompiled.h /FIprecompiled.h") + ENDIF () + IF (WIN32) TARGET_LINK_LIBRARIES(libgit2_clar ws2_32) ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") diff --git a/src/win32/precompiled.c b/src/win32/precompiled.c new file mode 100644 index 000000000..c08ca1f13 --- /dev/null +++ b/src/win32/precompiled.c @@ -0,0 +1 @@ +#include "precompiled.h"
\ No newline at end of file diff --git a/src/win32/precompiled.h b/src/win32/precompiled.h new file mode 100644 index 000000000..5de7e6f34 --- /dev/null +++ b/src/win32/precompiled.h @@ -0,0 +1,19 @@ +#include "git2.h" + +#include <assert.h> +#include <errno.h> +#include <limits.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> + +#include <sys/types.h> +#include <sys/stat.h> + +#include <regex.h> + +#include <io.h> +#include <direct.h> +#ifdef GIT_THREADS + #include "win32/pthread.h" +#endif |