aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2021-11-07 17:21:02 +0100
committerJan200101 <sentrycraft123@gmail.com>2021-11-07 17:21:02 +0100
commit654b24b37c2e657a67060e45bfd8fb6495bd7dff (patch)
tree7186ca7cb2c2fda6a41230219fba505e5e49b365 /src/main.c
parent34290dfd1377a410b3fea96eb855fd4325a2c269 (diff)
downloadpolecat-654b24b37c2e657a67060e45bfd8fb6495bd7dff.tar.gz
polecat-654b24b37c2e657a67060e45bfd8fb6495bd7dff.zip
cleanup, make main components optional at compile time
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 9c1eef8..8995556 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4,13 +4,19 @@
#include <libgen.h>
#include "main.h"
+#ifdef WINE_ENABLED
#include "wine.h"
+#endif
+#ifdef DXVK_ENABLED
#include "dxvk.h"
+#endif
+#ifdef LUTRIS_ENABLED
#include "lutris.h"
+#endif
#include "common.h"
#include "config.h"
-#ifndef _WIN32
+#ifndef WINE_ENABLED
// if something fails
// we need to free the new argv
char** nargv;
@@ -18,12 +24,16 @@ static void free_nargv() { free(nargv); }
#endif
static const struct Command main_commands[] = {
-#ifndef _WIN32
- { .name = "wine", .func = winecmd, .description = "manage wine versions" },
+#ifdef WINE_ENABLED
+ { .name = "wine", .func = winecmd, .description = "manage wine versions" },
+#endif
+#ifdef DXVK_ENABLED
+ { .name = "dxvk", .func = dxvk, .description = "manage DXVK versions" },
+#endif
+#ifdef LUTRIS_ENABLED
+ { .name = "lutris", .func = lutris, .description = "run lutris instraller"},
#endif
- { .name = "dxvk", .func = dxvk, .description = "manage DXVK versions" },
- { .name = "lutris", .func = lutris, .description = "run lutris instraller"},
- { .name = "env", .func = main_env, .description = "show some information about polecat" },
+ { .name = "env", .func = main_env, .description = "show some information about polecat" },
};
static const struct Flag main_flags[] = {
@@ -33,7 +43,7 @@ static const struct Flag main_flags[] = {
COMMAND_GROUP(main)
{
-#ifndef _WIN32
+#ifndef WINE_ENABLED
char* arg0 = basename(argv[0]);
if (!strncmp(WINE_PREFIX, arg0, strlen(WINE_PREFIX)))
{