Skip to content

Commit

Permalink
Fix D2_VERSION_MINOR issues with 0X due to octal notation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lectem committed Dec 30, 2023
1 parent 353c75d commit ad63d1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/D2CommonDefinitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ if(D2MOO_ORDINALS_VERSION)

cmake_print_variables(D2MOO_ORDINAL_VERSION_MAJOR D2MOO_ORDINAL_VERSION_MINOR D2MOO_ORDINAL_VERSION_PATCH D2MOO_ORDINAL_VERSION_SPECIAL D2MOO_ORDINAL_VERSION_DEFINE_NAME)

string(REGEX REPLACE "^0+" "" D2MOO_ORDINAL_VERSION_MINOR_NO_LEADING_ZEROS ${D2MOO_ORDINAL_VERSION_MINOR})
target_compile_definitions(D2CommonDefinitions
INTERFACE
${D2MOO_ORDINAL_VERSION_DEFINE_NAME}
D2_VERSION_MAJOR=${D2MOO_ORDINAL_VERSION_MAJOR}
D2_VERSION_MINOR=${D2MOO_ORDINAL_VERSION_MINOR}
D2_VERSION_MINOR=${D2MOO_ORDINAL_VERSION_MINOR_NO_LEADING_ZEROS}
D2_VERSION_PATCH='${D2MOO_ORDINAL_VERSION_PATCH}' # Allow only single character
$<$<NOT:$<STREQUAL:D2MOO_ORDINAL_VERSION_SPECIAL,"">>:D2_VERSION_SPECIAL="${D2MOO_ORDINAL_VERSION_SPECIAL}">
)
Expand Down

0 comments on commit ad63d1a

Please sign in to comment.