aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-03 20:27:29 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-03 20:58:01 +0100
commitadd60913a0ff5cd13be18ed594eab6102e78640c (patch)
treeb438201bfdf6810ce85ebf4de5bc3fe4babb561b
parent46257ab7cf017f0f35a2025257ad5f45a9e985f0 (diff)
Add _CONSOLE and _LIB define for windows
-rw-r--r--backend/ninja/Ninja.cpp12
-rw-r--r--src/main.cpp7
2 files changed, 19 insertions, 0 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 3a46af5..a5fdb0d 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -450,6 +450,18 @@ namespace backend
defines += " /DWIN32 /D_WIN32";
break;
}
+
+#if OS_TYPE == OS_TYPE_WINDOWS
+ switch(libraryType)
+ {
+ case LibraryType::EXECUTABLE:
+ defines += " _CONSOLE";
+ break;
+ case LibraryType::STATIC:
+ defines += " _LIB";
+ break;
+ }
+#endif
if(!defines.empty())
printf("Custom define: %s\n", defines.c_str());
diff --git a/src/main.cpp b/src/main.cpp
index b3b6d63..1297456 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -33,6 +33,13 @@ using namespace std::chrono;
// This can be done by specifying dependencies under [dependencies.platform] instead of [dependencies],
// for example for win32: [dependencies.win32]
+// TODO: When `install` command is added, the target executable and shared library dependencies should be put into
+// an archive to make the executable distributable (especially on windows). A GUI installer could then extract the archive.
+
+// TODO: Add optional dependencies [optional_dependencies]. Optional dependencies should also support platform specific dependencies [dependencies.cmake].
+// Might need to make it possible to define variables if a dependency exists (or doesn't exist) because the code might have
+// preprocessor like: USE_LIBSODIUM or NO_LIBSODIUM.
+
#if OS_FAMILY == OS_FAMILY_POSIX
#define ferr std::cerr
#else