Skip to content

Commit

Permalink
Merge pull request #63 from USEPA/triplet_build
Browse files Browse the repository at this point in the history
Refactoring build and testing process
  • Loading branch information
cbuahin authored Nov 15, 2023
2 parents 9f1da79 + 35040bb commit 0086aec
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
22 changes: 10 additions & 12 deletions SRC_engines/include/epanet2.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,18 @@ function in epanet2_2.h.
#define EN_API_FLOAT_TYPE float
#endif

#ifndef DLLEXPORT
#ifdef _WIN32
#ifdef epanet2_EXPORTS
#define DLLEXPORT __declspec(dllexport) __stdcall
#else
#define DLLEXPORT __declspec(dllimport) __stdcall
#endif
#elif defined(__CYGWIN__)
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT
#endif

// --- define WINDOWS

#undef WINDOWS
#ifdef _WIN32
#define WINDOWS
#endif
#ifdef __WIN32__
#define WINDOWS
#endif

#include "epanet2_export.h"
#include "epanet2_enums.h"

// --- Declare the EPANET toolkit functions
Expand Down
18 changes: 1 addition & 17 deletions SRC_engines/include/epanet2_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,8 @@
#ifndef EPANET2_2_H
#define EPANET2_2_H

#ifdef epanet_py_EXPORTS
#define DLLEXPORT
#else
#ifndef DLLEXPORT
#ifdef _WIN32
#ifdef epanet2_EXPORTS
#define DLLEXPORT __declspec(dllexport) __stdcall
#else
#define DLLEXPORT __declspec(dllimport) __stdcall
#endif
#elif defined(__CYGWIN__)
#define DLLEXPORT __stdcall
#else
#define DLLEXPORT
#endif
#endif
#endif

#include "epanet2_export.h"
#include "epanet2_enums.h"

// --- Declare the EPANET toolkit functions
Expand Down
13 changes: 13 additions & 0 deletions SRC_engines/src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ target_include_directories(epanet2
$<INSTALL_INTERFACE:${INCLUDE_DIST}>
)

include(GenerateExportHeader)
generate_export_header(epanet2
BASE_NAME epanet2
EXPORT_MACRO_NAME DLLEXPORT
EXPORT_FILE_NAME epanet2_export.h
STATIC_DEFINE SHARED_EXPORTS_BUILT_AS_STATIC
)

file(COPY ${CMAKE_CURRENT_BINARY_DIR}/epanet2_export.h
DESTINATION ${PROJECT_SOURCE_DIR}/include
)


if(APPLE)
set(LIB_ROOT "@loader_path")
else()
Expand Down
4 changes: 2 additions & 2 deletions SRC_engines/src/solver/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#define VERSION_MAJOR 2
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define GIT_HASH "5480e100e626b479a866da4bdd867f69400b4e31"
#define GIT_HASH "c2224b3c1a85ec9f35cca1f6ddfec3d4bdf6465c"

#define PLATFORM "Windows"
#define COMPILER "MSVC"
#define COMPILER_VERSION "19.37.32825.0"
#define BUILD_ID "2023-11-13T22:04:14Z"
#define BUILD_ID "2023-11-15T13:41:19Z"


static inline int get_version_legacy() { \
Expand Down

0 comments on commit 0086aec

Please sign in to comment.