diff --git a/CMakeLists.txt b/CMakeLists.txt index 30df62d79..82208dc12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,18 +71,19 @@ IF (THREADSAFE) ADD_DEFINITIONS(-DGIT_THREADS) ENDIF() +ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64) + # Collect sourcefiles -FILE(GLOB SRC src/*.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 src/*.c src/win32/*.c) +ELSE() + FILE(GLOB SRC src/*.c src/unix/*.c) ENDIF () -ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64) - # Compile and link libgit2 ADD_LIBRARY(git2 ${SRC} ${SRC_ZLIB}) TARGET_LINK_LIBRARIES(git2 ${CMAKE_THREAD_LIBS_INIT}) diff --git a/src/common.h b/src/common.h index b6d8ae3a4..e1e7f0035 100644 --- a/src/common.h +++ b/src/common.h @@ -23,8 +23,8 @@ # include # include # include -# include "msvc-compat.h" -# include "mingw-compat.h" +# include "win32/msvc-compat.h" +# include "win32/mingw-compat.h" # ifdef GIT_THREADS # include "win32/pthread.h" #endif diff --git a/src/map_posix.c b/src/unix/map.c similarity index 100% rename from src/map_posix.c rename to src/unix/map.c diff --git a/src/mingw-compat.h b/src/win32/mingw-compat.h similarity index 100% rename from src/mingw-compat.h rename to src/win32/mingw-compat.h diff --git a/src/msvc-compat.h b/src/win32/msvc-compat.h similarity index 100% rename from src/msvc-compat.h rename to src/win32/msvc-compat.h