Skip to content

Commit

Permalink
fix(src/init.cc): fix mobile build
Browse files Browse the repository at this point in the history
  • Loading branch information
chicoxyzzy committed Sep 10, 2023
1 parent 91f57e9 commit 95b8e87
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/cli/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ int main (const int argc, const char* argv[]) {
bool flagRunUserBuildOnly = optionsWithoutValue.find("--only-build") != optionsWithoutValue.end() || equal(rc["build_only"], "true");
bool flagAppStore = optionsWithoutValue.find("-s") != optionsWithoutValue.end() || equal(rc["build_app_store"], "true");
bool flagCodeSign = optionsWithoutValue.find("-c") != optionsWithoutValue.end() || equal(rc["build_codesign"], "true");
bool flagBuildHeadless = equal(rc["build_headless"], "true") || (settings["build_headless"] == "true" && !equal(rc["build_headless"], "true"));
bool flagBuildHeadless = settings["build_headless"] == "true";
bool flagRunHeadless = optionsWithoutValue.find("--headless") != optionsWithoutValue.end();
bool flagShouldRun = optionsWithoutValue.find("--run") != optionsWithoutValue.end() || equal(rc["build_run"], "true");
bool flagEntitlements = optionsWithoutValue.find("-e") != optionsWithoutValue.end() || equal(rc["build_entitlements"], "true");
Expand Down Expand Up @@ -2565,9 +2565,6 @@ int main (const int argc, const char* argv[]) {
if (isForDesktop) {
fs::create_directories(paths.platformSpecificOutputPath / "include");
writeFile(paths.platformSpecificOutputPath / "include" / "user-config-bytes.hh", settings["ini_code"]);

auto baked = String("const bool __headless = ") + (flagBuildHeadless ? "true" : "false") + ";\n";
writeFile(paths.platformSpecificOutputPath / "include" / "baked-vars.hh", baked);
}

//
Expand Down
1 change: 0 additions & 1 deletion src/common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ namespace SSC {
extern bool isDebugEnabled ();
extern const char* getDevHost ();
extern int getDevPort ();
extern const bool isBakedHeadless ();

inline String encodeURIComponent (const String& sSrc);
inline String decodeURIComponent (const String& sSrc);
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ MAIN {

bool isCommandMode = false;
bool isReadingStdin = false;
bool isHeadless = isBakedHeadless() || false;
bool isHeadless = app.appData["build_headless"] == "true" ? true : false;
bool isTest = false;

int exitCode = 0;
Expand Down
5 changes: 0 additions & 5 deletions src/init.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "common.hh"
#include "baked-vars.hh" // NOLINT

// These rely on project-specific, compile-time variables.
namespace SSC {
Expand All @@ -15,10 +14,6 @@ namespace SSC {
));
}

const bool isBakedHeadless () {
return __headless;
}

const char* getDevHost () {
static const char* host = STR_VALUE(HOST);
return host;
Expand Down

0 comments on commit 95b8e87

Please sign in to comment.