From be322f8a28a1058ca3b4810af929c8df550ec03f Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Sun, 6 Oct 2019 04:37:44 -0700 Subject: [PATCH] more work getting checks and preflights up and running --- .idea/dictionaries/ericf.xml | 3 + Makefile | 438 +--------- ballisticacore-cmake/.idea/.gitignore | 3 - ballisticacore-cmake/.idea/.name | 1 - .../.idea/ballisticacore-cmake.iml | 2 - .../.idea/codeStyles/Project.xml | 8 - .../.idea/codeStyles/codeStyleConfig.xml | 5 - .../.idea/dictionaries/ericf.xml | 807 ------------------ .../inspectionProfiles/Project_Default.xml | 23 - ballisticacore-cmake/.idea/misc.xml | 30 - ballisticacore-cmake/.idea/modules.xml | 8 - ballisticacore-cmake/.idea/vcs.xml | 6 - ballisticacore-cmake/CMakeLists.txt | 743 ---------------- tools/efrotools/makefile.py | 36 +- tools/update_project | 397 +++++++++ 15 files changed, 440 insertions(+), 2070 deletions(-) delete mode 100644 ballisticacore-cmake/.idea/.gitignore delete mode 100644 ballisticacore-cmake/.idea/.name delete mode 100644 ballisticacore-cmake/.idea/ballisticacore-cmake.iml delete mode 100644 ballisticacore-cmake/.idea/codeStyles/Project.xml delete mode 100644 ballisticacore-cmake/.idea/codeStyles/codeStyleConfig.xml delete mode 100644 ballisticacore-cmake/.idea/dictionaries/ericf.xml delete mode 100644 ballisticacore-cmake/.idea/inspectionProfiles/Project_Default.xml delete mode 100644 ballisticacore-cmake/.idea/misc.xml delete mode 100644 ballisticacore-cmake/.idea/modules.xml delete mode 100644 ballisticacore-cmake/.idea/vcs.xml delete mode 100644 ballisticacore-cmake/CMakeLists.txt create mode 100755 tools/update_project diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml index 89aad152..49873008 100644 --- a/.idea/dictionaries/ericf.xml +++ b/.idea/dictionaries/ericf.xml @@ -1,6 +1,9 @@ + spacelen + plines + formatmakefile nosynctools nosyncdir nosyncdirs diff --git a/Makefile b/Makefile index 6895cd84..0aba8fb6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # add that argument to subprocesses as needed. # Default is to build/run the mac version. -all: mac +all: cmake # We often want one job per core, so try to determine our logical core count. ifeq ($(wildcard /proc),/proc) # Linux @@ -29,9 +29,8 @@ DOCPREFIX = "ballisticacore_" # Prerequisites that should be in place before running most any other build; # things like tool config files, etc. -PREREQS = .dir-locals.el .mypy.ini .pycheckers .pylintrc \ - .style.yapf .clang-format ballisticacore-cmake/.clang-format \ - .irony/compile_commands.json +PREREQS = .dir-locals.el .mypy.ini .pycheckers \ + .pylintrc .style.yapf .clang-format # List the targets in this Makefile and basic descriptions for them. list: @@ -92,29 +91,10 @@ cleanlist: @${CHECK_CLEAN_SAFETY} @git clean -dnx ${ROOT_CLEAN_IGNORES} -# For spinoff projects: pull in the newest parent project -# and sync changes into ourself. -spinoff-upgrade: - @echo Pulling latest parent project... - @cd submodules/ballistica && git checkout master && git pull - @echo Syncing parent into current project... - @tools/spinoff update - @echo spinoff upgrade successful! - -# Shortcut to run a spinoff upgrade and push to git. -spinoff-upgrade-push: spinoff-upgrade - git add . - git commit -m "spinoff upgrade" - git push - -# Force regenerate the dummy module. -dummymodule: - ./tools/gendummymodule.py --force - # Tell make which of these targets don't represent files. .PHONY: list prereqs prereqs-clean assets assets-desktop assets-ios\ assets-android assets-clean resources resources-clean code code-clean\ - clean cleanlist spinoff-upgrade spinoff-upgrade-push dummymodule + clean cleanlist ################################################################################ @@ -293,58 +273,6 @@ preflightfull2: preflightfull preflightfull2 -################################################################################ -# # -# CMake # -# # -################################################################################ - -# Build and run the cmake build. -cmake: cmake-build - @cd ballisticacore-cmake/build/debug && ./ballisticacore - -# Build but don't run it. -cmake-build: assets-desktop resources code - @${STAGE_ASSETS} -cmake ballisticacore-cmake/build/debug - @cd ballisticacore-cmake/build/debug && test -f Makefile \ - || cmake -DCMAKE_BUILD_TYPE=Debug ../.. - @cd ballisticacore-cmake/build/debug && make -j${JOBS} - -# Build and run it with an immediate quit command. -# Tests if the game is able to bootstrap itself. -cmake-launchtest: cmake-build - @cd ballisticacore-cmake/build/debug \ - && ./ballisticacore -exec "ba.quit()" - -# Build, sync to homebook fro, and run there. -cmake-hometest: cmake-build - @rsync --verbose --recursive --links --checksum --delete -e "ssh -p 49136" \ - ballisticacore-cmake/build/ballisticacore/ \ - efro.duckdns.org:/Users/ericf/Documents/remote_ballisticacore_test - # Note: use -t so the game sees a terminal and we get prompts & log output. - @ssh -t -p 49136 efro.duckdns.org \ - cd /Users/ericf/Documents/remote_ballisticacore_test \&\& ./ballisticacore - -cmake-clean: - rm -rf ballisticacore-cmake/build/debug - -cmake-server: cmake-server-build - @cd ballisticacore-cmake/build/server-debug && ./ballisticacore - -cmake-server-build: assets-desktop resources code - @${STAGE_ASSETS} -cmake-server ballisticacore-cmake/build/server-debug - @cd ballisticacore-cmake/build/server-debug && test -f Makefile \ - || cmake -DCMAKE_BUILD_TYPE=Debug -DHEADLESS=true ../.. - @cd ballisticacore-cmake/build/server-debug && make -j${JOBS} - -cmake-server-clean: - rm -rf ballisticacore-cmake/build/server-debug - -# Tell make which of these targets don't represent files. -.PHONY: cmake cmake-build cmake-launchtest cmake-hometest cmake-clean \ - cmake-server cmake-server-build cmake-server-clean - - ################################################################################ # # # Auxiliary # @@ -362,286 +290,6 @@ ROOT_CLEAN_IGNORES = --exclude=assets/src_master \ --exclude=.spinoffdata CHECK_CLEAN_SAFETY = ${ROOT_DIR}/tools/snippets check_clean_safety -ASSET_CACHE_DIR = ${shell ${ROOT_DIR}/tools/convert_util --get-asset-cache-dir} -ASSET_CACHE_NAME = ${shell ${ROOT_DIR}/tools/convert_util \ - --get-asset-cache-name} -RPI_SERVER_PACKAGE_NAME = BallisticaCore_Server_RaspberryPi_${VERSION} - -MAC_PACKAGE_NAME = BallisticaCore_Mac_${VERSION} -MAC_SERVER_PACKAGE_NAME = BallisticaCore_Server_Mac_${VERSION} -MAC_DIST_BUILD_DIR = ${shell ${ROOT_DIR}/tools/xc_build_path \ - ${ROOT_DIR}/ballisticacore-mac.xcodeproj Release} -MAC_DEBUG_BUILD_DIR = ${shell ${ROOT_DIR}/tools/xc_build_path \ - ${ROOT_DIR}/ballisticacore-mac.xcodeproj Debug} - -STAGE_ASSETS = ${ROOT_DIR}/tools/stage_assets - -# Eww; no way to do multi-line constants in make without spaces :-( -_WMSBE_1 = \"C:\\Program Files \(x86\)\\Microsoft Visual Studio\\2019 -_WMSBE_2 = \\Community\\MSBuild\\Current\\Bin\\MSBuild.exe\" - -WIN_INTERNAL_HOME = $(shell tools/vmshell win7 GET_INTERNAL_HOME) -WIN_MSBUILD_EXE = ${_WMSBE_1}${_WMSBE_2} -VISUAL_STUDIO_VERSION = /p:VisualStudioVersion=16 -WIN_SERVER_PACKAGE_NAME = BallisticaCore_Server_Windows_${VERSION} -WIN_PACKAGE_NAME = BallisticaCore_Windows_${VERSION} -WIN_OCULUS_PACKAGE_NAME = BallisticaCore_Windows_Oculus -WINPRJ = $(WINDOWS_PROJECT) -WINPLT = $(WINDOWS_PLATFORM) -WINCFG = $(WINDOWS_CONFIGURATION) - -# Assemble a package for a standard desktop build -_windows-package: windows-rebuild - @mkdir -p ${DIST_DIR} && cd ${DIST_DIR} && \ - rm -rf ${WIN_PACKAGE_NAME}.zip ${WIN_PACKAGE_NAME} \ - && mkdir ${WIN_PACKAGE_NAME} - @cd ${ROOT_DIR}/ballisticacore-windows/Build/$(WINCFG)_$(WINPLT) \ - && cp -r DLLs Lib data BallisticaCore$(WINPRJ).exe \ - VC_redist.*.exe *.dll ${DIST_DIR}/${WIN_PACKAGE_NAME} - @cd ${DIST_DIR} && zip -rq ${WIN_PACKAGE_NAME}.zip \ - ${WIN_PACKAGE_NAME} && rm -rf ${WIN_PACKAGE_NAME} - @echo SUCCESS! - created ${WIN_PACKAGE_NAME}.zip - -# Assemble a package containing server components. -_windows-server-package: windows-rebuild - @mkdir -p ${DIST_DIR} && cd ${DIST_DIR} && \ - rm -rf ${WIN_SERVER_PACKAGE_NAME}.zip ${WIN_SERVER_PACKAGE_NAME} \ - && mkdir ${WIN_SERVER_PACKAGE_NAME} - @cd ${ROOT_DIR}/ballisticacore-windows/Build/$(WINCFG)_$(WINPLT) \ - && mv BallisticaCore$(WINPRJ).exe bs_headless.exe \ - && cp -r DLLs Lib data bs_headless.exe \ - python.exe VC_redist.*.exe python37.dll \ - ${DIST_DIR}/${WIN_SERVER_PACKAGE_NAME}/ - @cd ${DIST_DIR}/${WIN_SERVER_PACKAGE_NAME} \ - && cp ${ROOT_DIR}/assets/src/server/server.py \ - ./ballisticacore_server.py \ - && cp ${ROOT_DIR}/assets/src/server/server.bat \ - ./launch_ballisticacore_server.bat \ - && cp ${ROOT_DIR}/assets/src/server/README.txt ./README.txt \ - && cp ${ROOT_DIR}/CHANGELOG.md ./CHANGELOG.txt \ - && cp ${ROOT_DIR}/assets/src/server/config.py ./config.py - @cd ${DIST_DIR}/${WIN_SERVER_PACKAGE_NAME} && unix2dos CHANGELOG.txt \ - README.txt config.py - @cd ${DIST_DIR} && zip -rq ${WIN_SERVER_PACKAGE_NAME}.zip \ - ${WIN_SERVER_PACKAGE_NAME} && rm -rf ${WIN_SERVER_PACKAGE_NAME} - @echo SUCCESS! - created ${WIN_SERVER_PACKAGE_NAME}.zip - -# Assemble a package for uploading to the oculus store. -_windows-oculus-package: windows-rebuild - @mkdir -p ${DIST_DIR} && cd ${DIST_DIR} && \ - rm -rf ${WIN_OCULUS_PACKAGE_NAME}.zip ${WIN_OCULUS_PACKAGE_NAME} \ - && mkdir ${WIN_OCULUS_PACKAGE_NAME} - @cd ${ROOT_DIR}/ballisticacore-windows/Build/$(WINCFG)_$(WINPLT)\ - && cp -r DLLs Lib data BallisticaCore$(WINPRJ).exe *.dll \ - ${DIST_DIR}/${WIN_OCULUS_PACKAGE_NAME} - @cd ${DIST_DIR} && zip -rq ${WIN_OCULUS_PACKAGE_NAME}.zip \ - ${WIN_OCULUS_PACKAGE_NAME} && rm -rf ${WIN_OCULUS_PACKAGE_NAME} - @echo SUCCESS! - created ${WIN_OCULUS_PACKAGE_NAME}.zip - -ANDROID_ADB = ${shell tools/android_sdk_utils get-adb-path} -ANDROID_FILTERED_LOGCAT = ${ANDROID_ADB} logcat -v color SDL:V \ - BallisticaCore:V VrLib:V VrApi:V VrApp:V TimeWarp:V EyeBuf:V GlUtils:V \ - DirectRender:V HmdInfo:V IabHelper:V CrashAnrDetector:V DEBUG:V *:S -AN_STRT = am start -a android.intent.action.MAIN -n -AN_BLD_OUT_DIR = ballisticacore-android/BallisticaCore/build/outputs -AN_BLDTP = $(ANDROID_BUILDTYPE) -AN_BLDTP_C = $(shell $(ROOT_DIR)/tools/snippets capitalize $(ANDROID_BUILDTYPE)) -AN_PLAT = $(ANDROID_PLATFORM) -AN_PLAT_C = $(shell $(ROOT_DIR)/tools/snippets capitalize $(ANDROID_PLATFORM)) -AN_MODE = $(ANDROID_MODE) -AN_MODE_C = $(shell $(ROOT_DIR)/tools/snippets capitalize $(ANDROID_MODE)) -AN_ASSEMBLE_CMD = ./gradlew assemble$(AN_PLAT_C)$(AN_MODE_C)$(AN_BLDTP_C) -AN_PLATFORM_DIR = ballisticacore-android/BallisticaCore/src/${ANDROID_PLATFORM} -# (public facing name; doesn't reflect build settings) -ANDROID_PACKAGE_NAME = BallisticaCore_Android_Generic_$(VERSION) - -AN_APK_DIR = ${AN_BLD_OUT_DIR}/apk/$(AN_PLAT)$(AN_MODE_C)/$(AN_BLDTP) -AN_APK = $(AN_APK_DIR)/BallisticaCore-$(AN_PLAT)-$(AN_MODE)-$(AN_BLDTP).apk -AN_BNDL_DIR = $(AN_BLD_OUT_DIR)/bundle/$(AN_PLAT)$(AN_MODE_C)$(AN_BLDTP_C) -AN_BNDL = $(AN_BNDL_DIR)/BallisticaCore-$(AN_PLAT)-$(AN_MODE)-$(AN_BLDTP).aab - -BA_ARCHIVE_ROOT ?= $(HOME)/build_archives -AN_ARCHIVE_ROOT = $(BA_ARCHIVE_ROOT)/ballisticacore/android -AN_ARCHIVE_DIR = $(AN_ARCHIVE_ROOT)/$(AN_PLAT)/$(VERSION)_$(BUILD_NUMBER) - -ARCH ?= $(shell uname -m) -ifeq ($(ARCH),x86_64) - ARCH_NAME?=64bit - ARCH_NAME_SHORT?=linux64 - ARCH_NAME_SERVER_SHORT?=linux64_server -else - ARCH_NAME?=32bit - ARCH_NAME_SHORT?=linux32 - ARCH_NAME_SERVER_SHORT?=linux32_server -endif - -# For our ssh/scp/rsh stuff we want to rely on public key auth -# and just fail if anything is off instead of prompting. -SSH_BATCH_ARGS = -oBatchMode=yes -oStrictHostKeyChecking=yes - -# Target run from within linux vm to build and run. -_linux: _linux-build - cd build/${ARCH_NAME_SHORT}/ballisticacore && \ - DISPLAY=:0 ./ballisticacore - -# Build only. -_linux-build: - @mkdir -p build/${ARCH_NAME_SHORT} && cd build/${ARCH_NAME_SHORT} \ - && test -f Makefile || cmake -DCMAKE_BUILD_TYPE=Debug \ - ${PWD}/ballisticacore-cmake - cd build/${ARCH_NAME_SHORT} && make -j${JOBS} - -# Target used from within linux vm to build a package. -# NOTE: building in place from linux over hgfs seems slightly flaky -# (for instance, have seen tar complain source changing under it -# when assembling a package).. so when possible we build on the local -# disk and then copy the results back over hgfs. -# We just need to make sure we only launch one build at a time per VM, -# but that should already be the case. -LINUX_BUILD_BASE = ~/ballisticacore_builds -LINUX_PACKAGE_BASE_NAME = BallisticaCore_Linux -LINUX_PACKAGE_NAME = ${LINUX_PACKAGE_BASE_NAME}_${ARCH_NAME}_${VERSION} -LINUX_BUILD_DIR = ${LINUX_BUILD_BASE}/${LINUX_PACKAGE_NAME}_build -LINUX_PACKAGE_DIR = build/${LINUX_PACKAGE_NAME} - -# Build for linux package (to be run under vm). -_linux-package-build: - @rm -rf ${DIST_DIR}/${LINUX_PACKAGE_NAME}.tar.gz ${LINUX_BUILD_DIR} \ - ${LINUX_PACKAGE_DIR} ${LINUX_PACKAGE_DIR}.tar.gz - @mkdir -p ${LINUX_BUILD_DIR} ${LINUX_PACKAGE_DIR} ${DIST_DIR} - @cd ${LINUX_BUILD_DIR} && cmake -DCMAKE_BUILD_TYPE=Release -DTEST_BUILD=true \ - ${ROOT_DIR}/ballisticacore-cmake && make -j${JOBS} - @cd ${LINUX_PACKAGE_DIR} && \ - cp ${LINUX_BUILD_DIR}/ballisticacore . - @rm -rf ${LINUX_BUILD_DIR} - -# Complete linux package (to be run on mac). -_linux-package-assemble: - @cd ${LINUX_PACKAGE_DIR} && ${STAGE_ASSETS} -cmake . - @cd build && tar -zcf ${LINUX_PACKAGE_NAME}.tar.gz ${LINUX_PACKAGE_NAME} - @rm -rf ${LINUX_PACKAGE_DIR} - @echo SUCCESS! - created ${LINUX_PACKAGE_NAME}.tar.gz - -# Build only. -_linux-server-build: - @mkdir -p build/${ARCH_NAME_SERVER_SHORT} \ - && cd build/${ARCH_NAME_SERVER_SHORT} \ - && test -f Makefile || cmake -DCMAKE_BUILD_TYPE=Debug -DHEADLESS=true \ - ${PWD}/ballisticacore-cmake - cd build/${ARCH_NAME_SERVER_SHORT} && make -j${JOBS} - -# Used from within linux vm to build a server package. -LINUX_SERVER_PACKAGE_BASE_NAME = BallisticaCore_Server_Linux -LINUX_SERVER_PACKAGE_NAME = \ - ${LINUX_SERVER_PACKAGE_BASE_NAME}_${ARCH_NAME}_${VERSION} -LINUX_SERVER_BUILD_DIR = ${LINUX_BUILD_BASE}/${LINUX_SERVER_PACKAGE_NAME}_build -LINUX_SERVER_PACKAGE_DIR = build/${LINUX_SERVER_PACKAGE_NAME} - -_linux-server-package-build: - @rm -rf ${DIST_DIR}/${LINUX_SERVER_PACKAGE_NAME}.tar.gz \ - ${LINUX_SERVER_BUILD_DIR} ${LINUX_SERVER_PACKAGE_DIR} \ - ${LINUX_SERVER_PACKAGE_DIR}.tar.gz - @mkdir -p ${LINUX_SERVER_BUILD_DIR} ${LINUX_SERVER_PACKAGE_DIR} ${DIST_DIR} - @cd ${LINUX_SERVER_BUILD_DIR} && cmake -DCMAKE_BUILD_TYPE=Release \ - -DHEADLESS=true ${ROOT_DIR}/ballisticacore-cmake && make -j${JOBS} - @cd ${LINUX_SERVER_PACKAGE_DIR} \ - && cp ${LINUX_SERVER_BUILD_DIR}/ballisticacore \ - ./bs_headless - @rm -rf ${LINUX_SERVER_BUILD_DIR} - -_linux-server-package-assemble: - @cd ${LINUX_SERVER_PACKAGE_DIR} \ - && cp ${ROOT_DIR}/assets/src/server/server.py \ - ./ballisticacore_server \ - && cp ${ROOT_DIR}/assets/src/server/README.txt ./README.txt \ - && cp ${ROOT_DIR}/assets/src/server/config.py ./config.py \ - && cp ${ROOT_DIR}/CHANGELOG.md ./CHANGELOG.txt \ - && ${STAGE_ASSETS} -cmake-server . - @cd ${LINUX_SERVER_PACKAGE_DIR}/.. && tar -zcf \ - ${LINUX_SERVER_PACKAGE_NAME}.tar.gz ${LINUX_SERVER_PACKAGE_NAME} - @rm -rf ${LINUX_SERVER_PACKAGE_DIR} - @echo SUCCESS! - created ${LINUX_SERVER_PACKAGE_NAME}.tar.gz - -# This target attempts to verify that we have a valid android sdk setup going -# and creates our local.properties file if need be so gradle builds will go -# through. -_android-sdk: - @tools/android_sdk_utils check - -# FIXME: needs updating to find unstripped libs for new cmake setup -_android-archive: android-build - make android-fullclean - tools/spinoff update - rm -rf $(AN_ARCHIVE_DIR) - mkdir -p $(AN_ARCHIVE_DIR) - mkdir -p $(AN_ARCHIVE_DIR)/unstripped_libs - make android-build - cp $(AN_APK) $(AN_ARCHIVE_DIR) - git log -n 5 > $(AN_ARCHIVE_DIR)/gitlog.txt - test -e submodules/ballistica && cd submodules/ballistica \ - && git log -n 5 > $(AN_ARCHIVE_DIR)/gitlogcore.txt || true - cp ballisticacore-android/BallisticaCore/build/outputs/\ -mapping/$(AN_PLAT)$(AN_MODE_C)/$(AN_BLDTP)/mapping.txt $(AN_ARCHIVE_DIR) - open $(AN_ARCHIVE_DIR) - -# FIXME: needs updating to find unstripped libs for new cmake setup -_android-bundle-archive: - make android-fullclean - tools/spinoff update - rm -rf $(AN_ARCHIVE_DIR) - mkdir -p $(AN_ARCHIVE_DIR) - mkdir -p $(AN_ARCHIVE_DIR)/unstripped_libs - make android-staging - cd ballisticacore-android\ - && ./gradlew bundle$(AN_PLAT_C)$(AN_MODE_C)$(AN_BLDTP_C) - cp $(AN_BNDL) $(AN_ARCHIVE_DIR) - git log -n 5 > $(AN_ARCHIVE_DIR)/gitlog.txt - test -e submodules/ballistica && cd submodules/ballistica \ - && git log -n 5 > $(AN_ARCHIVE_DIR)/gitlogcore.txt || true - cp ballisticacore-android/BallisticaCore/build/outputs/\ -mapping/$(AN_PLAT)$(AN_MODE_C)/$(AN_BLDTP)/mapping.txt $(AN_ARCHIVE_DIR) - open $(AN_ARCHIVE_DIR) - -_android-package: - make android-fullclean - tools/spinoff update - @rm -f ${DIST_DIR}/${ANDROID_PACKAGE_NAME}.apk - make android-build - @mkdir -p ${DIST_DIR} - @cp ballisticacore-android/BallisticaCore/build/outputs/\ -apk/$(AN_PLAT)$(AN_MODE_C)/$(AN_BLDTP)/\ -BallisticaCore-$(AN_PLAT)-$(AN_MODE)-$(AN_BLDTP).apk \ -${DIST_DIR}/${ANDROID_PACKAGE_NAME}.apk - @echo SUCCESS! - created ${ANDROID_PACKAGE_NAME}.apk - -# Efro specific: runs spinoff upgrade on a few local projects. -# (ideally should pull this out of here or abstract it ala syncall). -spinoff-upgrade-push-all: - @echo UPGRADING SPINOFF TEMPLATE - @cd ~/Documents/spinoff-template && make spinoff-upgrade-push - @echo UPGRADING BOMBSQUAD - @cd ~/Documents/bombsquad && make spinoff-upgrade-push - -# Generate and push our changelog to the staging server. -pushchangelog: - @echo GENERATING CHANGELOG HTML... - @mkdir -p ${DIST_DIR} - @./tools/gen_changelog - @echo UPLOADING CHANGELOG... - @scp ${SSH_BATCH_ARGS} ${DIST_DIR}/changelog.html \ - ${BLOG_SERVER}:blog_code/${DOCPREFIX}changelog.html\ - -# Generate docs. -docs: - @echo GENERATING DOCS HTML... - @mkdir -p ${DIST_DIR} - @./tools/gendocs.py - -# Generate and push docs to the staging server. -pushdocs: docs - @echo UPLOADING DOCS... - @scp ${SSH_BATCH_ARGS} ${DIST_DIR}/docs.html \ - ${BLOG_SERVER}:blog_code/${DOCPREFIX}docs.html # Some tool configs that need filtering (mainly injecting projroot path). TOOL_CFG_INST = tools/snippets tool_config_install @@ -652,10 +300,6 @@ TOOL_CFG_SRC = tools/efrotools/snippets.py config/config.json .clang-format: config/toolconfigsrc/clang-format ${TOOL_CFG_SRC} ${TOOL_CFG_INST} $< $@ -# When using CLion, our cmake dir is root. Expose .clang-format there too. -ballisticacore-cmake/.clang-format: .clang-format - cd ballisticacore-cmake && ln -sf ../.clang-format . - .style.yapf: config/toolconfigsrc/style.yapf ${TOOL_CFG_SRC} ${TOOL_CFG_INST} $< $@ @@ -671,77 +315,5 @@ ballisticacore-cmake/.clang-format: .clang-format .pycheckers: config/toolconfigsrc/pycheckers ${TOOL_CFG_SRC} ${TOOL_CFG_INST} $< $@ -# Irony in emacs requires us to use cmake to generate a full -# list of compile commands for all files; lets keep it up to date -# whenever CMakeLists changes. -.irony/compile_commands.json: ballisticacore-cmake/CMakeLists.txt - @echo Generating Irony compile-commands-list... - @mkdir -p .irony - @cd .irony \ - && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug \ - ../ballisticacore-cmake - @mv .irony/compile_commands.json . && rm -rf .irony && mkdir .irony \ - && mkdir .irony/ballisticacore .irony/make_bob .irony/ode \ - && mv compile_commands.json .irony - @echo Created $@ - -# Clear and build our assets to update cache timestamps. -# files, and then prune non-recent cache files which should pretty much limit -# it to the current set which we then package and upload as a 'starter-pack' -# for new builds to use (takes full asset builds from an hour down to a -# minute or so). -asset_cache_refresh: - @echo REFRESHING ASSET CACHE: ${ASSET_CACHE_NAME} - @echo REBUILDING ASSETS... - @make assets-clean && make assets - @test -d "${ASSET_CACHE_DIR}" && echo ARCHIVING ASSET CACHE FROM \ - ${ASSET_CACHE_DIR}... - @${ROOT_DIR}/tools/convert_util --prune-to-recent-assets - @mkdir -p ${DIST_DIR} - @cd ${ASSET_CACHE_DIR} && tar -zcf \ - ${DIST_DIR}/${ASSET_CACHE_NAME}.tar.gz * - @echo UPLOADING ASSET CACHE... - @scp ${SSH_BATCH_ARGS} ${DIST_DIR}/${ASSET_CACHE_NAME}.tar.gz \ - ${STAGING_SERVER}:files.ballistica.net/misc/\ -${ASSET_CACHE_NAME}.tar.gz.new - @ssh ${SSH_BATCH_ARGS} ${STAGING_SERVER} mv \ - files.ballistica.net/misc/${ASSET_CACHE_NAME}.tar.gz.new \ - files.ballistica.net/misc/${ASSET_CACHE_NAME}.tar.gz - @echo SUCCESSFULLY UPDATED ASSET CACHE: ${ASSET_CACHE_NAME} - -STAGING_SERVER ?= ubuntu@ballistica.net -STAGING_SERVER_BUILDS_DIR = files.ballistica.net/ballisticacore/builds -BLOG_SERVER ?= ecfroeml@froemling.net - -# Ensure we can sign in to staging server. -# Handy to do before starting lengthy operations instead of failing -# after wasting a bunch of time. -verify_staging_server_auth: - @echo -n Verifying staging server auth... - @ssh ${SSH_BATCH_ARGS} ${STAGING_SERVER} true - @echo ok. - -ARCHIVE_OLD_PUBLIC_BUILDS = \ - ${ROOT_DIR}/tools/snippets archive_old_builds ${STAGING_SERVER} \ - ${STAGING_SERVER_BUILDS_DIR} ${SSH_BATCH_ARGS} - -ALL_TEST_PACKAGE_FILES = \ - ${DIST_DIR}/${LINUX_PACKAGE_BASE_NAME}_64bit_${VERSION}.tar.gz \ - ${DIST_DIR}/${WIN_PACKAGE_NAME}.zip \ - ${DIST_DIR}/${MAC_PACKAGE_NAME}.zip \ - ${DIST_DIR}/${ANDROID_PACKAGE_NAME}.apk - -# Note: currently not including rpi until we figure out the py3.7 situation. -ALL_SERVER_PACKAGE_FILES = \ - ${DIST_DIR}/${LINUX_SERVER_PACKAGE_BASE_NAME}_64bit_${VERSION}.tar.gz \ - ${DIST_DIR}/${WIN_SERVER_PACKAGE_NAME}.zip \ - ${DIST_DIR}/${MAC_SERVER_PACKAGE_NAME}.zip \ - ${DIST_DIR}/${RPI_SERVER_PACKAGE_NAME}.tar.gz - # Tell make which of these targets don't represent files. -.PHONY: _windows-package _windows-server-package _windows-oculus-package \ - _linux _linux-build _linux-package-build _linux-package-assemble \ - _android-sdk _android-archive _android-bundle-archive _android-package \ - _linux-server-build _linux-server-package-build \ - _linux-server-package-assemble spinoff-upgrade-push-all pushchangelog \ - docs pushdocs asset_cache_refresh verify_staging_server_auth +.PHONY: diff --git a/ballisticacore-cmake/.idea/.gitignore b/ballisticacore-cmake/.idea/.gitignore deleted file mode 100644 index 0e40fe8f..00000000 --- a/ballisticacore-cmake/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ - -# Default ignored files -/workspace.xml \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/.name b/ballisticacore-cmake/.idea/.name deleted file mode 100644 index 5aa978d3..00000000 --- a/ballisticacore-cmake/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -BallisticaCore \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/ballisticacore-cmake.iml b/ballisticacore-cmake/.idea/ballisticacore-cmake.iml deleted file mode 100644 index f08604bb..00000000 --- a/ballisticacore-cmake/.idea/ballisticacore-cmake.iml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/codeStyles/Project.xml b/ballisticacore-cmake/.idea/codeStyles/Project.xml deleted file mode 100644 index 249efa28..00000000 --- a/ballisticacore-cmake/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/codeStyles/codeStyleConfig.xml b/ballisticacore-cmake/.idea/codeStyles/codeStyleConfig.xml deleted file mode 100644 index 79ee123c..00000000 --- a/ballisticacore-cmake/.idea/codeStyles/codeStyleConfig.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml deleted file mode 100644 index ab5debaa..00000000 --- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml +++ /dev/null @@ -1,807 +0,0 @@ - - - - NOMINMAX - aabb - abcdefghijklmnopqrstuvwxyz - accel - achs - acinstance - ack'ed - acked - acks - aclass - aclass's - addrs - adjoint - adreno - affx - affy - affz - aftx - afty - aftz - aint - airborn - alext - alibaba - allocs - alot - alphaimg - alphapixels - alsa - alsoft - animcurve - aniso - apientry - appconfig - asci - athome - attrobj - automagically - autoselect - avel - avels - axismotion - backgrounded - backgrounding - backtraces - ballistica - ballisticacore - barebones - basetype - basicsize - bastd - bbbb - bbbbb - bbbbbb - bbbbbbb - bcfn - bezanson - bgra - bigendian - bilinear - binpow - bitcount - bitdepth - bitlength - bitmask - bitpos - bitval - blitters - blitting - blockadr - blockheight - blockwidth - bluetooth - blurscale - bodyid - bodypart - bodyptr - bookmarkable - bools - boolval - boostrapping - bootstrappy - bouyancy - bppv - bresult - bridgit - broadcom - bsac - bscfg - bsgaps - bsgdps - bsivu - bsmhi - bsstd - bsuuid - bufs - buildconfig - buildnumber - buttondown - buttonmouse - buttonup - buttonwidget - bwst - calced - calcs - caled - callargs - callbackobj - camalign - camelback - camerashake - capitan - cargs - ccontext - centiseconds - cfgdir - changeme - charn - charnum - charstr - checkboxwidget - chrono - cjief - classdict - clientinfo - cmath - cmds - cmdvals - codewarrior - codewarrior's - cofnodes - collapseable - collidable - columnwidget - connectattr - containerwidget - controlfp - cooldown - coreaudio - coulda - cout - cpel - cpplint - cptr - cpuid - crom - crosswire - crvel - cspr - cstdint - cstdlib - cstring - ctargetref - cubemap - curtime - cutef - cvar - data - datadata - dataout - datas - datav - datavec - dbias - dcol - ddcaps - ddpf - ddpixelformat - ddscaps - ddsd - ddsx - deallocated - deallocation - deek - deinit - demangle - demangled - demangling - denom - dernit - dets - dfff - dfmt - diffbit - dirslash - dlfcn - dlife - dname - dncm - dobell - doraise - dosomething - dout - downsample - dpad - dpads - drpt - dsize - dsound - dstattr - dstnode - dstr - dtest - dummyvalid - dxgi - dynamicdata - echidna - edef - elems - elevenbase - elevenbits - emitfx - emojis - endcall - endl - endline - endtime - entrypoint - ericf - ericsson - erroring - etcdec - etcpack - evals - ewww - ewwww - ewwwww - execinfo - expbool - expl - extrahash - extrascale - exts - facepts - farval - fbos - fdata - fdirx - fdiry - fdirz - fenv - fesetround - ffff - ffffff - fffffff - fffffffffifff - fgets - fifteenbits - fjco - fjcoiwef - flipbit - flopsy - fname - fnode - fnumc - fopen - fourcc - fovs - fovx - fovy - framebuffers - framedef - frameldefs - framerates - fread - freeform - freeifaddrs - freqs - froemling - frompos - frontmost - ftos - ftou - funcname - fval - fvals - gamecenter - gamedata - gamepacket - gamepackets - gameplay - gapless - gasmsg - gbus - gcc's - gearvr - getactivity - getattro - getattrofunc - getbasetime - getbit - getbits - getbitshigh - getcollidemodel - getdata - getifaddrs - getline - getmodel - getnodes - getnodetype - getsession - getsound - gettexture - gettotalrefcount - gles - glext - gpgs - gqualstr - grav - gstate - gthm - guiddef - gusl - gvrrts - hacky - haha - halign - handlemessage - hatmotion - havn't - havnt - healthcare - hexval - highp - highquality - hitchy - hmmm - hostcmd - hostinfo - hotkeys - hotplug - hscrollwidget - htonf - htonl - htons - ibuf - icloud - iconscale - ieeefp - ifaddr - ifaddrs - ifdebug - iiiiisss - ilock - imagewidget - incentivized - inet - initguid - inittab - intercollide - internalformat - interuptions - invote - iserverget - iserverput - isn' - isutf - itemsize - itsclass - itunes - ival - ivals - ized - jacobian - janktastic - janky - jaxis - jcjwf - jmessage - keepalives - keycode - keysyms - keywds - khronos - kickable - kickee - killable - killcount - kmod - kronk - kwds - kxyz - lantinga - largeish - lasti - lastline - leaderboard - leaderboards - lgui - lhalf - libutf - lightshad - linearsize - listobj - llock - logpath - logput - lorient - lowp - lpos - lpsockaddr - lrintf - lscope - lstr - lsync - lvec - lvoid - macos - magoogan - magua - mainmenu - mallocs - maskhigh - maskuv - maximus - maxwidth - mediump - memalign - memchr - memcpy - meshdata - meth - mikirog - millisecs - minelem - minsdl - mipmapcount - mipmaps - mmdevapi - modder - modelview - moduletype - momemtary - msaa - mult - multing - multipass - multisample - mutli - mybuf - mycallback - mynode - mywidget - ndebug - nearval - needwindow - negativex - negativey - negativez - nemanja - ness - netclient - netplay - newchild - newimg - newitem - newnode - nextchar - nitpicky - nlpos - nmemb - nodetype - nominmax - noninfringement - nonlint - noone - nothin - nptr - nsize - ntoa - ntohl - numargs - numc - numentries - nvidia - nyffenegger - objexists - objid - obvs - oculus - oiffsss - oooo - ooooooo - ooooooooo - oooooooooooo - ooooooooooooo - ooooooooooooooo - oooooooooooooooooo - ooooooooooooooooooooooooooooooo - ooooooooooooooooooooooooooooooooooo - ooooooooooooooooooooooooooooooooooooo - openal - opengl - opensl - opmode - ortho - osis - osssssssssss - ostype - ourself - ourstanding - ouya - parameteriv - passcode - pausable - pdst - persp - pflag - pflags - pgmout - pixelformat - playpause - playsound - plen - pname - podcast - podcasts - portaudio - positivex - positivey - positivez - powerup - precalc - predeclare - prefs - preloaded - preloads - premult - printf - printnodes - printobjects - priv - profilers - prog - proj - prolly - psmx - pspec - psps - psrc - pton - ptrs - ptype - pulseaudio - punchmomentumlinear - punchthrough - pushcall - putbits - putbitshigh - pval - pvrtc - pycommand - pyconfig - pycontext - pyhome - pylib - pyobj - pyobjs - qerr - qrcode - qrel - qual - qualcomm - radiusm - raii - rasterizer - reaaaly - readset - realloc - reallocations - realtimers - recalc - recvfrom - redundants - refcounted - refl - rehel - rendererdata - renormalize - rené - reprfunc - resends - resync - retval - rezing - rgui - richcompare - rigth - rootwidget - rowwidget - rresult - rsgc - runnables - rvec - rvel - safecolor - scenetime - screenmessage - scrollwidget - sdl's - sdlk - seqlen - serv - serverget - serverput - sessiondata - sessionglobals - sessiontype - setattro - setattrofunc - setschedparam - sgis - sharedobj - shifthigh - shouldnt - shufflable - signsubscale - simd - sisssssssss - sixteenbits - smoothering - smoothstep - sndio - snorm - sockaddr - soffs - solaris - spaz - spead - sphrand - srcattr - srcsz - sresult - sscanf - ssize - sssi - sssisisis - sssissss - ssss - sssss - sssssi - sssssss - sssssssd - sssssssi - ssssssssssss - standin - startpos - starttime - startx - starty - staticdata - stdint - stephane - stepnum - stepsize - strcasecmp - strchr - strcpy - strdup - stringi - strlen - strtof - subclsssing - subentities - subitems - subplatform - subscale - sval - symbolification - syscalls - talloc - tegra - telefonaktiebolaget - teleported - teleporting - tempvec - texel - texqualstr - textcolor - textwidget - thang - thecommand - theres - threadname - threadtype - tiltage - timedisplay - timeformat - timerlist - timestep - timetype - timetypes - tmpmat - tomer - topos - touchpad - toucs - toutf - trackpad - trackpads - tradeoff - trailcolor - transobj - treturn - trifunovic - trilinear - trimesh - trimeshes - tval - tvos - tweakage - twotimer - twst - typeobj - typestr - uber - uibounds - uiid - uncas - unchecking - underrun - unformatted - unichar - unichars - uninited - unmanaged - unpaused - unplayed - unpremultiply - unsignaled - unstuff - unsynchronized - userspace - uther - uuids - uxxxx - uxxxxxxxx - valign - valobj - vals - valtab - valuedouble - valueint - valuestring - varyings - vbos - vbuf - vdynamic - verts - vidia - vmag - vorbis - vparallel - vprintf - vsync - vsyncing - vtable - vtangential - vulkan - waaah - wack - wakeups - walisser - wasdebug - watte - wdeprecated - weakref - welp - whaaaaaaa - wheee - wheeee - wiimote - wiimotes - windowshade - winmm - winsock - wofocj - wonkiness - worldspace - wunused - xclamped - xdiff - xdist - xinput - xmax - xmin - xmmintrin - xoffset - yclamped - ydiff - ydist - ymax - ymin - yoffs - yooooooo - zmax - zmin - zoffset - zomg - zoomable - zrot - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/inspectionProfiles/Project_Default.xml b/ballisticacore-cmake/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 3f259067..00000000 --- a/ballisticacore-cmake/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/misc.xml b/ballisticacore-cmake/.idea/misc.xml deleted file mode 100644 index acadce39..00000000 --- a/ballisticacore-cmake/.idea/misc.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/modules.xml b/ballisticacore-cmake/.idea/modules.xml deleted file mode 100644 index 5fb34ea8..00000000 --- a/ballisticacore-cmake/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/.idea/vcs.xml b/ballisticacore-cmake/.idea/vcs.xml deleted file mode 100644 index 6c0b8635..00000000 --- a/ballisticacore-cmake/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ballisticacore-cmake/CMakeLists.txt b/ballisticacore-cmake/CMakeLists.txt deleted file mode 100644 index fc1dd9f2..00000000 --- a/ballisticacore-cmake/CMakeLists.txt +++ /dev/null @@ -1,743 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(BallisticaCore) -include(CheckIncludeFile) -option(HEADLESS "build headless server" OFF) -option(TEST_BUILD "include testing features" OFF) - -# Requiring minimum of C++14 currently. -set(CMAKE_CXX_STANDARD 14) - -# Currently we need to nudge cmake a bit to get it to find homebrew python; -# Sounds like this is a known issue at the moment. -if (APPLE) - # NOTE: after installing mojave, cmake stopped building against homebrew - # stuff correctly (/usr/local/*). Xcode 10 release notes mention /usr/include - # is no longer filled in by the dev tools and perhaps this is related. - # see https://developer.apple.com/documentation - # /xcode_release_notes/xcode_10_release_notes - # anyway, forcing the issue for now; can keep an eye on developments.. - include_directories("/usr/local/include") - link_directories("/usr/local/lib") - - execute_process(COMMAND "python3-config" "--prefix" - OUTPUT_VARIABLE PYPREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE) - # running into an oddity where python-libs linking reverts back - # to our system default after a while - trying cache-internal here to fix - set(PYTHON_LIBRARY "${PYPREFIX}/lib/libpython3.7m.dylib" CACHE INTERNAL "") - set(PYTHON_INCLUDE_DIR "${PYPREFIX}/include/python3.7m" CACHE INTERNAL "") -endif () -# NOTE: we technically require 3.7 at this point, but leaving this -# at 3.5 in order to keep build pipeline functioning on things -# like raspberry pi even though the game won't function there until -# 3.7 comes down the pipe. -find_package(PythonLibs 3.5 REQUIRED) - -if (NOT HEADLESS) - find_package(SDL2 QUIET) - if (SDL2_FOUND) - # getting complaint about space at the end of this on ubuntu16 - string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) - else () - # some cmake systems don't have the SDL2 module; lets - # fall back to quasi-manual search if so.. - # (enough to cover ubuntu 14 and raspbian) - message(STATUS "No SDL2 module present; searching manually") - find_library(SDL2_LIBRARIES SDL2) - if (NOT SDL2_LIBRARIES) - message(FATAL_ERROR "SDL2 library not found") - endif () - set(SDL2_INCLUDE_DIRS "/usr/include/SDL2") - endif () - find_package(OpenGL REQUIRED) - find_package(OpenAL REQUIRED) - if (APPLE) - # on mac this sets an include path that we don't need since - # we're using the system framework... clean it up - set(OPENAL_INCLUDE_DIR "") - endif () - find_library(OGG_LIBRARY ogg) - find_library(VORBISFILE_LIBRARY vorbisfile) - if (NOT OGG_LIBRARY) - message(FATAL_ERROR "ogg library not found") - endif () - if (NOT VORBISFILE_LIBRARY) - message(FATAL_ERROR "vorbisfile library not found") - endif () - set(EXTRA_INCLUDE_DIRS ${OPENGL_INCLUDE_DIRS} - ${OPENAL_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS}) - set(EXTRA_LIBRARIES ogg vorbisfile ${OPENGL_LIBRARIES} ${OPENAL_LIBRARY}) -else () - add_definitions(-DBA_HEADLESS_BUILD=1) -endif () - -if (TEST_BUILD) - add_definitions(-DBA_TEST_BUILD=1) -endif () - -# Currently seeing warnings about parateter order changing in GCC 7.1 -# on Raspberry Pi builds. We never need to care about C++ abi compatability -# so silencing them. Can maybe remove this later if they stop. -if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wno-psabi") -endif() - -# message("GOT LIBS ${PYTHON_LIBRARIES}") -# message("GOT INC DIRS ${PYTHON_INCLUDE_DIRS}") -# message("GOT SDL INC ${SDL2_INCLUDE_DIRS}") -# message(FATAL_ERROR "SO FAR SO GOOD") - -# get_filename_component(BA_SRC_ROOT ../src ABSOLUTE ) -# include_directories("src") -set(BA_SRC_ROOT src) -include_directories(${BA_SRC_ROOT}) -add_compile_options(-include ballistica/config/config_cmake.h) - -if (CMAKE_BUILD_TYPE MATCHES Debug) - add_definitions(-DBA_DEBUG_BUILD=1) -endif () - -set(ODE_SRC_ROOT ${BA_SRC_ROOT}/external/open_dynamics_engine-ef) - -add_library(ode - ${ODE_SRC_ROOT}/ode/IceAABB.cpp - ${ODE_SRC_ROOT}/ode/IceContainer.cpp - ${ODE_SRC_ROOT}/ode/IceHPoint.cpp - ${ODE_SRC_ROOT}/ode/IceIndexedTriangle.cpp - ${ODE_SRC_ROOT}/ode/IceMatrix3x3.cpp - ${ODE_SRC_ROOT}/ode/IceMatrix4x4.cpp - ${ODE_SRC_ROOT}/ode/IceOBB.cpp - ${ODE_SRC_ROOT}/ode/IcePlane.cpp - ${ODE_SRC_ROOT}/ode/IcePoint.cpp - ${ODE_SRC_ROOT}/ode/IceRandom.cpp - ${ODE_SRC_ROOT}/ode/IceRay.cpp - ${ODE_SRC_ROOT}/ode/IceRevisitedRadix.cpp - ${ODE_SRC_ROOT}/ode/IceSegment.cpp - ${ODE_SRC_ROOT}/ode/IceTriangle.cpp - ${ODE_SRC_ROOT}/ode/IceUtils.cpp - ${ODE_SRC_ROOT}/ode/ode.cpp - ${ODE_SRC_ROOT}/ode/ode_array.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_cylinder_box.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_cylinder_plane.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_cylinder_sphere.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_cylinder_trimesh.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_kernel.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_quadtreespace.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_sapspace.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_space.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_std.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_transform.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_box.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_ccylinder.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_distance.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_plane.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_ray.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_sphere.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_trimesh_trimesh.cpp - ${ODE_SRC_ROOT}/ode/ode_collision_util.cpp - ${ODE_SRC_ROOT}/ode/ode_error.cpp - ${ODE_SRC_ROOT}/ode/ode_export-diff.cpp - ${ODE_SRC_ROOT}/ode/ode_fastdot.cpp - ${ODE_SRC_ROOT}/ode/ode_fastldlt.cpp - ${ODE_SRC_ROOT}/ode/ode_fastlsolve.cpp - ${ODE_SRC_ROOT}/ode/ode_fastltsolve.cpp - ${ODE_SRC_ROOT}/ode/ode_joint.cpp - ${ODE_SRC_ROOT}/ode/ode_lcp.cpp - ${ODE_SRC_ROOT}/ode/ode_mass.cpp - ${ODE_SRC_ROOT}/ode/ode_mat.cpp - ${ODE_SRC_ROOT}/ode/ode_math.cpp - ${ODE_SRC_ROOT}/ode/ode_matrix.cpp - ${ODE_SRC_ROOT}/ode/ode_memory.cpp - ${ODE_SRC_ROOT}/ode/ode_misc.cpp - ${ODE_SRC_ROOT}/ode/ode_obstack.cpp - ${ODE_SRC_ROOT}/ode/ode_quickstep.cpp - ${ODE_SRC_ROOT}/ode/ode_rotation.cpp - ${ODE_SRC_ROOT}/ode/ode_step.cpp - ${ODE_SRC_ROOT}/ode/ode_stepfast.cpp - ${ODE_SRC_ROOT}/ode/ode_timer.cpp - ${ODE_SRC_ROOT}/ode/ode_util.cpp - ${ODE_SRC_ROOT}/ode/OPC_AABBCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_AABBTree.cpp - ${ODE_SRC_ROOT}/ode/OPC_BaseModel.cpp - ${ODE_SRC_ROOT}/ode/OPC_BoxPruning.cpp - ${ODE_SRC_ROOT}/ode/OPC_Collider.cpp - ${ODE_SRC_ROOT}/ode/OPC_HybridModel.cpp - ${ODE_SRC_ROOT}/ode/OPC_LSSCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_MeshInterface.cpp - ${ODE_SRC_ROOT}/ode/OPC_Model.cpp - ${ODE_SRC_ROOT}/ode/OPC_OBBCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_OptimizedTree.cpp - ${ODE_SRC_ROOT}/ode/OPC_PlanesCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_RayCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_SphereCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_SweepAndPrune.cpp - ${ODE_SRC_ROOT}/ode/OPC_TreeBuilders.cpp - ${ODE_SRC_ROOT}/ode/OPC_TreeCollider.cpp - ${ODE_SRC_ROOT}/ode/OPC_VolumeCollider.cpp - ${ODE_SRC_ROOT}/ode/Opcode.cpp - ) -target_include_directories(ode PRIVATE ${ODE_SRC_ROOT}) - -# EWWW; GCC gives us bad mesh collisions with -O3 (and maybe -O2) -# need to finally get to the bottom of this but limiting to -01 for now. -# (-O2 might be safe??... or what about -Os? Should test again.) -if (CMAKE_BUILD_TYPE MATCHES Release) - target_compile_options(ode PRIVATE -O1) -endif () - - -# MakeBob binary. - -add_executable(make_bob - ${BA_SRC_ROOT}/tools/make_bob/make_bob.cc - ${BA_SRC_ROOT}/ballistica/core/exception.cc - ${BA_SRC_ROOT}/tools/make_bob/tri_optimization/ls_vcache_opt.cc - ) -target_include_directories(make_bob PRIVATE - ${BA_SRC_ROOT}/tools/make_bob - ${BA_SRC_ROOT}/external/open_dynamics_engine-ef) - - -# BallisticaCore binary. - -add_executable(ballisticacore - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/bitstream.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/mask.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/mmask.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/mqrspec.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/qrencode.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/qrinput.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/qrspec.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/rscode.c - ${BA_SRC_ROOT}/external/qrencode-3.4.4/qrencode/split.c - #AUTOGENERATED_BEGIN (this section is managed by the "update_project" tool) - ${BA_SRC_ROOT}/ballistica/app/app.cc - ${BA_SRC_ROOT}/ballistica/app/app.h - ${BA_SRC_ROOT}/ballistica/app/app_config.cc - ${BA_SRC_ROOT}/ballistica/app/app_config.h - ${BA_SRC_ROOT}/ballistica/app/app_globals.cc - ${BA_SRC_ROOT}/ballistica/app/app_globals.h - ${BA_SRC_ROOT}/ballistica/app/headless_app.cc - ${BA_SRC_ROOT}/ballistica/app/headless_app.h - ${BA_SRC_ROOT}/ballistica/app/stress_test.cc - ${BA_SRC_ROOT}/ballistica/app/stress_test.h - ${BA_SRC_ROOT}/ballistica/audio/al_sys.cc - ${BA_SRC_ROOT}/ballistica/audio/al_sys.h - ${BA_SRC_ROOT}/ballistica/audio/audio.cc - ${BA_SRC_ROOT}/ballistica/audio/audio.h - ${BA_SRC_ROOT}/ballistica/audio/audio_server.cc - ${BA_SRC_ROOT}/ballistica/audio/audio_server.h - ${BA_SRC_ROOT}/ballistica/audio/audio_source.cc - ${BA_SRC_ROOT}/ballistica/audio/audio_source.h - ${BA_SRC_ROOT}/ballistica/audio/audio_streamer.cc - ${BA_SRC_ROOT}/ballistica/audio/audio_streamer.h - ${BA_SRC_ROOT}/ballistica/audio/ogg_stream.cc - ${BA_SRC_ROOT}/ballistica/audio/ogg_stream.h - ${BA_SRC_ROOT}/ballistica/ballistica.cc - ${BA_SRC_ROOT}/ballistica/ballistica.h - ${BA_SRC_ROOT}/ballistica/config/config_android_amazon.h - ${BA_SRC_ROOT}/ballistica/config/config_android_cardboard.h - ${BA_SRC_ROOT}/ballistica/config/config_android_common.h - ${BA_SRC_ROOT}/ballistica/config/config_android_demo.h - ${BA_SRC_ROOT}/ballistica/config/config_android_generic.h - ${BA_SRC_ROOT}/ballistica/config/config_android_google.h - ${BA_SRC_ROOT}/ballistica/config/config_android_oculus.h - ${BA_SRC_ROOT}/ballistica/config/config_android_template.h - ${BA_SRC_ROOT}/ballistica/config/config_cmake.h - ${BA_SRC_ROOT}/ballistica/config/config_common.h - ${BA_SRC_ROOT}/ballistica/config/config_windows_common.h - ${BA_SRC_ROOT}/ballistica/config/config_windows_generic.h - ${BA_SRC_ROOT}/ballistica/config/config_windows_headless.h - ${BA_SRC_ROOT}/ballistica/config/config_windows_oculus.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_common.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_ios.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_ios_legacy.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_mac.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_mac_headless_legacy.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_mac_legacy.h - ${BA_SRC_ROOT}/ballistica/config/config_xcode_tvos.h - ${BA_SRC_ROOT}/ballistica/core/context.cc - ${BA_SRC_ROOT}/ballistica/core/context.h - ${BA_SRC_ROOT}/ballistica/core/exception.cc - ${BA_SRC_ROOT}/ballistica/core/exception.h - ${BA_SRC_ROOT}/ballistica/core/inline.cc - ${BA_SRC_ROOT}/ballistica/core/inline.h - ${BA_SRC_ROOT}/ballistica/core/logging.cc - ${BA_SRC_ROOT}/ballistica/core/logging.h - ${BA_SRC_ROOT}/ballistica/core/macros.cc - ${BA_SRC_ROOT}/ballistica/core/macros.h - ${BA_SRC_ROOT}/ballistica/core/module.cc - ${BA_SRC_ROOT}/ballistica/core/module.h - ${BA_SRC_ROOT}/ballistica/core/object.cc - ${BA_SRC_ROOT}/ballistica/core/object.h - ${BA_SRC_ROOT}/ballistica/core/thread.cc - ${BA_SRC_ROOT}/ballistica/core/thread.h - ${BA_SRC_ROOT}/ballistica/core/types.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_draw_snapshot.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_fuse.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_fuse.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_fuse_data.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_height_cache.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_height_cache.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_server.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_server.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_shadow.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_shadow.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_shadow_data.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_volume_light.cc - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_volume_light.h - ${BA_SRC_ROOT}/ballistica/dynamics/bg/bg_dynamics_volume_light_data.h - ${BA_SRC_ROOT}/ballistica/dynamics/collision.h - ${BA_SRC_ROOT}/ballistica/dynamics/collision_cache.cc - ${BA_SRC_ROOT}/ballistica/dynamics/collision_cache.h - ${BA_SRC_ROOT}/ballistica/dynamics/dynamics.cc - ${BA_SRC_ROOT}/ballistica/dynamics/dynamics.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/impact_sound_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/impact_sound_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/material.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/material.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_component.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_component.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_condition_node.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_condition_node.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_context.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/material_context.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_message_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_message_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_mod_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_mod_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_user_message_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/node_user_message_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/part_mod_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/part_mod_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/python_call_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/python_call_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/roll_sound_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/roll_sound_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/skid_sound_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/skid_sound_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/material/sound_material_action.cc - ${BA_SRC_ROOT}/ballistica/dynamics/material/sound_material_action.h - ${BA_SRC_ROOT}/ballistica/dynamics/part.cc - ${BA_SRC_ROOT}/ballistica/dynamics/part.h - ${BA_SRC_ROOT}/ballistica/dynamics/rigid_body.cc - ${BA_SRC_ROOT}/ballistica/dynamics/rigid_body.h - ${BA_SRC_ROOT}/ballistica/game/account.cc - ${BA_SRC_ROOT}/ballistica/game/account.h - ${BA_SRC_ROOT}/ballistica/game/client_controller_interface.h - ${BA_SRC_ROOT}/ballistica/game/connection/connection.cc - ${BA_SRC_ROOT}/ballistica/game/connection/connection.h - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_client.cc - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_client.h - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_client_udp.cc - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_client_udp.h - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_host.cc - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_host.h - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_host_udp.cc - ${BA_SRC_ROOT}/ballistica/game/connection/connection_to_host_udp.h - ${BA_SRC_ROOT}/ballistica/game/friend_score_set.h - ${BA_SRC_ROOT}/ballistica/game/game.cc - ${BA_SRC_ROOT}/ballistica/game/game.h - ${BA_SRC_ROOT}/ballistica/game/game_stream.cc - ${BA_SRC_ROOT}/ballistica/game/game_stream.h - ${BA_SRC_ROOT}/ballistica/game/host_activity.cc - ${BA_SRC_ROOT}/ballistica/game/host_activity.h - ${BA_SRC_ROOT}/ballistica/game/player.cc - ${BA_SRC_ROOT}/ballistica/game/player.h - ${BA_SRC_ROOT}/ballistica/game/player_spec.cc - ${BA_SRC_ROOT}/ballistica/game/player_spec.h - ${BA_SRC_ROOT}/ballistica/game/score_to_beat.h - ${BA_SRC_ROOT}/ballistica/game/session/client_session.cc - ${BA_SRC_ROOT}/ballistica/game/session/client_session.h - ${BA_SRC_ROOT}/ballistica/game/session/host_session.cc - ${BA_SRC_ROOT}/ballistica/game/session/host_session.h - ${BA_SRC_ROOT}/ballistica/game/session/net_client_session.cc - ${BA_SRC_ROOT}/ballistica/game/session/net_client_session.h - ${BA_SRC_ROOT}/ballistica/game/session/replay_client_session.cc - ${BA_SRC_ROOT}/ballistica/game/session/replay_client_session.h - ${BA_SRC_ROOT}/ballistica/game/session/session.cc - ${BA_SRC_ROOT}/ballistica/game/session/session.h - ${BA_SRC_ROOT}/ballistica/generic/base64.cc - ${BA_SRC_ROOT}/ballistica/generic/base64.h - ${BA_SRC_ROOT}/ballistica/generic/buffer.h - ${BA_SRC_ROOT}/ballistica/generic/huffman.cc - ${BA_SRC_ROOT}/ballistica/generic/huffman.h - ${BA_SRC_ROOT}/ballistica/generic/json.cc - ${BA_SRC_ROOT}/ballistica/generic/json.h - ${BA_SRC_ROOT}/ballistica/generic/lambda_runnable.h - ${BA_SRC_ROOT}/ballistica/generic/real_timer.h - ${BA_SRC_ROOT}/ballistica/generic/runnable.cc - ${BA_SRC_ROOT}/ballistica/generic/runnable.h - ${BA_SRC_ROOT}/ballistica/generic/timer.cc - ${BA_SRC_ROOT}/ballistica/generic/timer.h - ${BA_SRC_ROOT}/ballistica/generic/timer_list.cc - ${BA_SRC_ROOT}/ballistica/generic/timer_list.h - ${BA_SRC_ROOT}/ballistica/generic/utf8.cc - ${BA_SRC_ROOT}/ballistica/generic/utf8.h - ${BA_SRC_ROOT}/ballistica/generic/utils.cc - ${BA_SRC_ROOT}/ballistica/generic/utils.h - ${BA_SRC_ROOT}/ballistica/graphics/area_of_interest.cc - ${BA_SRC_ROOT}/ballistica/graphics/area_of_interest.h - ${BA_SRC_ROOT}/ballistica/graphics/camera.cc - ${BA_SRC_ROOT}/ballistica/graphics/camera.h - ${BA_SRC_ROOT}/ballistica/graphics/component/empty_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/object_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/object_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/post_process_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/post_process_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/render_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/render_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/shield_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/shield_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/simple_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/simple_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/smoke_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/smoke_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/special_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/special_component.h - ${BA_SRC_ROOT}/ballistica/graphics/component/sprite_component.cc - ${BA_SRC_ROOT}/ballistica/graphics/component/sprite_component.h - ${BA_SRC_ROOT}/ballistica/graphics/frame_def.cc - ${BA_SRC_ROOT}/ballistica/graphics/frame_def.h - ${BA_SRC_ROOT}/ballistica/graphics/framebuffer.h - ${BA_SRC_ROOT}/ballistica/graphics/gl/gl_sys.cc - ${BA_SRC_ROOT}/ballistica/graphics/gl/gl_sys.h - ${BA_SRC_ROOT}/ballistica/graphics/gl/renderer_gl.cc - ${BA_SRC_ROOT}/ballistica/graphics/gl/renderer_gl.h - ${BA_SRC_ROOT}/ballistica/graphics/graphics.cc - ${BA_SRC_ROOT}/ballistica/graphics/graphics.h - ${BA_SRC_ROOT}/ballistica/graphics/graphics_server.cc - ${BA_SRC_ROOT}/ballistica/graphics/graphics_server.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/image_mesh.cc - ${BA_SRC_ROOT}/ballistica/graphics/mesh/image_mesh.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_buffer.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_buffer_base.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_buffer_vertex_simple_full.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_buffer_vertex_smoke_full.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_buffer_vertex_sprite.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_data.cc - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_data.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_data_client_handle.cc - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_data_client_handle.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_index_buffer_16.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_index_buffer_32.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_base.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_dual_texture_full.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_object_split.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_simple_full.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_simple_split.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_smoke_full.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_indexed_static_dynamic.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_non_indexed.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/mesh_renderer_data.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/sprite_mesh.h - ${BA_SRC_ROOT}/ballistica/graphics/mesh/text_mesh.cc - ${BA_SRC_ROOT}/ballistica/graphics/mesh/text_mesh.h - ${BA_SRC_ROOT}/ballistica/graphics/net_graph.cc - ${BA_SRC_ROOT}/ballistica/graphics/net_graph.h - ${BA_SRC_ROOT}/ballistica/graphics/render_command_buffer.h - ${BA_SRC_ROOT}/ballistica/graphics/render_pass.cc - ${BA_SRC_ROOT}/ballistica/graphics/render_pass.h - ${BA_SRC_ROOT}/ballistica/graphics/render_target.cc - ${BA_SRC_ROOT}/ballistica/graphics/render_target.h - ${BA_SRC_ROOT}/ballistica/graphics/renderer.cc - ${BA_SRC_ROOT}/ballistica/graphics/renderer.h - ${BA_SRC_ROOT}/ballistica/graphics/text/font_page_map_data.h - ${BA_SRC_ROOT}/ballistica/graphics/text/text_graphics.cc - ${BA_SRC_ROOT}/ballistica/graphics/text/text_graphics.h - ${BA_SRC_ROOT}/ballistica/graphics/text/text_group.cc - ${BA_SRC_ROOT}/ballistica/graphics/text/text_group.h - ${BA_SRC_ROOT}/ballistica/graphics/text/text_packer.cc - ${BA_SRC_ROOT}/ballistica/graphics/text/text_packer.h - ${BA_SRC_ROOT}/ballistica/graphics/texture/dds.cc - ${BA_SRC_ROOT}/ballistica/graphics/texture/dds.h - ${BA_SRC_ROOT}/ballistica/graphics/texture/ktx.cc - ${BA_SRC_ROOT}/ballistica/graphics/texture/ktx.h - ${BA_SRC_ROOT}/ballistica/graphics/texture/pvr.cc - ${BA_SRC_ROOT}/ballistica/graphics/texture/pvr.h - ${BA_SRC_ROOT}/ballistica/input/device/client_input_device.cc - ${BA_SRC_ROOT}/ballistica/input/device/client_input_device.h - ${BA_SRC_ROOT}/ballistica/input/device/input_device.cc - ${BA_SRC_ROOT}/ballistica/input/device/input_device.h - ${BA_SRC_ROOT}/ballistica/input/device/joystick.cc - ${BA_SRC_ROOT}/ballistica/input/device/joystick.h - ${BA_SRC_ROOT}/ballistica/input/device/keyboard_input.cc - ${BA_SRC_ROOT}/ballistica/input/device/keyboard_input.h - ${BA_SRC_ROOT}/ballistica/input/device/test_input.cc - ${BA_SRC_ROOT}/ballistica/input/device/test_input.h - ${BA_SRC_ROOT}/ballistica/input/device/touch_input.cc - ${BA_SRC_ROOT}/ballistica/input/device/touch_input.h - ${BA_SRC_ROOT}/ballistica/input/input.cc - ${BA_SRC_ROOT}/ballistica/input/input.h - ${BA_SRC_ROOT}/ballistica/input/remote_app.cc - ${BA_SRC_ROOT}/ballistica/input/remote_app.h - ${BA_SRC_ROOT}/ballistica/input/std_input_module.cc - ${BA_SRC_ROOT}/ballistica/input/std_input_module.h - ${BA_SRC_ROOT}/ballistica/math/matrix44f.cc - ${BA_SRC_ROOT}/ballistica/math/matrix44f.h - ${BA_SRC_ROOT}/ballistica/math/point2d.h - ${BA_SRC_ROOT}/ballistica/math/random.cc - ${BA_SRC_ROOT}/ballistica/math/random.h - ${BA_SRC_ROOT}/ballistica/math/rect.h - ${BA_SRC_ROOT}/ballistica/math/vector2f.h - ${BA_SRC_ROOT}/ballistica/math/vector3f.cc - ${BA_SRC_ROOT}/ballistica/math/vector3f.h - ${BA_SRC_ROOT}/ballistica/math/vector4f.h - ${BA_SRC_ROOT}/ballistica/media/component/collide_model.cc - ${BA_SRC_ROOT}/ballistica/media/component/collide_model.h - ${BA_SRC_ROOT}/ballistica/media/component/cube_map_texture.cc - ${BA_SRC_ROOT}/ballistica/media/component/cube_map_texture.h - ${BA_SRC_ROOT}/ballistica/media/component/data.cc - ${BA_SRC_ROOT}/ballistica/media/component/data.h - ${BA_SRC_ROOT}/ballistica/media/component/media_component.cc - ${BA_SRC_ROOT}/ballistica/media/component/media_component.h - ${BA_SRC_ROOT}/ballistica/media/component/model.cc - ${BA_SRC_ROOT}/ballistica/media/component/model.h - ${BA_SRC_ROOT}/ballistica/media/component/sound.cc - ${BA_SRC_ROOT}/ballistica/media/component/sound.h - ${BA_SRC_ROOT}/ballistica/media/component/texture.cc - ${BA_SRC_ROOT}/ballistica/media/component/texture.h - ${BA_SRC_ROOT}/ballistica/media/data/collide_model_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/collide_model_data.h - ${BA_SRC_ROOT}/ballistica/media/data/data_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/data_data.h - ${BA_SRC_ROOT}/ballistica/media/data/media_component_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/media_component_data.h - ${BA_SRC_ROOT}/ballistica/media/data/model_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/model_data.h - ${BA_SRC_ROOT}/ballistica/media/data/model_renderer_data.h - ${BA_SRC_ROOT}/ballistica/media/data/sound_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/sound_data.h - ${BA_SRC_ROOT}/ballistica/media/data/texture_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/texture_data.h - ${BA_SRC_ROOT}/ballistica/media/data/texture_preload_data.cc - ${BA_SRC_ROOT}/ballistica/media/data/texture_preload_data.h - ${BA_SRC_ROOT}/ballistica/media/data/texture_renderer_data.h - ${BA_SRC_ROOT}/ballistica/media/media.cc - ${BA_SRC_ROOT}/ballistica/media/media.h - ${BA_SRC_ROOT}/ballistica/media/media_server.cc - ${BA_SRC_ROOT}/ballistica/media/media_server.h - ${BA_SRC_ROOT}/ballistica/networking/lag_sim.cc - ${BA_SRC_ROOT}/ballistica/networking/lag_sim.h - ${BA_SRC_ROOT}/ballistica/networking/master_server_config.h - ${BA_SRC_ROOT}/ballistica/networking/network_reader.cc - ${BA_SRC_ROOT}/ballistica/networking/network_reader.h - ${BA_SRC_ROOT}/ballistica/networking/network_write_module.cc - ${BA_SRC_ROOT}/ballistica/networking/network_write_module.h - ${BA_SRC_ROOT}/ballistica/networking/networking.cc - ${BA_SRC_ROOT}/ballistica/networking/networking.h - ${BA_SRC_ROOT}/ballistica/networking/networking_sys.h - ${BA_SRC_ROOT}/ballistica/networking/sockaddr.cc - ${BA_SRC_ROOT}/ballistica/networking/sockaddr.h - ${BA_SRC_ROOT}/ballistica/networking/telnet_server.cc - ${BA_SRC_ROOT}/ballistica/networking/telnet_server.h - ${BA_SRC_ROOT}/ballistica/platform/android/amazon/platform_android_amazon.cc - ${BA_SRC_ROOT}/ballistica/platform/android/amazon/platform_android_amazon.h - ${BA_SRC_ROOT}/ballistica/platform/android/android_context.cc - ${BA_SRC_ROOT}/ballistica/platform/android/android_context.h - ${BA_SRC_ROOT}/ballistica/platform/android/android_gl3.c - ${BA_SRC_ROOT}/ballistica/platform/android/android_gl3.h - ${BA_SRC_ROOT}/ballistica/platform/android/cardboard/platform_android_cardboard.cc - ${BA_SRC_ROOT}/ballistica/platform/android/cardboard/platform_android_cardboard.h - ${BA_SRC_ROOT}/ballistica/platform/android/google/connection_to_client_google_play.cc - ${BA_SRC_ROOT}/ballistica/platform/android/google/connection_to_client_google_play.h - ${BA_SRC_ROOT}/ballistica/platform/android/google/connection_to_host_google_play.cc - ${BA_SRC_ROOT}/ballistica/platform/android/google/connection_to_host_google_play.h - ${BA_SRC_ROOT}/ballistica/platform/android/google/platform_android_google.cc - ${BA_SRC_ROOT}/ballistica/platform/android/google/platform_android_google.h - ${BA_SRC_ROOT}/ballistica/platform/android/ifaddrs_android_ext.cc - ${BA_SRC_ROOT}/ballistica/platform/android/ifaddrs_android_ext.h - ${BA_SRC_ROOT}/ballistica/platform/android/platform_android.cc - ${BA_SRC_ROOT}/ballistica/platform/android/platform_android.h - ${BA_SRC_ROOT}/ballistica/platform/android/utf8/checked.h - ${BA_SRC_ROOT}/ballistica/platform/android/utf8/core.h - ${BA_SRC_ROOT}/ballistica/platform/android/utf8/unchecked.h - ${BA_SRC_ROOT}/ballistica/platform/apple/app_delegate.h - ${BA_SRC_ROOT}/ballistica/platform/apple/apple_utils.h - ${BA_SRC_ROOT}/ballistica/platform/apple/platform_apple.cc - ${BA_SRC_ROOT}/ballistica/platform/apple/platform_apple.h - ${BA_SRC_ROOT}/ballistica/platform/apple/scripting_bridge_itunes.h - ${BA_SRC_ROOT}/ballistica/platform/apple/sdl_main_mac.h - ${BA_SRC_ROOT}/ballistica/platform/linux/platform_linux.cc - ${BA_SRC_ROOT}/ballistica/platform/linux/platform_linux.h - ${BA_SRC_ROOT}/ballistica/platform/min_sdl.h - ${BA_SRC_ROOT}/ballistica/platform/oculus/main_rift.cc - ${BA_SRC_ROOT}/ballistica/platform/oculus/oculus_utils.cc - ${BA_SRC_ROOT}/ballistica/platform/oculus/oculus_utils.h - ${BA_SRC_ROOT}/ballistica/platform/platform.cc - ${BA_SRC_ROOT}/ballistica/platform/platform.h - ${BA_SRC_ROOT}/ballistica/platform/sdl/sdl_app.cc - ${BA_SRC_ROOT}/ballistica/platform/sdl/sdl_app.h - ${BA_SRC_ROOT}/ballistica/platform/sdl/sdl_sys.cc - ${BA_SRC_ROOT}/ballistica/platform/sdl/sdl_sys.h - ${BA_SRC_ROOT}/ballistica/platform/windows/platform_windows.cc - ${BA_SRC_ROOT}/ballistica/platform/windows/platform_windows.h - ${BA_SRC_ROOT}/ballistica/platform/windows/platform_windows_oculus.cc - ${BA_SRC_ROOT}/ballistica/platform/windows/platform_windows_oculus.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_activity_data.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_activity_data.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_collide_model.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_collide_model.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_context.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_context.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_context_call.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_context_call.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_data.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_data.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_input_device.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_input_device.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_material.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_material.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_model.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_model.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_node.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_node.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_player.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_player.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_session_data.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_session_data.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_sound.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_sound.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_texture.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_texture.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_timer.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_timer.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_vec3.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_vec3.h - ${BA_SRC_ROOT}/ballistica/python/class/python_class_widget.cc - ${BA_SRC_ROOT}/ballistica/python/class/python_class_widget.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_account.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_account.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_app.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_app.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_gameplay.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_gameplay.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_graphics.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_graphics.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_input.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_input.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_media.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_media.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_networking.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_networking.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_system.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_system.h - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_ui.cc - ${BA_SRC_ROOT}/ballistica/python/methods/python_methods_ui.h - ${BA_SRC_ROOT}/ballistica/python/python.cc - ${BA_SRC_ROOT}/ballistica/python/python.h - ${BA_SRC_ROOT}/ballistica/python/python_command.cc - ${BA_SRC_ROOT}/ballistica/python/python_command.h - ${BA_SRC_ROOT}/ballistica/python/python_context_call.cc - ${BA_SRC_ROOT}/ballistica/python/python_context_call.h - ${BA_SRC_ROOT}/ballistica/python/python_context_call_runnable.h - ${BA_SRC_ROOT}/ballistica/python/python_ref.cc - ${BA_SRC_ROOT}/ballistica/python/python_ref.h - ${BA_SRC_ROOT}/ballistica/python/python_sys.h - ${BA_SRC_ROOT}/ballistica/scene/node/anim_curve_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/anim_curve_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/bomb_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/bomb_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/combine_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/combine_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/explosion_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/explosion_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/flag_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/flag_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/flash_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/flash_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/globals_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/globals_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/image_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/image_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/light_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/light_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/locator_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/locator_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/math_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/math_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/node.h - ${BA_SRC_ROOT}/ballistica/scene/node/node_attribute.cc - ${BA_SRC_ROOT}/ballistica/scene/node/node_attribute.h - ${BA_SRC_ROOT}/ballistica/scene/node/node_attribute_connection.cc - ${BA_SRC_ROOT}/ballistica/scene/node/node_attribute_connection.h - ${BA_SRC_ROOT}/ballistica/scene/node/node_type.h - ${BA_SRC_ROOT}/ballistica/scene/node/null_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/null_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/player_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/player_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/prop_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/prop_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/region_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/region_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/scorch_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/scorch_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/session_globals_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/session_globals_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/shield_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/shield_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/sound_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/sound_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/spaz_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/spaz_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/terrain_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/terrain_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/text_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/text_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/texture_sequence_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/texture_sequence_node.h - ${BA_SRC_ROOT}/ballistica/scene/node/time_display_node.cc - ${BA_SRC_ROOT}/ballistica/scene/node/time_display_node.h - ${BA_SRC_ROOT}/ballistica/scene/scene.cc - ${BA_SRC_ROOT}/ballistica/scene/scene.h - ${BA_SRC_ROOT}/ballistica/ui/console.cc - ${BA_SRC_ROOT}/ballistica/ui/console.h - ${BA_SRC_ROOT}/ballistica/ui/ui.cc - ${BA_SRC_ROOT}/ballistica/ui/ui.h - ${BA_SRC_ROOT}/ballistica/ui/widget/button_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/button_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/check_box_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/check_box_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/column_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/column_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/container_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/container_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/h_scroll_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/h_scroll_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/image_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/image_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/root_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/root_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/row_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/row_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/scroll_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/scroll_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/stack_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/stack_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/text_widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/text_widget.h - ${BA_SRC_ROOT}/ballistica/ui/widget/widget.cc - ${BA_SRC_ROOT}/ballistica/ui/widget/widget.h - #AUTOGENERATED_END - ) - -target_include_directories(ballisticacore PRIVATE - ${PYTHON_INCLUDE_DIRS} - ${BA_SRC_ROOT}/external/open_dynamics_engine-ef - ${BA_SRC_ROOT}/external/qrencode-3.4.4 - ${EXTRA_INCLUDE_DIRS} - ) - -target_link_libraries(ballisticacore PRIVATE - ode pthread ${PYTHON_LIBRARIES} - ${SDL2_LIBRARIES} ${EXTRA_LIBRARIES}) diff --git a/tools/efrotools/makefile.py b/tools/efrotools/makefile.py index 44dedc1f..4f34a274 100644 --- a/tools/efrotools/makefile.py +++ b/tools/efrotools/makefile.py @@ -7,7 +7,7 @@ from dataclasses import dataclass from typing import TYPE_CHECKING if TYPE_CHECKING: - from typing import Optional, List + from typing import Optional, List, Tuple @dataclass @@ -22,6 +22,13 @@ class Paragraph: """Represents a continuous set of non-blank lines in a Makefile.""" contents: str + def get_logical_lines(self) -> List[str]: + """Return contents broken into logical lines. + + Lines joined by continuation chars are considered a single line. + """ + return self.contents.replace('\\\n', '').splitlines() + class Makefile: """Represents an entire Makefile.""" @@ -72,6 +79,33 @@ class Makefile: else: section.paragraphs.append(paragraph) + def find_assigns(self, name: str) -> List[Tuple[Section, int]]: + """Return section/index pairs for paragraphs containing an assign. + + Note that the paragraph may contain other statements as well. + """ + found: List[Tuple[Section, int]] = [] + for section in self.sections: + for i, paragraph in enumerate(section.paragraphs): + if any( + line.split('=')[0].strip() == name + for line in paragraph.get_logical_lines()): + found.append((section, i)) + return found + + def find_targets(self, name: str) -> List[Tuple[Section, int]]: + """Return section/index pairs for paragraphs containing a target. + + Note that the paragraph may contain other statements as well. + """ + found: List[Tuple[Section, int]] = [] + for section in self.sections: + for i, paragraph in enumerate(section.paragraphs): + if any(line.split()[0] == name + ':' + for line in paragraph.get_logical_lines()): + found.append((section, i)) + return found + def get_output(self) -> str: """Generate a Makefile from the current state.""" diff --git a/tools/update_project b/tools/update_project new file mode 100755 index 00000000..32c8c6a8 --- /dev/null +++ b/tools/update_project @@ -0,0 +1,397 @@ +#!/usr/bin/env python3 +""" +This script acts as a 'meta' Makefile for the project. It is in charge +of generating Makefiles, IDE project files, procedurally generated source +files, etc. based on the current structure of the project. +It can also perform sanity checks or cleanup tasks. + +Updating should be explicitly run by the user through commands such as +'make update', 'make check' or 'make preflight'. Other make targets should +avoid running this script as it can modify the project structure +arbitrarily which is not a good idea in the middle of a build. + +If the script is invoked with a --check argument, it should not modify any +files but instead fail if any modifications *would* have been made. +(used in CI builds to make sure things are kosher). +""" + +from __future__ import annotations + +import os +import sys +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Optional, Tuple, List, Sequence, Dict, Set + +CLRHDR = '\033[95m' # Header. +CLRGRN = '\033[92m' # Green. +CLRBLU = '\033[94m' # Glue. +CLRRED = '\033[91m' # Red. +CLREND = '\033[0m' # End. + + +def _find_files(scan_dir: str) -> Tuple[List[str], List[str]]: + src_files = set() + header_files = set() + exts = ['.c', '.cc', '.cpp', '.cxx', '.m', '.mm'] + header_exts = ['.h'] + + # Gather all sources and headers. + for root, _dirs, files in os.walk(scan_dir): + for ftst in files: + if any(ftst.endswith(ext) for ext in exts): + src_files.add(os.path.join(root, ftst)[len(scan_dir):]) + if any(ftst.endswith(ext) for ext in header_exts): + header_files.add(os.path.join(root, ftst)[len(scan_dir):]) + return sorted(src_files), sorted(header_files) + + +def _check_files(src_files: Sequence[str]) -> None: + + # A bit of sanity/lint-testing while we're here. + for fsrc in src_files: + if fsrc.endswith('.cpp') or fsrc.endswith('.cxx'): + raise Exception('please use .cc for c++ files; found ' + fsrc) + + # Watch out for in-progress emacs edits. + # Could just ignore these but it probably means I intended + # to save something and forgot. + if '/.#' in fsrc: + print(f'{CLRRED}' + f'ERROR: Found an unsaved emacs file: "{fsrc}"' + f'{CLREND}') + sys.exit(255) + + +def _check_headers(header_files: Sequence[str], fixable_header_errors: Dict, + fix: bool) -> None: + for header_file_raw in header_files: + assert header_file_raw[0] == '/' + header_file = 'src/ballistica' + header_file_raw + + # If its a header-file, lets make sure its define guard is correct. + if header_file.endswith('.h'): + guard = ( + header_file[4:].upper().replace('/', '_').replace('.', '_') + + '_') + with open(header_file) as fhdr: + lines = fhdr.read().splitlines() + expected_lines = [(0, '// Copyright 2019 Eric Froemling'), + (2, '#ifndef ' + guard), (3, '#define ' + guard), + (-1, '#endif // ' + guard)] + errors_found = False + can_fix = True + for line, expected in expected_lines: + if lines[line] != expected: + errors_found = True + print("Incorrect line " + str(line) + " in " + + header_file + ":\n" + "Expected: " + expected + "\n" + "Found: " + lines[line]) + + # If the beginning of the line differs, + # don't attempt auto-fix. + if lines[line][:16] != expected[:16]: + can_fix = False + if errors_found: + if can_fix: + fixable_header_errors.setdefault(header_file, [])\ + .append((line, expected)) + else: + print(CLRRED + "Error found in '" + header_file + + "'. Not auto-fixable; please correct manually." + + CLREND) + sys.exit(255) + if fixable_header_errors and not fix: + print(CLRRED + + 'Fixable header error(s) found; pass --fix to correct.' + CLREND) + sys.exit(255) + + +def _update_cmake_file(fname: str, src_files: List[str], + header_files: List[str], + files_to_write: Dict[str, str]) -> None: + + with open(fname) as infile: + lines = infile.read().splitlines() + auto_start = lines.index(' #AUTOGENERATED_BEGIN (this section' + ' is managed by the "update_project" tool)') + auto_end = lines.index(' #AUTOGENERATED_END') + our_lines = [ + ' ${BA_SRC_ROOT}/ballistica' + f + for f in sorted(src_files + header_files) + if not f.endswith('.mm') and not f.endswith('.m') + ] + filtered = lines[:auto_start + 1] + our_lines + lines[auto_end:] + files_to_write[fname] = '\n'.join(filtered) + '\n' + + +def _update_visual_studio_project(fname: str, src_root: str, + src_files: List[str], + header_files: List[str], + files_to_write: Dict[str, str]) -> None: + # pylint: disable=too-many-locals + with open(fname) as infile: + lines = infile.read().splitlines() + + # Hmm can we include headers in the project for easy access? + # Seems VS attempts to compile them if we do so here. + # all_files = sorted(src_files + header_files) + # del header_files # Unused. + all_files = sorted([ + f for f in (src_files + header_files) if not f.endswith('.m') + and not f.endswith('.mm') and not f.endswith('.c') + ]) + + # Find the ItemGroup containing stdafx.cpp. This is where we'll dump + # our stuff. + index = lines.index(' ') + begin_index = end_index = index + while lines[begin_index] != ' ': + begin_index -= 1 + while lines[end_index] != ' ': + end_index += 1 + group_lines = lines[begin_index + 1:end_index] + + # Strip out any existing files from src/ballistica. + group_lines = [ + l for l in group_lines if src_root + '\\ballistica\\' not in l + ] + + # Now add in our own. + # Note: we can't use C files in this build at the moment; breaks + # precompiled header stuff. (shouldn't be a problem though). + group_lines = [ + ' <' + + ('ClInclude' if src.endswith('.h') else 'ClCompile') + ' Include="' + + src_root + '\\ballistica' + src.replace('/', '\\') + '" />' + for src in all_files + ] + group_lines + filtered = lines[:begin_index + 1] + group_lines + lines[end_index:] + files_to_write[fname] = '\r\n'.join(filtered) + '\r\n' + + filterpaths: Set[str] = set() + filterlines: List[str] = [ + '', + '', + ' ', + ] + sourcelines = [l for l in filtered if 'Include="' + src_root in l] + for line in sourcelines: + entrytype = line.strip().split()[0][1:] + path = line.split('"')[1] + filterlines.append(' <' + entrytype + ' Include="' + path + '">') + + # If we have a dir foo/bar/eep we need to create filters for + # each of foo, foo/bar, and foo/bar/eep + splits = path[len(src_root):].split('\\') + splits = [s for s in splits if s != ''] + splits = splits[:-1] + for i in range(len(splits)): + filterpaths.add('\\'.join(splits[:(i + 1)])) + filterlines.append(' ' + '\\'.join(splits) + '') + filterlines.append(' ') + filterlines += [ + ' ', + ' ', + ] + for filterpath in sorted(filterpaths): + filterlines.append(' ') + filterlines += [ + ' ', + '', + ] + + files_to_write[fname + '.filters'] = '\r\n'.join(filterlines) + '\r\n' + + +def main() -> None: + """Main script entry point.""" + + # pylint: disable=too-many-locals + # pylint: disable=too-many-branches + # pylint: disable=too-many-statements + + # Make sure we're operating from dist root. + os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..')) + + check = ('--check' in sys.argv) + fix = ('--fix' in sys.argv) + + checkarg = ' --check' if check else '' + + # Update our python enums module. + # Should do this before updating asset deps since this is an asset. + if os.path.exists('tools/update_puthon_enums_module'): + if os.system('tools/update_python_enums_module' + checkarg) != 0: + print(CLRRED + 'Error checking/updating python enums module' + + CLREND) + sys.exit(255) + + # Update our resources Makefile. + if os.path.exists('tools/update_resources_makefile'): + if os.system('tools/update_resources_makefile' + checkarg) != 0: + print(CLRRED + 'Error checking/updating resources Makefile' + + CLREND) + sys.exit(255) + + # Update our generated-code Makefile. + if os.path.exists('tools/update_generated_code_makefile'): + if os.system('tools/update_generated_code_makefile' + checkarg) != 0: + print(CLRRED + 'Error checking/updating generated-code Makefile' + + CLREND) + sys.exit(255) + + # Update our assets Makefile. + if os.path.exists('tools/update_assets_makefile'): + if os.system('tools/update_assets_makefile' + checkarg) != 0: + print(CLRRED + 'Error checking/updating assets Makefile' + CLREND) + sys.exit(255) + + # Make sure all module dirs in python scripts contain an __init__.py + scripts_dir = 'assets/src/data/scripts' + for root, _dirs, files in os.walk(scripts_dir): + if (root != scripts_dir and '__pycache__' not in root + and os.path.basename(root) != '.vscode'): + if '__init__.py' not in files: + print(CLRRED + 'Error: no __init__.py in package dir: ' + + root + CLREND) + sys.exit(255) + + # Make sure none of our sync targets have been mucked with since + # their last sync. + if os.system('tools/snippets sync check') != 0: + print(CLRRED + 'Sync check failed; you may need to run "sync".' + + CLREND) + sys.exit(255) + + # Now go through and update our various build files + # (MSVC, CMake, Android NDK, etc) as well as sanity-testing/fixing + # various other files such as headers while we're at it. + + files_to_write: Dict[str, str] = {} + + # Grab sources/headers. + src_files, header_files = _find_files('src/ballistica') + + # Run some checks on them. + _check_files(src_files) + fixable_header_errors: Dict[str, List[Tuple[int, str]]] = {} + _check_headers(header_files, fixable_header_errors, fix) + + # Now update various builds. + + # CMake + fname = 'ballisticacore-cmake/CMakeLists.txt' + if os.path.exists(fname): + _update_cmake_file( + fname, + src_files, + header_files, + files_to_write, + ) + fname = 'ballisticacore-android/BallisticaCore/src/main/cpp/CMakeLists.txt' + if os.path.exists(fname): + _update_cmake_file( + fname, + src_files, + header_files, + files_to_write, + ) + + # Visual Studio + fname = 'ballisticacore-windows/BallisticaCore/BallisticaCore.vcxproj' + if os.path.exists(fname): + _update_visual_studio_project( + fname, + '..\\..\\src', + src_files, + header_files, + files_to_write, + ) + fname = ('ballisticacore-windows/BallisticaCoreHeadless/' + 'BallisticaCoreHeadless.vcxproj') + if os.path.exists(fname): + _update_visual_studio_project( + fname, + '..\\..\\src', + src_files, + header_files, + files_to_write, + ) + fname = ('ballisticacore-windows/BallisticaCoreOculus' + '/BallisticaCoreOculus.vcxproj') + if os.path.exists(fname): + _update_visual_studio_project( + fname, + '..\\..\\src', + src_files, + header_files, + files_to_write, + ) + + # If we're all good to here, do the actual writes. + + # First, write any header fixes. + if fixable_header_errors: + for filename, fixes in fixable_header_errors.items(): + with open(filename, 'r') as infile: + lines = infile.read().splitlines() + for fix_line, fix_str in fixes: + lines[fix_line] = fix_str + with open(filename, 'w') as outfile: + outfile.write('\n'.join(lines) + '\n') + print(CLRBLU + 'Writing header: ' + filename + CLREND) + else: + print(f'All {len(header_files)} headers up to date.') + + # Now write out any project files that have changed + # (or error if we're in check mode). + unchanged_project_count = 0 + for fname, fcode in files_to_write.items(): + f_orig: Optional[str] + if os.path.exists(fname): + with open(fname, 'r') as infile: + f_orig = infile.read() + else: + f_orig = None + if f_orig == fcode.replace('\r\n', '\n'): + unchanged_project_count += 1 + else: + if check: + print(f'{CLRRED}ERROR: found out-of-date' + f' project file: {fname}{CLREND}') + sys.exit(255) + + print(f'{CLRBLU}Writing project file: {fname}{CLREND}') + with open(fname, 'w') as outfile: + outfile.write(fcode) + if unchanged_project_count > 0: + print(f'All {unchanged_project_count} project files up to date.') + + # Update our local compile-commands file based on any changes to + # our cmake stuff. Do this at end so cmake changes already happened. + if not check and os.path.exists('ballisticacore-cmake'): + if os.system('make .irony/compile_commands.json') != 0: + print(CLRRED + 'Error updating compile-commands.' + CLREND) + sys.exit(255) + + # Lastly update our dummy _ba module. + # We need to do this very last because it may run the cmake build + # so its success may depend on the cmake build files having already + # been updated. + if os.path.exists('tools/gendummymodule.py'): + if os.system('tools/gendummymodule.py' + checkarg) != 0: + print(CLRRED + 'Error checking/updating dummy module' + CLREND) + sys.exit(255) + + if check: + print('Check-Builds: Everything up to date.') + else: + print('Update-Builds: SUCCESS!') + + +if __name__ == '__main__': + main()