Added BA_ENABLE_IRONY_BUILD_DB option to main Makefile

This commit is contained in:
Eric Froemling 2020-10-17 12:57:50 -07:00
parent bf87e9068e
commit d098291948
7 changed files with 90 additions and 68 deletions

View File

@ -3932,24 +3932,24 @@
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/09/63/c5e389ac3affd7614b3754251445",
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/a1/4f/a00f7d56d98ca0b23c9cc037cca8",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/6f/b4/97b5f96e4f6e559b6c49da500c6c",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/41/30/a34428927841e75600131ff0890a",
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/8d/be/da1e640553e577a11b347ed4bab5",
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/6d/b9/1837173cd127df9196aa5276d2ba",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/52/d7/0a4f8dc06af71baf641100f0fb66",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/4d/bd/6e50404a6654c8d9a49c0239d9c8",
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/74/e4/18e6e35da6f21bb23ba9ebe3ff5d",
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/d8/09/3e0406fd36ecce862c7579f52e5e",
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/b0/ac/0afa5453d5fef6b4022f5f8ddf11",
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/08/ba/7f4028d075966d4da22232a160ed",
"build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/72/93/a41a9777570bee533ab3259f1597",
"build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/2d/40/964c6b36393b12b459433dcda36c",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/e3/d6/e286d413e60a2e6a43b5773d6441",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/20/97/d4a3ccde682ec984a67b3d683f54",
"build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/82/25/c1d9b277444a9aa46be5f1eec44a",
"build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/05/36d55f280f9676e3098ed9aa6a78",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8a/8c/0a3d0b30186fec5b189a5f0407cb",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/30/1c/f554338c290026fb45bd52e9e1a7",
"build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/fa/e5/e624e868b0fc00a2413ae4b9432c",
"build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/e8/1e/418931e11d12072c869808579592",
"build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/21/21/de5c6e124de4675b11d0c73ceb28",
"build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/11/f3/037c95d8bbb74730bdef686526a5",
"build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1a/4a/bd980abb5c7078d1e144d19fa63d",
"build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fd/cd/3397d744c7405740df4d4ae567f0",
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/34/c2/24a9ab7d513acdb8ebaa3251611f",
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/54/40/8e0cc564f49f8963803834ec7995",
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/65/1a/10d49195d31407375d360c59ff73",
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4e/93/2df517f791ac9b44d4cef5cb269d",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c1/67/b8523fe51925a3c4458e5a0b6e90",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/0f/36/28df9ad7c6406de309e9ff8d3748"
"build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/62/55/765d22f045d0d4d31a02aeffec7b",
"build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4b/76/aa0554648b65da797eb30b9c4699",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/91/dc/c415fc19cfa0395cc200a5a72e2c",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/cd/d8/ec9c1c0955cc62ea574a4b42a707"
}

View File

@ -1571,6 +1571,7 @@
<w>premultiplied</w>
<w>premultiply</w>
<w>preprocessing</w>
<w>prereq</w>
<w>prereqs</w>
<w>prevstate</w>
<w>priceraw</w>

View File

