Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove autotools #3229

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
*.py text
*.rb text
*.sh text
*.ac text
*.am text

tests/doctest.h -diff linguist-vendored
builds/autoconf/m4/ax_*.m4 -diff linguist-vendored
src/external/* -diff linguist-vendored
src/midiprogram.h -diff linguist-vendored
src/midisequencer.* -diff linguist-vendored
Expand All @@ -20,3 +17,19 @@ CMakePresets.json -diff linguist-generated
builds/android/app/src/main/java/org/libsdl/app/*.java -diff linguist-vendored
builds/android/app/src/main/java/org/libsdl/app/SDLActivity.java diff
src/generated/* -diff linguist-generated

.gitattributes export-ignore
.gitignore export-ignore
/.github/ export-ignore
/.tx/ export-ignore
.editorconfig export-ignore
/builds/cmake/.git-hash export-subst

#TODO? .gitmodules export-ignore
#TODO? /builds/libretro/ export-ignore

/builds/android/ export-ignore
/builds/flatpak/ export-ignore
/builds/snap/ export-ignore
/builds/release-helper.sh export-ignore
/builds/make-dist.sh export-ignore
35 changes: 2 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/bin/
/Makefile
/easyrpg-player
/Player.app
*.a
Expand All @@ -9,33 +7,8 @@
*.orig
*.bak

# autotools
/autom4te.cache/
/easyrpg-player-*/
/.libs/
.deps/
Makefile.in
aclocal.m4
config.h
config.h.in
config.status
configure
libtool
/builds/autoconf/aux/
/builds/autoconf/m4/*.m4
!/builds/autoconf/m4/ax_*.m4
!/builds/autoconf/m4/with_pkg.m4
stamp-h1
.dirstamp
*.la
*.lo
/output
/utils
/directorytree
/.version-append
/.version-git

# cmake
/Makefile
CMakeFiles/
CMakeScripts/
CMakeCache.txt
Expand Down Expand Up @@ -88,10 +61,10 @@ build/
# test/run artifacts
easyrpg_log.txt
/*.log
/*.trs
Testing/

# distribution archives
/easyrpg-player-*/
easyrpg-player-*.tar.*
*.zip

