Fixes win_build and VS/cmake build problems

This commit is contained in:
Lew Rossman
2019-02-11 14:30:15 -05:00
parent d6d244d4d2
commit 3eb9a68783
6 changed files with 5 additions and 14 deletions

View File

@@ -116,6 +116,7 @@ ELSE (BUILD_PY_LIB)
add_library(epanet2 SHARED ${EPANET_LIB_ALL})
else(NOT WIN32)
add_library(epanet2 SHARED ${EPANET_LIB_ALL} ${PROJECT_SOURCE_DIR}/include/epanet2.def)
set_source_files_properties(${PROJECT_SOURCE_DIR}/include/epanet2.def PROPERTIES_HEADER_FILE_ONLY TRUE)
endif(NOT WIN32)
target_include_directories(epanet2 PUBLIC ${PROJECT_SOURCE_DIR}/include)

View File

@@ -43,7 +43,7 @@ function in epanet2_2.h.
#else
#define DLLEXPORT __declspec(dllimport) __stdcall
#endif
#elif defined(CYGWIN)
#elif defined(__CYGWIN__)
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT

View File

@@ -28,7 +28,7 @@
#else
#define DLLEXPORT __declspec(dllimport) __stdcall
#endif
#elif defined(CYGWIN)
#elif defined(__CYGWIN__)
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT

View File

@@ -26,7 +26,7 @@
#include "text.h"
#include "enumstxt.h"
#ifdef WINDOWS
#ifdef _WIN32
#define snprintf _snprintf
#endif

View File

@@ -19,16 +19,8 @@
#include <stdlib.h>
#endif
//*** Need to define WINDOWS to use the getTmpName function ***//
// --- define WINDOWS
#undef WINDOWS
//*** For the Windows SDK _tempnam function ***//
#ifdef _WIN32
#define WINDOWS
#endif
#ifdef __WIN32__
#define WINDOWS
#endif
#ifdef WINDOWS
#include <windows.h>
#endif

View File

@@ -19,9 +19,7 @@
#include <stdlib.h>
#endif
#undef WINDOWS
#ifdef _WIN32
#define WINDOWS
#define snprintf _snprintf
#endif