diff options
-rw-r--r-- | CMakeLists.txt | 12 | ||||
-rw-r--r-- | include/rapidjson/document.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index dc2072a9..bdfdd677 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,8 +241,10 @@ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAM DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) # Install files -INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION "${CMAKE_INSTALL_DIR}" - COMPONENT dev) +IF(CMAKE_INSTALL_DIR) + INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION "${CMAKE_INSTALL_DIR}" + COMPONENT dev) +ENDIF() diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index e2cc6000..1cdc29c0 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1235,8 +1235,8 @@ public: // return NullValue; // Use static buffer and placement-new to prevent destruction - static char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); + static GenericValue buffer; + return *new (reinterpret_cast<char *>(&buffer)) GenericValue(); } } template <typename SourceAllocator> |