-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06831f7
commit fb4e634
Showing
5 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
-- | ||
-- Copyright (c) 2012-2024 Daniele Bartolini et al. | ||
-- SPDX-License-Identifier: MIT | ||
-- | ||
|
||
project ("crown-launcher") | ||
kind "WindowedApp" | ||
|
||
includedirs { | ||
CROWN_DIR .. "src", | ||
CROWN_DIR .. "3rdparty/stb", | ||
} | ||
|
||
configuration { "debug" } | ||
defines { | ||
"CROWN_DEBUG=1" | ||
} | ||
|
||
configuration { "release" } | ||
defines { | ||
"CROWN_DEBUG=0" | ||
} | ||
|
||
configuration { "linux-*" } | ||
links { | ||
"pthread", | ||
} | ||
|
||
configuration { "vs* or mingw*" } | ||
links { | ||
"dbghelp", | ||
"psapi", | ||
"ole32", | ||
"gdi32", | ||
} | ||
|
||
configuration {} | ||
|
||
files { | ||
CROWN_DIR .. "src/core/os.cpp", | ||
CROWN_DIR .. "src/device/log.cpp", | ||
CROWN_DIR .. "src/core/thread/mutex.cpp", | ||
CROWN_DIR .. "src/core/memory/globals.cpp", | ||
CROWN_DIR .. "src/core/error/**.cpp", | ||
CROWN_DIR .. "src/core/process.cpp", | ||
CROWN_DIR .. "tools/launcher/launcher.cpp", | ||
} | ||
|
||
strip() | ||
|
||
configuration {} -- reset configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "core/memory/allocator.h" | ||
#include "core/memory/globals.h" | ||
#include "core/os.h" | ||
#include "core/process.h" | ||
#define STB_SPRINTF_IMPLEMENTATION | ||
#define STB_SPRINTF_NOUNALIGNED | ||
#define STB_SPRINTF_NOFLOAT | ||
#include <stb_sprintf.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
using namespace crown; | ||
memory_globals::init(); | ||
CE_UNUSED(argc); | ||
|
||
#if CROWN_PLATFORM_LINUX | ||
os::setcwd("platforms/linux64/bin"); | ||
#elif CROWN_PLATFORM_WINDOWS | ||
os::setcwd("platforms/windows64/bin"); | ||
#else | ||
#error "Unsupported platform." | ||
#endif | ||
|
||
char editor_exe[] = EXE_PATH("level-editor-release"); | ||
|
||
Process pr; | ||
argv[0] = editor_exe; | ||
|
||
if (pr.spawn(argv, CROWN_PROCESS_STDOUT_PIPE | CROWN_PROCESS_STDERR_MERGE) != 0) { | ||
printf("Cannot spawn %s\n", argv[0]); | ||
return EXIT_FAILURE; | ||
} | ||
|
||
int exit_code = pr.wait(); | ||
memory_globals::shutdown(); | ||
return exit_code; | ||
} |