diff --git a/Makefile b/Makefile index 28b37bbb..012353b2 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,6 @@ webserver: ${TRICK_LIB_DIR}/libmongoose.a ${TRICK_HOME}/include/mongoose/mongoos $(MAKE) -C ${TRICK_HOME}/trick_source/web/HttpServer #------------------------------------------------------------------------------- -TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/mongoose mongoose.h: curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h diff --git a/include/trick/WebServer.hh b/include/trick/WebServer.hh index b9547488..14688231 100644 --- a/include/trick/WebServer.hh +++ b/include/trick/WebServer.hh @@ -4,7 +4,7 @@ PURPOSE: (Represent the state and initial conditions of an http server.) #ifndef WEB_SERVER_H #define WEB_SERVER_H -#if !defined(SWIG) || defined(USE_MONGOOSE) +#ifdef USE_MONGOOSE #include #include diff --git a/include/trick/WebSocketSession.hh b/include/trick/WebSocketSession.hh index 3df297ce..389e33f5 100644 --- a/include/trick/WebSocketSession.hh +++ b/include/trick/WebSocketSession.hh @@ -4,7 +4,7 @@ PURPOSE: (Represent Websocket connection.) #ifndef WEB_SOCKET_SESSION_HH #define WEB_SOCKET_SESSION_HH -#if !defined(SWIG) || defined(USE_MONGOOSE) +#ifdef USE_MONGOOSE #include #ifndef SWIG #include "mongoose/mongoose.h" diff --git a/include/trick/files_to_ICG.hh b/include/trick/files_to_ICG.hh index 0218f192..bd921f14 100644 --- a/include/trick/files_to_ICG.hh +++ b/include/trick/files_to_ICG.hh @@ -36,8 +36,7 @@ #include "trick/RealtimeSync.hh" #include "trick/ITimer.hh" #include "trick/VariableServer.hh" -#include "trick/WebServer.hh" -#include "trick/WebSocketSession.hh" + #include "trick/regula_falsi.h" #include "trick/Integrator.hh" #include "trick/IntegAlgorithms.hh" @@ -100,4 +99,9 @@ #include "trick/lqueue.h" #include "trick/lstack.h" +#ifdef USE_MONGOOSE +#include "trick/WebServer.hh" +#include "trick/WebSocketSession.hh" +#endif + #endif diff --git a/share/trick/makefiles/Makefile.common b/share/trick/makefiles/Makefile.common index bc2b790b..04f09987 100644 --- a/share/trick/makefiles/Makefile.common +++ b/share/trick/makefiles/Makefile.common @@ -174,6 +174,8 @@ endif ifeq (${TRICK_MONGOOSE},1) TRICK_LIBS += -ltrickHTTP ${TRICK_LIB_DIR}/libmongoose.a TRICK_SWIG_FLAGS += -DUSE_MONGOOSE + TRICK_SYSTEM_CXXFLAGS += -DUSE_MONGOOSE + TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/mongoose endif # We pipe the output of compiler through tee. If the user wanted gcc color, make sure they get it.