changed how building is triggered, now there is a [twn] shell script that is exptected to be in PATH. also physfs and libxm cmake targets no longer recompiled per every target, but shared

This commit is contained in:
veclav talica 2024-09-25 19:51:39 +03:00
parent a500fcd97c
commit 4c9278a927
8 changed files with 21 additions and 25 deletions

View File

@ -51,8 +51,8 @@ set(PHYSFS_ARCHIVE_QPAK OFF)
set(PHYSFS_ARCHIVE_SLB OFF) set(PHYSFS_ARCHIVE_SLB OFF)
set(PHYSFS_ARCHIVE_ISO9660 OFF) set(PHYSFS_ARCHIVE_ISO9660 OFF)
set(PHYSFS_ARCHIVE_VDF OFF) set(PHYSFS_ARCHIVE_VDF OFF)
add_subdirectory(third-party/physfs SYSTEM) add_subdirectory(third-party/physfs ${CMAKE_CURRENT_BINARY_DIR}/third-party/physfs SYSTEM)
add_subdirectory(third-party/libxm SYSTEM) add_subdirectory(third-party/libxm ${CMAKE_CURRENT_BINARY_DIR}/third-party/libxm SYSTEM)
if(LINUX) if(LINUX)

View File

@ -6,10 +6,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
endif() endif()
# add root townengine cmake file add_subdirectory($ENV{TWNROOT} $ENV{TWNBUILDDIR})
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(../../ ../../../.build)
endif()
set(SOURCE_FILES set(SOURCE_FILES
game.c game.c

View File

@ -6,10 +6,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
endif() endif()
# add root townengine cmake file add_subdirectory($ENV{TWNROOT} $ENV{TWNBUILDDIR})
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(../../ ../../../.build)
endif()
set(SOURCE_FILES set(SOURCE_FILES
game.c game.c

View File

@ -1,7 +0,0 @@
#!/bin/env sh
if [ $1 = "web" ]; then
emcmake cmake -B .build-web "${@:2}" && cmake --build .build-web
else
cmake -B .build "$@" && cmake --build .build
fi

View File

@ -6,10 +6,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
endif() endif()
# add root townengine cmake file add_subdirectory($ENV{TWNROOT} $ENV{TWNBUILDDIR})
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(../../ ../../../.build)
endif()
set(SOURCE_FILES set(SOURCE_FILES
game.c game.c

View File

@ -1,3 +0,0 @@
#!/bin/env sh
cmake -B .build "$@" && cmake --build .build

View File

@ -1,6 +1,6 @@
#!/bin/env sh #!/bin/env sh
if [ $1 = "web" ]; then if [ "$1" = "web" ]; then
emcmake cmake -B .build-web "${@:2}" && cmake --build .build-web emcmake cmake -B .build-web "${@:2}" && cmake --build .build-web
else else
cmake -B .build "$@" && cmake --build .build cmake -B .build "$@" && cmake --build .build

15
tools/twn Executable file
View File

@ -0,0 +1,15 @@
#!/bin/env sh
# townengine tooling interface
set +e
toolpath="$(dirname -- "${BASH_SOURCE[0]}")"
export TWNROOT=$(realpath "$toolpath"/../)
export TWNBUILDDIR=$(realpath "$toolpath"/../.build)
case "$1" in
build ) "$toolpath"/build.sh
;;
* ) echo "Unknown command."
;;
esac