@ -9,6 +9,13 @@
# Prefix used for output of docs/changelogs/etc. targets for use in webpages.
DOCPREFIX = "ballisticacore_"
# Set env-var BA_ENABLE_IRONY_BUILD_DB=1 to enable creating/updating a
# cmake compile-commands database for use with irony for emacs (and possibly
# other tools).
ifeq ($(BA_ENABLE_IRONY_BUILD_DB),1)
PREREQ_IRONY = .cache/irony/compile_commands.json
endif
################################################################################
# #
@ -23,7 +30,7 @@ MAC_CLOUDSHELL_HOST ?= homebook-fro
help:
@tools/pcommand makefile_target_list Makefile
PREREQS = .cache/checkenv .dir-locals.el \
PREREQS = .cache/checkenv $(PREREQ_IRONY) .dir-locals.el \
.mypy.ini .pycheckers .pylintrc .style.yapf .clang-format \
ballisticacore-cmake/.clang-format .projectile .editorconfig
@ -32,7 +39,7 @@ PREREQS = .cache/checkenv .dir-locals.el \
prereqs: ${PREREQS}
prereqs-clean:
@rm -rf ${PREREQS} .irony
@rm -rf ${PREREQS}
# Build all assets for all platforms.
assets: prereqs
@ -830,5 +837,21 @@ _cmake-simple-ci-server-build:
cmake -DCMAKE_BUILD_TYPE=Debug -DHEADLESS=true ${PWD}/ballisticacore-cmake
cd build/cmake_simple_ci_server_build && ${MAKE} -j${CPUS}
# Irony in emacs requires us to use cmake to generate a full
# list of compile commands for all files; lets try to keep it up to date
# whenever CMakeLists changes.
.cache/irony/compile_commands.json: ballisticacore-cmake/CMakeLists.txt
@tools/pcommand echo BLU Updating Irony build commands db...
@echo Generating Irony compile-commands-list...
@mkdir -p .cache/irony
@cd .cache/irony \
&& cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug \
${PWD}/ballisticacore-cmake
@mv .cache/irony/compile_commands.json . \
&& rm -rf .cache/irony \
&& mkdir .cache/irony \
&& mv compile_commands.json .cache/irony
@tools/pcommand echo BLU Created Irony build db at $@
# Tell make which of these targets don't represent files.
.PHONY: _cmake-simple-ci-server-build

View File

@ -638,6 +638,7 @@
<w>preloaded</w>
<w>preloads</w>
<w>premult</w>
<w>prereq</w>
<w>printf</w>
<w>printnodes</w>
<w>printobjects</w>

View File

