-
-
Notifications
You must be signed in to change notification settings - Fork 220
Allow building without serialization / json support #233
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -563,6 +563,7 @@ set(TINYSPLINE_INSTALL_PKGCONFIG_DIR | |
| ) | ||
|
|
||
| option(TINYSPLINE_FLOAT_PRECISION "Build TinySpline with float precision." OFF) | ||
| option(TINYSPLINE_SERIALIZATION "Build TinySpline with serialization support." ON) | ||
|
|
||
| option(TINYSPLINE_WARNINGS_AS_ERRORS "Treat warnings as errors" ON) | ||
|
|
||
|
|
@@ -626,6 +627,11 @@ if(DEFINED ENV{TINYSPLINE_FLOAT_PRECISION}) | |
| set(TINYSPLINE_FLOAT_PRECISION $ENV{TINYSPLINE_FLOAT_PRECISION}) | ||
| endif() | ||
|
|
||
| if(DEFINED ENV{TINYSPLINE_SERIALIZATION}) | ||
| message(STATUS "Using environment variable 'TINYSPLINE_SERIALIZATION'") | ||
| set(TINYSPLINE_SERIALIZATION $ENV{TINYSPLINE_SERIALIZATION}) | ||
| endif() | ||
|
|
||
| if(DEFINED ENV{TINYSPLINE_PYTHON_VERSION}) | ||
| message(STATUS "Using environment variable 'TINYSPLINE_PYTHON_VERSION'") | ||
| set(TINYSPLINE_PYTHON_VERSION $ENV{TINYSPLINE_PYTHON_VERSION}) | ||
|
|
@@ -702,6 +708,11 @@ if(TINYSPLINE_FLOAT_PRECISION) | |
| list(APPEND TINYSPLINE_CXX_DEFINITIONS "TINYSPLINE_FLOAT_PRECISION") | ||
| list(APPEND TINYSPLINE_BINDING_CXX_DEFINITIONS "TINYSPLINE_FLOAT_PRECISION") | ||
| endif() | ||
| if(NOT TINYSPLINE_SERIALIZATION) | ||
| list(APPEND TINYSPLINE_C_DEFINITIONS "TINYSPLINE_NO_SERIALIZATION") | ||
| list(APPEND TINYSPLINE_CXX_DEFINITIONS "TINYSPLINE_NO_SERIALIZATION") | ||
| list(APPEND TINYSPLINE_BINDING_CXX_DEFINITIONS "TINYSPLINE_NO_SERIALIZATION") | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will probably never build one or more bindings without serialization support. |
||
| endif() | ||
| list(APPEND TINYSPLINE_BINDING_CXX_DEFINITIONS "SWIG") | ||
| if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
| # TINYSPLINE_C_LINK_LIBRARIES TINYSPLINE_CXX_LINK_LIBRARIES | ||
|
|
@@ -903,8 +914,12 @@ set(TINYSPLINE_CXX_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") | |
| # TINYSPLINE_C_SOURCE_FILES | ||
| list(APPEND TINYSPLINE_C_SOURCE_FILES | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/tinyspline.c" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/parson.c" | ||
| ) | ||
| if(TINYSPLINE_SERIALIZATION) | ||
| list(APPEND TINYSPLINE_C_SOURCE_FILES | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/parson.c" | ||
| ) | ||
| endif() | ||
|
|
||
| # TINYSPLINE_CXX_SOURCE_FILES | ||
| list(APPEND TINYSPLINE_CXX_SOURCE_FILES ${TINYSPLINE_C_SOURCE_FILES} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,9 @@ | ||
| #define TINYSPLINE_EXPORT | ||
| #include "tinyspline.h" | ||
|
|
||
| #if !defined(TINYSPLINE_NO_SERIALIZATION) | ||
| #include "parson.h" /* serialization */ | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #endif | ||
|
|
||
| #include <stdlib.h> /* malloc, free */ | ||
| #include <math.h> /* fabs, sqrt, acos */ | ||
|
|
@@ -2818,7 +2821,7 @@ ts_bspline_morph(const tsBSpline *origin, | |
| /*! @} */ | ||
|
|
||
|
|
||
|
|
||
| #if !defined(TINYSPLINE_NO_SERIALIZATION) | ||
| /*! @name Serialization and Persistence | ||
| * | ||
| * @{ | ||
|
|
@@ -3138,7 +3141,7 @@ ts_bspline_load(const char *path, | |
| TS_END_TRY_RETURN(err) | ||
| } | ||
| /*! @} */ | ||
|
|
||
| #endif | ||
|
|
||
|
|
||
| /*! @name Vector Math | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.