Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongoose: Define MONGOOSE_BUILDING when building objects for .mex #839

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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