mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 14:09:49 +00:00
Improve the autorevision in cmake.
It now sets its default based on an initial testrun.
This commit is contained in:
parent
1c11e30edc
commit
b2353cc016
@ -82,12 +82,34 @@ option(ENABLE_NLS "Enable building of translations" ON)
|
||||
option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
|
||||
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
|
||||
|
||||
if(NOT UNIX)
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
|
||||
else()
|
||||
# TODO test whether can be enabled by default
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
|
||||
if(NOT DEFINED ENABLE_DISPLAY_REVISION)
|
||||
# Test whether the code is used in a repository if not autorevision will
|
||||
# fail and should be disabled by default. If inside a repository enable
|
||||
# the display of revision numbers by default.
|
||||
execute_process(
|
||||
COMMAND
|
||||
${CMAKE_SOURCE_DIR}/utils/autorevision
|
||||
-th
|
||||
> ${CMAKE_CURRENT_BINARY_DIR}/revision.dummy
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_OUTPUT
|
||||
ERROR_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_ERRNO
|
||||
)
|
||||
|
||||
if("${ENABLE_DISPLAY_REVISION_TEST_ERRNO}" STREQUAL "")
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION true)
|
||||
else()
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
|
||||
endif()
|
||||
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_OUTPUT)
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_ERRNO)
|
||||
|
||||
endif()
|
||||
|
||||
option(
|
||||
ENABLE_DISPLAY_REVISION
|
||||
"Enable the display of the revision number in the game, only enable it when in a checkout"
|
||||
|
@ -3,6 +3,7 @@ Version 1.11.2+dev:
|
||||
* Updated translations: Indonesian, Portuguese, Vietnamese
|
||||
* Miscellaneous and bug fixes
|
||||
* Switched to git version control. Hosting moved to SourceForge
|
||||
* Improved: Autorevision based revision numbers in CMake.
|
||||
|
||||
Version 1.11.2:
|
||||
* Add-ons client:
|
||||
|
Loading…
x
Reference in New Issue
Block a user