Expand All @@ -109,10 +82,6 @@ __MACOSX
/RelWithDebInfo/
/*.build/

# legacy
/lib/liblcf/
.buildconfig

# Android
*.iml
local.properties
Expand Down
68 changes: 17 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ include(PlayerConfigureWindows)
include(PlayerFindPackage)
include(PlayerBuildType)
include(PlayerMisc)
include(GetGitRevisionDescription)

# Dependencies provided by CMake Presets
list(APPEND CMAKE_PREFIX_PATH "${PLAYER_PREFIX_PATH_APPEND}")
Expand Down Expand Up @@ -486,53 +485,24 @@ set(PLAYER_VERSION_FULL ${PLAYER_VERSION})
string(CONCAT PROJECT_VERSION
${PROJECT_VERSION_MAJOR} "." ${PROJECT_VERSION_MINOR} "."
${PROJECT_VERSION_PATCH} "." ${PROJECT_VERSION_TWEAK})

set(PLAYER_VERSION_GIT "")
git_get_exact_tag(GIT_TAG)
# Do not include a hash, if we are building a release tag
if(NOT GIT_TAG)
# otherwise concatenate a version with hash
git_describe(GIT_DESCRIPTION)
if(GIT_DESCRIPTION)
string(REPLACE "-" ";" GIT_DESCRIPTION ${GIT_DESCRIPTION})
list(LENGTH GIT_DESCRIPTION GIT_DESCRIPTION_PARTS)
set(GIT_MESSAGE "Found git info: ")
if(GIT_DESCRIPTION_PARTS EQUAL 3)
list(GET GIT_DESCRIPTION 0 GIT_TAG)
list(GET GIT_DESCRIPTION 1 GIT_COMMITS)
list(GET GIT_DESCRIPTION 2 GIT_HASH)
string(APPEND GIT_MESSAGE "${GIT_COMMITS} commits since tag \"${GIT_TAG}\", ")
string(PREPEND GIT_COMMITS "+")
# strip the g prefix
string(SUBSTRING ${GIT_HASH} 1 -1 GIT_HASH)
else()
# no tags found, only hash
list(GET GIT_DESCRIPTION 0 GIT_HASH)
endif()
set(PLAYER_VERSION_GIT "git${GIT_COMMITS}@${GIT_HASH}")
string(APPEND GIT_MESSAGE "object hash is ${GIT_HASH}")
git_local_changes(GIT_DIRTY)
if(GIT_DIRTY STREQUAL "DIRTY")
string(APPEND PLAYER_VERSION_GIT "-dirty")
string(APPEND GIT_MESSAGE ", you have uncommitted changes")
endif()
string(APPEND PLAYER_VERSION_FULL "-${PLAYER_VERSION_GIT}")

message(STATUS "${GIT_MESSAGE}")
endif()
set(PLAYER_VERSION_DEFS EP_VERSION="${PLAYER_VERSION}"
EP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} EP_VERSION_MINOR=${PROJECT_VERSION_MINOR}
EP_VERSION_PATCH=${PROJECT_VERSION_PATCH} EP_VERSION_TWEAK=${PROJECT_VERSION_TWEAK})

player_find_gitversion(VERSION_VAR PLAYER_VERSION_GIT
MESSAGE_VAR GIT_STATUS)
if(PLAYER_VERSION_GIT)
string(APPEND PLAYER_VERSION_FULL "-${PLAYER_VERSION_GIT}")
list(APPEND PLAYER_VERSION_DEFS EP_VERSION_GIT="${PLAYER_VERSION_GIT}")
endif()

string(TIMESTAMP PLAYER_DATE "(%Y-%m-%d)")
set(PLAYER_VERSION_APPEND ${PLAYER_DATE} CACHE STRING "Additional version information to include")
set_property(SOURCE src/version.cpp PROPERTY COMPILE_DEFINITIONS
EP_VERSION="${PLAYER_VERSION}";
EP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR};
EP_VERSION_MINOR=${PROJECT_VERSION_MINOR};
EP_VERSION_PATCH=${PROJECT_VERSION_PATCH};
EP_VERSION_TWEAK=${PROJECT_VERSION_TWEAK};
EP_VERSION_APPEND="${PLAYER_VERSION_APPEND}";
EP_VERSION_GIT="${PLAYER_VERSION_GIT}"
)
if(NOT PLAYER_VERSION_APPEND STREQUAL "")
list(APPEND PLAYER_VERSION_DEFS EP_VERSION_APPEND="${PLAYER_VERSION_APPEND}")
endif()

set_property(SOURCE src/version.cpp PROPERTY COMPILE_DEFINITIONS ${PLAYER_VERSION_DEFS})

# Platform setup
set(PLAYER_TARGET_PLATFORM "SDL2" CACHE STRING "Platform to compile for. Options: SDL2 SDL1 libretro psvita 3ds switch wii amigaos4")
Expand Down Expand Up @@ -1392,14 +1362,7 @@ find_package(Doxygen)
set(DOXYGEN_STATUS "Unavailable")
if(DOXYGEN_FOUND)
set(DOXYGEN_STATUS "Available (target \"doc\")")
# fake autotools variables
set(PACKAGE_VERSION ${PLAYER_VERSION})
set(DX_DOCDIR ${CMAKE_CURRENT_BINARY_DIR}/doc)
set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
configure_file(resources/Doxyfile.in resources/Doxyfile @ONLY)
unset(PACKAGE_VERSION)
unset(DX_DOCDIR)
unset(srcdir)

add_custom_target(player_doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/resources/Doxyfile
Expand Down Expand Up @@ -1473,6 +1436,9 @@ endif()

# Print summary
message(STATUS "")
message(STATUS "EasyRPG Player version ${PLAYER_VERSION} has been configured --")
message(STATUS "Git info: ${GIT_STATUS}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Target system: ${PLAYER_TARGET_PLATFORM}")
if(PLAYER_ROMFS)
message(STATUS "RomFS: Embedding directory \"${PLAYER_ROMFS_PATH}\"")
Expand Down
Loading