Skip to content

Commit 6c6b662

Browse files
FreddieAkeroydFreddie Akeroyd
authored and
Freddie Akeroyd
committed
Windows build fixes. Refs nexusformat#281
git-svn-id: https://svn.nexusformat.org/code/trunk@1749 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
1 parent 4a43ee6 commit 6c6b662

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@ set(NX_CPP -D_CRT_SECURE_NO_WARNINGS)
249249
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NX_CFLAGS}")
250250
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NX_CFLAGS}")
251251

252+
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
253+
set(ARCH64 1)
254+
else()
255+
set(ARCH64 0)
256+
endif()
257+
252258
# Recurse into the subdirectories.
253259
add_subdirectory (src)
254260
add_subdirectory (bindings)

Windows_extra/libNeXus-0-Win32.def

+12-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ NXMDisableErrorReporting
5050
NXMEnableErrorReporting
5151
NXMGetError
5252
NXMSetError
53+
NXMSetTError
5354
createNXDataset
5455
createTextNXDataset
5556
dropNXDataset
@@ -65,6 +66,7 @@ nxiclose_
6566
nxiclosedata_
6667
nxiclosegroup_
6768
nxicompmakedata_
69+
nxicompmakedata64_
6870
nxicompress_
6971
nxifclose_
7072
nxifcompmakedata_
@@ -82,20 +84,25 @@ nxigetdataid_
8284
nxigetgroupid_
8385
nxigetgroupinfo_
8486
nxigetrawinfo_
87+
nxigetrawinfo64_
8588
nxigetinfo_
89+
nxigetinfo64_
8690
nxigetnextattr_
8791
nxigetnextentry_
8892
nxigetslab_
93+
nxigetslab64_
8994
nxiinitattrdir_
9095
nxiinitgroupdir_
9196
nxiinquirefile_
9297
nxiisexternalgroup_
9398
nxilinkexternal_
9499
nximakedata_
100+
nximakedata64_
95101
nximakegroup_
96102
nximakelink_
97103
nximakenamedlink_
98104
nximalloc_
105+
nximalloc64_
99106
nxiopen_
100107
nxiopendata_
101108
nxiopengroup_
@@ -105,9 +112,13 @@ nxiopensourcegroup_
105112
nxiputattr_
106113
nxiputdata_
107114
nxiputslab_
115+
nxiputslab64_
108116
nxisameid_
109117
nxisetcache_
110118
nxisetnumberformat_
111119
putNXDatasetValue
112120
putNXDatasetValueAt
113-
nxigetpath_
121+
nxigetpath_
122+
nxilinkexternaldataset_
123+
nxiisexternaldataset_
124+
nxireopen_

src/CMakeLists.txt

+13-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ endif (HDF5_FOUND)
4040

4141
# need napi_exports2.c on win32 but not win64
4242
if (WIN32)
43-
set(NAPISRC ${NAPISRC} napi_exports.c napi_exports.h)
43+
if (CMAKE_CL_64)
44+
set(NAPISRC ${NAPISRC} napi_exports2.c napi_exports.h)
45+
else()
46+
set(NAPISRC ${NAPISRC} napi_exports.c napi_exports2.c napi_exports.h)
47+
endif()
4448
endif (WIN32)
4549

50+
4651
set (NAPISRC ${NAPISRC} nxxml.c nxio.c nxio.h)
4752

4853
set_property(SOURCE ${NAPISRC} APPEND PROPERTY COMPILE_FLAGS ${NX_CFLAGS})
@@ -81,11 +86,17 @@ add_library (NeXus_Shared_Library SHARED ${NAPISRC})
8186

8287
set_property(TARGET NeXus_Shared_Library APPEND PROPERTY COMPILE_DEFINITIONS _HDF5USEDLL_)
8388

89+
if (CMAKE_CL_64)
90+
set(DEF_FILE ${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-x64.def)
91+
else()
92+
set(DEF_FILE ${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-Win32.def)
93+
endif()
94+
8495
#Note - library version needs to be got from somewhere?
8596
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
8697
set_target_properties(NeXus_Shared_Library PROPERTIES OUTPUT_NAME libNeXus-0
8798
VERSION 1.0 SOVERSION 4 )
88-
set_property(TARGET NeXus_Shared_Library APPEND PROPERTY LINK_FLAGS /def:${PROJECT_SOURCE_DIR}/Windows_extra/libNeXus-0-x64.def)
99+
set_property(TARGET NeXus_Shared_Library APPEND PROPERTY LINK_FLAGS /def:${DEF_FILE})
89100
else(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
90101
set_target_properties(NeXus_Shared_Library PROPERTIES OUTPUT_NAME NeXus
91102
VERSION 1.0 SOVERSION 4)

0 commit comments

Comments
 (0)