Skip to content

Commit

Permalink
Make version tags more restrictive and fix merge conflicts
Browse files Browse the repository at this point in the history
With this commit, I added a bit to the git version tag glob so that we try to at least match numbers rather than just anything starting with a v. Also fixed a merge issue that was running the same src glob twice.
  • Loading branch information
Matt committed Dec 14, 2020
1 parent 6195b63 commit 172d3bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .version
@@ -1 +1 @@
v0.0.13-35bb5de*v0.0*0*0*13*13*35bb5de
v0.0.16-81055ea*v0.0*0*0*16*16*81055ea
19 changes: 6 additions & 13 deletions CMakeLists.txt
Expand Up @@ -8,6 +8,7 @@ option(EXCLUDE_DD "Builds the device client without the IoT Device Defender Feat
option(EXCLUDE_ST "Builds the device client without the IoT Secure Tunneling Feature." OFF)
option(EXCLUDE_FP "Builds the device client without the IoT Fleet Provisioning Feature." OFF)
option(DISABLE_MQTT "WARNING: This flag is meant for internal use cases and will prevent Device Client features from operating. Builds the device client without MQTT Connection Management." OFF)
option(GIT_VERSION "Updates the version number using the Git commit history" ON)

if (EXCLUDE_JOBS)
add_definitions(-DEXCLUDE_JOBS)
Expand Down Expand Up @@ -66,10 +67,6 @@ set(CMAKE_C_FLAGS_DEBUGOPT "")
set(CMAKE_BUILD_TYPE Debug) # Switch to Release for the "Release" build
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")

option(GIT_VERSION "Updates the version number using the Git commit history" ON)
option(BUILD_SDK "Builds the aws-iot-device-sdk-cpp-v2 as part of build. Only do this if the SDK is not installed." ON)
option(BUILD_TEST_DEPS "Builds the device client test dependencies as part of build. Only do this if you do not have gtest installed and you wish to run the tests." ON)

#########################################
# Generate Version Information from Git #
#########################################
Expand Down Expand Up @@ -105,18 +102,14 @@ else()
link_directories(/lib)
endif()

##############################################
# Build the AWS IoT Device Client Executable #
##############################################
file(GLOB DC_SRC "source/*.cpp" /
"source/*.c" /
"source/**/*.cpp" /
"source/**/*.c")
###############################################
## Build the AWS IoT Device Client Executable #
###############################################
add_executable(${DC_PROJECT_NAME} ${DC_SRC})
set_target_properties(${DC_PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
target_compile_definitions(${DC_PROJECT_NAME} PRIVATE "-DDEBUG_BUILD")
# We need to add the project binary directory to the list of include directories
# for passing the version information down to the executable
## We need to add the project binary directory to the list of include directories
## for passing the version information down to the executable
include_directories("${PROJECT_BINARY_DIR}")

if (MSVC)
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt.versioning
Expand Up @@ -20,7 +20,7 @@ if (GIT_VERSION AND NOT ${GIT_INFO} STREQUAL "")
message("-- Using Git to calculate AWS IoT Device Client version information...")

# Get last tag from git - this only matches tags starting with v, so we ignore non-versioning tags
execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags --match "v*"
execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags --match "v[0-9]*"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE)
Expand Down

0 comments on commit 172d3bd

Please sign in to comment.