mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Updating for Windows Large File Support.
This commit is contained in:
parent
a35d3c04d8
commit
78d19f69fd
@ -638,9 +638,13 @@ ENDIF()
|
||||
|
||||
# Linux specific large file support flags.
|
||||
# Modelled after check in CMakeLists.txt for hdf5.
|
||||
IF (NOT WINDOWS)
|
||||
OPTION(ENABLE_LFS "Enable large (64-bit) files on linux." ON)
|
||||
IF(ENABLE_LFS)
|
||||
OPTION(ENABLE_LARGE_FILE_SUPPORT "Enable large file support." ON)
|
||||
IF(ENABLE_LARGE_FILE_SUPPORT)
|
||||
IF(MSVC)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /LARGEADDRESSAWARE")
|
||||
ELSE()
|
||||
SET(_FILE_OFFSET_BITS 64)
|
||||
SET(_LARGEFILE64_SOURCE TRUE)
|
||||
SET(_LARGEFILE_SOURCE TRUE)
|
||||
|
@ -69,6 +69,10 @@ ENDIF()
|
||||
# Copy some test files from current source dir to out-of-tree build dir.
|
||||
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
|
||||
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
|
||||
IF(MSVC)
|
||||
FILE(COPY ${COPY_FILES} DESTINATION ${RUNTIME_OUTPUT_DIRECTORY}/)
|
||||
ENDIF()
|
||||
|
||||
|
||||
## Specify files to be distributed by 'make dist'
|
||||
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
|
||||
|
@ -49,9 +49,10 @@ test_big_var(const char *testfile)
|
||||
size_t start[NUMDIMS] = {0, 0, 0};
|
||||
size_t count[NUMDIMS] = {1, DIM1, DIM2};
|
||||
signed char data[DIM1][DIM2];
|
||||
|
||||
int i, j;
|
||||
int nerrs = 0;
|
||||
|
||||
|
||||
/* Create a file with one big variable. */
|
||||
if (nc_create(testfile, NC_CLOBBER, &ncid)) ERR;
|
||||
if (nc_set_fill(ncid, NC_NOFILL, NULL)) ERR;
|
||||
@ -110,6 +111,7 @@ test_big_var(const char *testfile)
|
||||
return nerrs;
|
||||
}
|
||||
}
|
||||
|
||||
if (nc_close(ncid)) ERR;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user