summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt9
-rw-r--r--config.h.in1
-rw-r--r--contrib/cmake/HeaderExists.cmake1
-rw-r--r--src/uscxml/Interpreter.h1
-rw-r--r--src/uscxml/Message.cpp6
-rw-r--r--src/uscxml/plugins/invoker/filesystem/dirmon/FileWatcher/FileWatcherLinux.cpp1
6 files changed, 18 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a5588f..1e92bd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,13 +167,16 @@ include("${CMAKE_MODULE_PATH}/HeaderExists.cmake")
# some compiler flags
#message("CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
+
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
# best practices from scott meyers
# add_definitions(-Weffc++)
- set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC")
+ # order of arguments of gcc matters again
+# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ add_definitions(-fPIC)
# all warnings
add_definitions(-Wall)
@@ -217,6 +220,10 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
# SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRTD.lib")
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-parentheses-equality")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-plus-int")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-literal-null-conversion")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-null-conversion")
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
# set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -read_only_relocs suppress")
# set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -read_only_relocs suppress")
diff --git a/config.h.in b/config.h.in
index f7d4ec7..ca2a6d4 100644
--- a/config.h.in
+++ b/config.h.in
@@ -60,5 +60,6 @@
/** Header files we found */
#cmakedefine HAS_UNISTD_H
+#cmakedefine HAS_STRING_H
#endif \ No newline at end of file
diff --git a/contrib/cmake/HeaderExists.cmake b/contrib/cmake/HeaderExists.cmake
index 09eabbe..dc0004a 100644
--- a/contrib/cmake/HeaderExists.cmake
+++ b/contrib/cmake/HeaderExists.cmake
@@ -1,2 +1,3 @@
include(CheckIncludeFile)
CHECK_INCLUDE_FILE(unistd.h HAS_UNISTD_H)
+CHECK_INCLUDE_FILE(string.h HAS_STRING_H)
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index 54c7a78..334b2ad 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -28,6 +28,7 @@ namespace uscxml {
class InterpreterMonitor {
public:
+ virtual ~InterpreterMonitor() {}
virtual void onStableConfiguration(Interpreter* interpreter) {}
virtual void beforeCompletion(Interpreter* interpreter) {}
virtual void afterCompletion(Interpreter* interpreter) {}
diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp
index 8a3ee1e..a78937f 100644
--- a/src/uscxml/Message.cpp
+++ b/src/uscxml/Message.cpp
@@ -1,9 +1,15 @@
+#include "uscxml/config.h"
+
#include "uscxml/Common.h"
#include "uscxml/Message.h"
//#include "uscxml/Interpreter.h"
#include <DOM/SAX2DOM/SAX2DOM.hpp>
#include <SAX/helpers/CatchErrorHandler.hpp>
+#ifdef HAS_STRING_H
+#include <string.h>
+#endif
+
extern "C" {
#include "jsmn.h" // minimal json parser
}
diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/FileWatcher/FileWatcherLinux.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/FileWatcher/FileWatcherLinux.cpp
index ecbaa32..ea5d259 100644
--- a/src/uscxml/plugins/invoker/filesystem/dirmon/FileWatcher/FileWatcherLinux.cpp
+++ b/src/uscxml/plugins/invoker/filesystem/dirmon/FileWatcher/FileWatcherLinux.cpp
@@ -32,6 +32,7 @@
#include <stdio.h>
#include <errno.h>
#include <sys/inotify.h>
+#include <unistd.h>
#define BUFF_SIZE ((sizeof(struct inotify_event)+FILENAME_MAX)*1024)