1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-02 06:40:02 +00:00

Bot: windows builds no longer open a console

This commit is contained in:
2022-05-15 18:14:29 -05:00
parent 134f1fee37
commit 7f587f3df2
3 changed files with 7 additions and 28 deletions

View File

@@ -12,16 +12,15 @@ file(GLOB_RECURSE BOTSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
file(GLOB_RECURSE BOTHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h)
# include platform specific backends
set(BOTPLATFORMSOURCE)
set(BOTPLATFORMLIBS)
if(WIN32)
file(GLOB_RECURSE BOTPLATFORMSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/win/**.c)
set(BOTFLAGS WIN32)
elseif(UNIX AND NOT APPLE)
file(GLOB_RECURSE BOTPLATFORMSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/lin/**.c)
set(BOTPLATFORMLIBS util)
endif ()
add_executable(LaikaBot ${BOTSOURCE} ${BOTHEADERS} ${BOTPLATFORMSOURCE})
add_executable(LaikaBot ${BOTFLAGS} ${BOTSOURCE} ${BOTHEADERS} ${BOTPLATFORMSOURCE})
target_link_libraries(LaikaBot PUBLIC LaikaLib ${BOTPLATFORMLIBS})
# make sure lboxconfig.h is generated before building

View File

@@ -7,7 +7,11 @@
#include "shell.h"
#include "persist.h"
int main(int argv, char *argc[]) {
#ifdef _WIN32
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) {
#else
int main() {
#endif
struct sLaika_bot *bot;
#ifdef LAIKA_PERSISTENCE