Skip to content

Commit

Permalink
Merge pull request #839 from mmuetzel/mongoose
Browse files Browse the repository at this point in the history
Mongoose: Define `MONGOOSE_BUILDING` when building objects for `.mex`
  • Loading branch information
DrTimothyAldenDavis authored Jun 13, 2024
2 parents dedc25f + 2e86ea5 commit 2cc9665
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Mongoose/Include/Mongoose_Logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,10 @@ typedef enum TimingType
class Logger
{
private:
#ifdef MATLAB_MEX_FILE
// Compiling the Mongoose mexFunction inside MATLAB on Windows with the
// MSVC cl compiler (via the MATLAB mex command) causes an error, stating
// that private class members cannot be tagged with __declspec(...).
static int debugLevel;
static bool timingOn;
static double clocks[6];
static float times[6];
#else
// However, compiling the mongoose executable with the Windows cl compiler
// causes the mongoose.cpp executable to fail to link without the nasty
// __declspec(...) added below.
MONGOOSE_API static int debugLevel;
MONGOOSE_API static bool timingOn;
MONGOOSE_API static double clocks[6];
MONGOOSE_API static float times[6];
#endif

public:
static inline void tic(TimingType timingType);
Expand Down
3 changes: 3 additions & 0 deletions Mongoose/MATLAB/mongoose_make.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ function mongoose_make (run_test)
% Append optimization
flags = [flags ' -O -silent COPTIMFLAGS="-O3 -fwrapv"'];

% Append while building objects for shared library
flags = [flags ' -DMONGOOSE_BUILDING'];

cpp_flags = '' ;
lib = '';
if (isunix)
Expand Down

0 comments on commit 2cc9665

Please sign in to comment.