CMake: Fix configure defines
This commit is contained in:
@@ -120,16 +120,6 @@ if (WIN32)
|
||||
list(APPEND GENERATED_SOURCE_FILES "${CMAKE_BINARY_DIR}/generated/ottdres.rc")
|
||||
endif (WIN32)
|
||||
|
||||
# Generate a target to determine version, which is execute every 'make' run
|
||||
add_custom_target(find_version
|
||||
${CMAKE_COMMAND}
|
||||
-DFIND_VERSION_BINARY_DIR=${CMAKE_BINARY_DIR}/generated
|
||||
-DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
BYPRODUCTS ${GENERATED_SOURCE_FILES}
|
||||
)
|
||||
|
||||
include(SourceList)
|
||||
include(Endian)
|
||||
add_endian_definition()
|
||||
@@ -253,3 +243,21 @@ include(CreateRegression)
|
||||
create_regression()
|
||||
|
||||
include(InstallAndPackage)
|
||||
|
||||
get_property(CFG_DEFS DIRECTORY . PROPERTY COMPILE_OPTIONS)
|
||||
list(FILTER CFG_DEFS INCLUDE REGEX "^-D")
|
||||
list(TRANSFORM CFG_DEFS REPLACE "^-D" "")
|
||||
get_property(CFG_DEFS_2 DIRECTORY . PROPERTY COMPILE_DEFINITIONS)
|
||||
list(APPEND CFG_DEFS ${CFG_DEFS_2})
|
||||
list(FILTER CFG_DEFS EXCLUDE REGEX "_DIR=")
|
||||
|
||||
# Generate a target to determine version, which is execute every 'make' run
|
||||
add_custom_target(find_version
|
||||
${CMAKE_COMMAND}
|
||||
-DFIND_VERSION_BINARY_DIR=${CMAKE_BINARY_DIR}/generated
|
||||
-DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
|
||||
-DCONFIGURE_DEFINES="${CFG_DEFS}"
|
||||
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
BYPRODUCTS ${GENERATED_SOURCE_FILES}
|
||||
)
|
||||
|
@@ -144,7 +144,6 @@ char *CrashLog::LogOpenTTDVersion(char *buffer, const char *last) const
|
||||
" Endian: %s\n"
|
||||
" Dedicated: %s\n"
|
||||
" Build date: %s\n"
|
||||
" Configure: %s\n"
|
||||
" Defines: %s\n\n",
|
||||
_openttd_revision,
|
||||
_openttd_revision_modified,
|
||||
@@ -165,7 +164,6 @@ char *CrashLog::LogOpenTTDVersion(char *buffer, const char *last) const
|
||||
"no",
|
||||
#endif
|
||||
_openttd_build_date,
|
||||
_openttd_build_configure,
|
||||
_openttd_build_configure_defines
|
||||
);
|
||||
}
|
||||
|
@@ -45,16 +45,10 @@ const char _openttd_revision[] = "${REV_VERSION}";
|
||||
*/
|
||||
const char _openttd_build_date[] = __DATE__ " " __TIME__;
|
||||
|
||||
|
||||
/**
|
||||
* The configure invocation used to build OpenTTD
|
||||
*/
|
||||
const char _openttd_build_configure[] = "!!CONFIGURE_INVOCATION!!";
|
||||
|
||||
/**
|
||||
* The configure defines used to build OpenTTD
|
||||
*/
|
||||
const char _openttd_build_configure_defines[] = "!!CONFIGURE_DEFINES!!";
|
||||
const char _openttd_build_configure_defines[] = "${CONFIGURE_DEFINES}";
|
||||
|
||||
/**
|
||||
* The git revision hash of this version.
|
||||
|
@@ -14,7 +14,6 @@ extern const char _openttd_revision[];
|
||||
extern const char _openttd_build_date[];
|
||||
extern const char _openttd_revision_hash[];
|
||||
extern const char _openttd_revision_year[];
|
||||
extern const char _openttd_build_configure[];
|
||||
extern const char _openttd_build_configure_defines[];
|
||||
extern const byte _openttd_revision_modified;
|
||||
extern const byte _openttd_revision_tagged;
|
||||
|
Reference in New Issue
Block a user