From 0ef4d90ad07f2abc72b22600292c32d32cb1ff44 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Tue, 30 Jun 2020 19:36:26 -0400 Subject: [PATCH] Fix for issue 1014. (#1015) * Fix for issue 1014. * Explanation. Co-authored-by: Daniel Lemire --- CMakeLists.txt | 4 ++-- Doxyfile | 2 +- include/simdjson/simdjson_version.h | 4 ++-- singleheader/amalgamate_demo.cpp | 2 +- singleheader/simdjson.cpp | 2 +- singleheader/simdjson.h | 6 +++--- src/CMakeLists.txt | 12 +++++++++++- tests/CMakeLists.txt | 16 ++++++++++++++++ 8 files changed, 37 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2398ac49..23a66641 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ project(simdjson set(PROJECT_VERSION_MAJOR 0) set(PROJECT_VERSION_MINOR 4) -set(PROJECT_VERSION_PATCH 4) -set(SIMDJSON_LIB_VERSION "0.4.4" CACHE STRING "simdjson library version") +set(PROJECT_VERSION_PATCH 5) +set(SIMDJSON_LIB_VERSION "0.4.5" CACHE STRING "simdjson library version") set(SIMDJSON_LIB_SOVERSION "2" CACHE STRING "simdjson library soversion") set(SIMDJSON_GITHUB_REPOSITORY https://github.com/simdjson/simdjson) diff --git a/Doxyfile b/Doxyfile index 5668a620..c81ae994 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = simdjson # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "0.4.4" +PROJECT_NUMBER = "0.4.5" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/simdjson/simdjson_version.h b/include/simdjson/simdjson_version.h index 503cec84..519f814e 100644 --- a/include/simdjson/simdjson_version.h +++ b/include/simdjson/simdjson_version.h @@ -4,7 +4,7 @@ #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION 0.4.4 +#define SIMDJSON_VERSION 0.4.5 namespace simdjson { enum { @@ -19,7 +19,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 4 + SIMDJSON_VERSION_REVISION = 5 }; } // namespace simdjson diff --git a/singleheader/amalgamate_demo.cpp b/singleheader/amalgamate_demo.cpp index 47f7b167..293150aa 100644 --- a/singleheader/amalgamate_demo.cpp +++ b/singleheader/amalgamate_demo.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Tue 30 Jun 2020 09:41:13 EDT. Do not edit! */ +/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */ #include #include "simdjson.h" diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index e2cb9e9f..b62b52a6 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on Tue 30 Jun 2020 09:41:13 EDT. Do not edit! */ +/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */ /* begin file src/simdjson.cpp */ #include "simdjson.h" diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index 832e08d3..7833e51f 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on Tue 30 Jun 2020 09:41:13 EDT. Do not edit! */ +/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */ /* begin file include/simdjson.h */ #ifndef SIMDJSON_H #define SIMDJSON_H @@ -2040,7 +2040,7 @@ SIMDJSON_DISABLE_UNDESIRED_WARNINGS #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION 0.4.4 +#define SIMDJSON_VERSION 0.4.5 namespace simdjson { enum { @@ -2055,7 +2055,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 4 + SIMDJSON_VERSION_REVISION = 5 }; } // namespace simdjson diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 442d8b16..1a0a40ba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -78,7 +78,17 @@ if(NOT MSVC) ## We output the library at the root of the current directory where cmake is invoked ## This is handy but Visual Studio will happily ignore us set_target_properties(simdjson PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) - MESSAGE( STATUS "Library output directory (does not apply to Visual Studio): " ${PROJECT_BINARY_DIR}) + MESSAGE( STATUS "Library output directory: " ${PROJECT_BINARY_DIR}) + + ############ + # Please do not delete the following, our users want version numbers. See + # https://github.com/simdjson/simdjson/issues/1014 + # https://github.com/simdjson/simdjson/issues/52 + ########### + set_target_properties(simdjson PROPERTIES VERSION ${SIMDJSON_LIB_VERSION} SOVERSION ${SIMDJSON_LIB_SOVERSION}) + ########## + # End of the do-not-delete message. + ######### endif() # diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fa1f89e7..60f025a1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -177,4 +177,20 @@ endif() # target_link_libraries(singleheader simdjson simdjson-flags) # add_test(singleheader singleheader) +if(NOT MSVC) + ###### + # This tests is to guard us against ever again removing the soversion + # and version numbers from the library. See Bug + # https://github.com/simdjson/simdjson/issues/1014 + ##### + get_target_property(REPORTED_SIMDJSON_VERSION simdjson VERSION) + get_target_property(REPORTED_SIMDJSON_SOVERSION simdjson SOVERSION) + if(NOT ${REPORTED_SIMDJSON_VERSION} STREQUAL ${SIMDJSON_LIB_VERSION}) + message(FATAL_ERROR "The library target does not have the proper version information." ) + endif() + if(NOT ${REPORTED_SIMDJSON_SOVERSION} STREQUAL ${SIMDJSON_LIB_SOVERSION}) + message(FATAL_ERROR "The library target does not have the proper soversion information." ) + endif() +endif() + add_subdirectory(compilation_failure_tests)