@ -22,7 +22,7 @@ class App : public Module {
/// This gets run after the constructor completes.
/// Any setup that may trigger a virtual method/etc. should go here.
void PostInit();
auto PostInit() -> void;
/// Return whether this class runs its own event loop.
/// If true, BallisticaMain() will continuously ask the app for events
@ -36,26 +36,26 @@ class App : public Module {
/// ensure they are self-sustaining. For instance, an app relying on
/// frame-draws for its main thread event processing may need to
/// manually pump events until frame rendering begins.
virtual void PrimeEventPump();
virtual auto PrimeEventPump() -> void;
/// Handle any pending OS events.
/// On normal graphical builds this is triggered by RunRenderUpkeepCycle();
/// timer intervals for headless builds, etc.
/// Should process any pending OS events, etc.
virtual void RunEvents();
virtual auto RunEvents() -> void;
// These should be called by the window, view-controller, sdl,
// or whatever is driving the app. They must be called from the main thread.
/// Should be called on mobile when the app is backgrounded.
/// Pauses threads, closes network sockets, etc.
void PauseApp();
auto PauseApp() -> void;
auto paused() const -> bool { return actually_paused_; }
/// Should be called on mobile when the app is foregrounded.
/// Spins threads back up, re-opens network sockets, etc.
void ResumeApp();
auto ResumeApp() -> void;
/// The last time the app was resumed (uses GetRealTime() value).
auto last_app_resume_time() const -> millisecs_t {
@ -63,27 +63,28 @@ class App : public Module {
}
/// Should be called when the window/screen resolution changes.
void SetScreenResolution(float width, float height);
auto SetScreenResolution(float width, float height) -> void;
/// Should be called if the platform detects the GL context was lost.
void RebuildLostGLContext();
auto RebuildLostGLContext() -> void;
/// Attempt to draw a frame.
void DrawFrame(bool during_resize = false);
auto DrawFrame(bool during_resize = false) -> void;
/// Used on platforms where our main thread event processing is driven by
/// frame-draw commands given to us. This should be called after drawing
/// a frame in order to bring game state up to date and process OS events.
void RunRenderUpkeepCycle();
auto RunRenderUpkeepCycle() -> void;
/// Called by the graphics-server when drawing completes for a frame.
virtual void DidFinishRenderingFrame(FrameDef* frame);
virtual auto DidFinishRenderingFrame(FrameDef* frame) -> void;
/// Return the price of an IAP product as a human-readable string,
/// or an empty string if not found.
/// FIXME: move this to platform.
auto GetProductPrice(const std::string& product) -> std::string;
void SetProductPrice(const std::string& product, const std::string& price);
auto SetProductPrice(const std::string& product, const std::string& price)
-> void;
auto done() const -> bool { return done_; }
@ -93,41 +94,43 @@ class App : public Module {
return server_wrapper_managed_;
}
virtual void OnBootstrapComplete();
virtual auto OnBootstrapComplete() -> void;
// Deferred calls that can be made from other threads.
void PushCursorUpdate(bool vis);
void PushShowOnlineScoreUICall(const std::string& show,
auto PushCursorUpdate(bool vis) -> void;
auto PushShowOnlineScoreUICall(const std::string& show,
const std::string& game,
const std::string& game_version);
void PushGetFriendScoresCall(const std::string& game,
const std::string& game_version, void* data);
void PushSubmitScoreCall(const std::string& game,
const std::string& game_version, int64_t score);
void PushAchievementReportCall(const std::string& achievement);
void PushGetScoresToBeatCall(const std::string& level,
const std::string& config, void* py_callback);
void PushOpenURLCall(const std::string& url);
void PushStringEditCall(const std::string& name, const std::string& value,
int max_chars);
void PushSetStressTestingCall(bool enable, int player_count);
void PushPurchaseCall(const std::string& item);
void PushRestorePurchasesCall();
void PushResetAchievementsCall();
void PushPurchaseAckCall(const std::string& purchase,
const std::string& order_id);
void PushNetworkSetupCall(int port, int telnet_port, bool enable_telnet,
const std::string& telnet_password);
void PushShutdownCompleteCall();
void PushInterruptSignalSetupCall();
const std::string& game_version) -> void;
auto PushGetFriendScoresCall(const std::string& game,
const std::string& game_version, void* data)
-> void;
auto PushSubmitScoreCall(const std::string& game,
const std::string& game_version, int64_t score)
-> void;
auto PushAchievementReportCall(const std::string& achievement) -> void;
auto PushGetScoresToBeatCall(const std::string& level,
const std::string& config, void* py_callback)
-> void;
auto PushOpenURLCall(const std::string& url) -> void;
auto PushStringEditCall(const std::string& name, const std::string& value,
int max_chars) -> void;
auto PushSetStressTestingCall(bool enable, int player_count) -> void;
auto PushPurchaseCall(const std::string& item) -> void;
auto PushRestorePurchasesCall() -> void;
auto PushResetAchievementsCall() -> void;
auto PushPurchaseAckCall(const std::string& purchase,
const std::string& order_id) -> void;
auto PushNetworkSetupCall(int port, int telnet_port, bool enable_telnet,
const std::string& telnet_password) -> void;
auto PushShutdownCompleteCall() -> void;
auto PushInterruptSignalSetupCall() -> void;
private:
void UpdateStressTesting();
void UpdatePauseResume();
void OnPause();
void OnResume();
void ShutdownComplete();
auto UpdatePauseResume() -> void;
auto OnPause() -> void;
auto OnResume() -> void;
auto ShutdownComplete() -> void;
bool done_{};
bool server_wrapper_managed_{};
bool sys_paused_app_{};

View File

@ -29,7 +29,7 @@
namespace ballistica {
// These are set automatically via script; don't change here.
const int kAppBuildNumber = 20221;
const int kAppBuildNumber = 20223;
const char* kAppVersion = "1.5.27";
// Our standalone globals.

View File

@ -180,16 +180,10 @@ class Updater:
sys.exit(255)
def _update_compile_commands_file(self) -> None:
# Only do this in private repo:
if self._public:
return
# 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 self._check and os.path.exists('ballisticacore-cmake'):
if os.system('make .irony/compile_commands.json') != 0:
print(f'{Clr.RED}Error updating compile-commands.{Clr.RST}')
sys.exit(255)
# This will update our prereqs which may include compile-commands
# files (.cache/irony/compile_commands.json, etc)
subprocess.run(['make', 'prereqs'], check=True)
def _apply_file_changes(self) -> None:
# Now write out any project files that have changed