diff --git a/.travis/setenv.sh b/.travis/setenv.sh index 0ce11dc6..0db92113 100755 --- a/.travis/setenv.sh +++ b/.travis/setenv.sh @@ -12,5 +12,5 @@ if [[ "$COMPILER" == "Emscripten" ]]; then -w /mfast/build \ -t thewtex/cross-compiler-browser-asmjs " else - export CONFIG_ARGS="-DCMAKE_CXX_COMPILER=$COMPILER" -fi \ No newline at end of file + export CONFIG_ARGS="-DCMAKE_CXX_COMPILER=$COMPILER -DBUILD_SHARED_LIBS=ON" +fi diff --git a/appveyor.yml b/appveyor.yml index bfee5945..46af86c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -46,8 +46,8 @@ before_build: - cmd: cd C:\projects\mfast - cmd: md build - cmd: cd build - - cmd: if "%platform%"=="Win32" cmake -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%configuration% -DBOOST_ROOT="%BOOST_ROOT%" .. - - cmd: if "%platform%"=="x64" cmake -G "%GENERATOR% Win64" -DCMAKE_BUILD_TYPE=%configuration% -DBOOST_ROOT="%BOOST_ROOT%" .. + - cmd: if "%platform%"=="Win32" cmake -G "%GENERATOR%" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_SHARED_LIB=ON -DBOOST_ROOT="%BOOST_ROOT%" .. + - cmd: if "%platform%"=="x64" cmake -G "%GENERATOR% Win64" -DCMAKE_BUILD_TYPE=%configuration% -DBUILD_SHARED_LIB=ON -DBOOST_ROOT="%BOOST_ROOT%" .. build: project: C:\projects\mfast\build\mfast.sln diff --git a/src/mfast/coder/CMakeLists.txt b/src/mfast/coder/CMakeLists.txt index d3ae67c0..7211a3f7 100644 --- a/src/mfast/coder/CMakeLists.txt +++ b/src/mfast/coder/CMakeLists.txt @@ -1,7 +1,16 @@ file (GLOB_RECURSE headers "*.h") ## retrieve all header files in current directory -file (GLOB_RECURSE sources "*.cpp") ## retrieve all source files in current directory +set(sources common/dictionary_builder.cpp + decoder/decoder_field_operator.cpp + decoder/decoder_presence_map.cpp + decoder/fast_decoder.cpp + decoder/fast_istream.cpp + encoder/encoder_field_operator.cpp + encoder/fast_encoder.cpp + encoder/fast_ostreambuf.cpp + encoder_v2/fast_encoder_core.cpp +) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) @@ -26,7 +35,7 @@ set(MFAST_STATIC_COMPONENTS ${MFAST_STATIC_COMPONENTS} coder_static CACHE INTERN if (BUILD_SHARED_LIBS) - add_library(mfast_coder SHARED ${mfast_coder_SRCS}) + add_library(mfast_coder SHARED ${mfast_coder_SRCS} decoder_v2/fast_decoder_core.cpp) if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.12") target_compile_definitions(mfast_coder INTERFACE "-DMFAST_DYN_LINK") diff --git a/src/mfast/coder/decoder_v2/fast_decoder_core.cpp b/src/mfast/coder/decoder_v2/fast_decoder_core.cpp new file mode 100644 index 00000000..b6644941 --- /dev/null +++ b/src/mfast/coder/decoder_v2/fast_decoder_core.cpp @@ -0,0 +1,2 @@ +// required for MSVC when building DLL +#include "fast_decoder_core.h" \ No newline at end of file diff --git a/src/mfast/coder/mfast_coder_export.h b/src/mfast/coder/mfast_coder_export.h index cd355724..590ce045 100644 --- a/src/mfast/coder/mfast_coder_export.h +++ b/src/mfast/coder/mfast_coder_export.h @@ -14,6 +14,6 @@ #else /* We are either using or building static libs */ #define MFAST_CODER_EXPORT -#define MAST_CODER_NO_SHARED_LIBS +#define MFAST_CODER_NO_SHARED_LIBS #endif #endif diff --git a/src/mfast/decimal_ref.h b/src/mfast/decimal_ref.h index 2eb2766e..68d3971a 100644 --- a/src/mfast/decimal_ref.h +++ b/src/mfast/decimal_ref.h @@ -25,7 +25,7 @@ #if defined __GNUC__ #pragma GCC diagnostic pop #endif -#if defined(MAST_NO_SHARED_LIBS) && !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE) +#if defined(MFAST_NO_SHARED_LIBS) && !defined(BOOST_NO_CXX11_EXTERN_TEMPLATE) namespace boost { namespace multiprecision { namespace backends { diff --git a/src/mfast/json/mfast_json_export.h b/src/mfast/json/mfast_json_export.h index 78123abf..467cf94a 100644 --- a/src/mfast/json/mfast_json_export.h +++ b/src/mfast/json/mfast_json_export.h @@ -19,6 +19,6 @@ #else /* We are either using or building static libs */ #define MFAST_JSON_EXPORT -#define MAST_JSON_NO_SHARED_LIBS +#define MFAST_JSON_NO_SHARED_LIBS #endif #endif diff --git a/src/mfast/mfast_export.h b/src/mfast/mfast_export.h index 90c1c293..c62b43bf 100644 --- a/src/mfast/mfast_export.h +++ b/src/mfast/mfast_export.h @@ -22,7 +22,7 @@ /* We are either using or building static libs */ #define MFAST_EXPORT -#define MAST_NO_SHARED_LIBS +#define MFAST_NO_SHARED_LIBS #endif #endif diff --git a/src/mfast/sqlite3/mfast_sqlite3_export.h b/src/mfast/sqlite3/mfast_sqlite3_export.h index e25d7783..43c3eb01 100644 --- a/src/mfast/sqlite3/mfast_sqlite3_export.h +++ b/src/mfast/sqlite3/mfast_sqlite3_export.h @@ -14,7 +14,7 @@ #else /* We are either using or building static libs */ #define MFAST_SQLITE3_EXPORT -#define MAST_SQLITE3_NO_SHARED_LIBS +#define MFAST_SQLITE3_NO_SHARED_LIBS #endif #endif diff --git a/src/mfast/xml_parser/mfast_xml_parser_export.h b/src/mfast/xml_parser/mfast_xml_parser_export.h index 0a3401db..4d39fa4f 100644 --- a/src/mfast/xml_parser/mfast_xml_parser_export.h +++ b/src/mfast/xml_parser/mfast_xml_parser_export.h @@ -14,6 +14,6 @@ #else /* We are either using or building static libs */ #define MFAST_XML_PARSER_EXPORT -#define MAST_XML_PARSER_NO_SHARED_LIBS +#define MFAST_XML_PARSER_NO_SHARED_LIBS #endif #endif