Skip to content

Commit

Permalink
Merge pull request #221 from openziti/remove-local-from-version
Browse files Browse the repository at this point in the history
eliminate -local suffix from version
  • Loading branch information
ekoby authored Jan 26, 2021
2 parents 1c30b2a + 5544069 commit 7f88a2f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ enable_testing()

if (DEFINED ENV{BUILD_NUMBER})
set(ZITI_BUILDNUM $ENV{BUILD_NUMBER})
else ()
set(ZITI_BUILDNUM local)
endif ()

set(ZITI_VERSION ${PROJECT_VERSION}-${ZITI_BUILDNUM})
Expand Down
21 changes: 12 additions & 9 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,29 @@ target_include_directories(ziti ${ZITI_INCLUDE_DIRS})
target_include_directories(ziti_dll ${ZITI_INCLUDE_DIRS})
set_target_properties(ziti_dll PROPERTIES OUTPUT_NAME "ziti")

target_compile_definitions(ziti PUBLIC
ZITI_BUILDNUM=${ZITI_BUILDNUM}
set(ziti_compile_defs
BUILD_DATE=${BUILD_DATE}
ZITI_VERSION=${PROJECT_VERSION}
ZITI_BRANCH=${GIT_BRANCH}
ZITI_COMMIT=${GIT_COMMIT_HASH}
SOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}
PRIVATE ZITI_LOG_PREFIX=${PROJECT_NAME}
)

if (ZITI_BUILDNUM)
list(APPEND ziti_compile_defs
ZITI_BUILDNUM=${ZITI_BUILDNUM}
)
endif()

target_compile_definitions(ziti PUBLIC
${ziti_compile_defs}
)

target_compile_definitions(ziti_dll PUBLIC
ZITI_BUILDNUM=${ZITI_BUILDNUM}
BUILD_DATE=${BUILD_DATE}
ZITI_VERSION=${PROJECT_VERSION}
ZITI_BRANCH=${GIT_BRANCH}
ZITI_COMMIT=${GIT_COMMIT_HASH}
SOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}
${ziti_compile_defs}
INTERFACE USING_ZITI_SHARED=1
PRIVATE BUILDING_ZITI_SHARED=1
PRIVATE ZITI_LOG_PREFIX=${PROJECT_NAME}
)

if (WIN32)
Expand Down
8 changes: 4 additions & 4 deletions library/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ limitations under the License.
#define ZITI_VERSION unknown
#endif

#if !defined(ZITI_BUILDNUM)
#define ZITI_BUILDNUM <local>
#endif

#if !defined(ZITI_BRANCH)
#define ZITI_BRANCH "<no-branch>"
#define ZITI_COMMIT "<sha>"
Expand Down Expand Up @@ -88,7 +84,11 @@ const char *ziti_get_build_version(int verbose) {
"\n";

}
#ifdef ZITI_BUILDNUM
return to_str(ZITI_VERSION) "-" to_str(ZITI_BUILDNUM);
#else
return to_str(ZITI_VERSION);
#endif
}

const char* ziti_git_branch() {
Expand Down

0 comments on commit 7f88a2f

Please sign in to comment.