Browse Source

Added -DENABLED_LAUNCHER and -DENABLED_EDITOR defines

Ivan Savenko 2 years ago
parent
commit
858fb97f42
3 changed files with 11 additions and 9 deletions
  1. 2 0
      CMakeLists.txt
  2. 8 8
      launcher/main.cpp
  3. 1 1
      launcher/mainwindow_moc.cpp

+ 2 - 0
CMakeLists.txt

@@ -474,9 +474,11 @@ if(NOT TARGET minizip::minizip)
 endif()
 
 if(ENABLE_LAUNCHER)
+	add_definitions(-DENABLE_LAUNCHER)
 	add_subdirectory(launcher)
 endif()
 if(ENABLE_EDITOR)
+	add_definitions(-DENABLE_EDITOR)
 	add_subdirectory(mapeditor)
 endif()
 add_subdirectory(client)

+ 8 - 8
launcher/main.cpp

@@ -63,14 +63,14 @@ void startGame(const QStringList & args)
 	startExecutable(pathToQString(VCMIDirs::get().clientPath()), args);
 #endif
 }
-
-void startEditor(const QStringList & args)
-{
-#ifndef Q_OS_IOS
-	startExecutable(pathToQString(VCMIDirs::get().editorPath()), args);
-#endif
-}
-
+
+void startEditor(const QStringList & args)
+{
+#ifdef ENABLE_EDITOR
+	startExecutable(pathToQString(VCMIDirs::get().mapEditorPath()), args);
+#endif
+}
+
 #ifndef Q_OS_IOS
 void startExecutable(QString name, const QStringList & args)
 {

+ 1 - 1
launcher/mainwindow_moc.cpp

@@ -69,7 +69,7 @@ MainWindow::MainWindow(QWidget * parent)
 		move(position);
 	}
 
-#ifdef Q_OS_IOS
+#ifndef ENABLE_EDITOR
 	ui->startEditorButton->hide();
 #endif