Skip to content

Commit

Permalink
Merge pull request ddnet#7310 from infclass/fix-cmake-versioning
Browse files Browse the repository at this point in the history
Fix cmake versioning
  • Loading branch information
def- authored Oct 6, 2023
2 parents 9e30ce3 + 418d8ae commit d6aa18e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ else()
message(FATAL_ERROR "Couldn't parse version from src/game/version.h")
endif()

# Extra support for CMake pre-3.0
if(VERSION_PATCH STREQUAL "0")
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
else()
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
endif()
project(DDNet VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(ORIGINAL_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
Expand Down Expand Up @@ -3358,6 +3353,9 @@ foreach(target ${TARGETS_OWN})
target_compile_definitions(${target} PRIVATE CONF_DISCORD_DYNAMIC)
endif()
endif()
if(VERSION)
target_compile_definitions(${target} PRIVATE GAME_RELEASE_VERSION="${VERSION}")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
target_compile_definitions(${target} PRIVATE CONF_WEBASM)
endif()
Expand Down

0 comments on commit d6aa18e

Please sign in to comment.