2
0
Эх сурвалжийг харах

Merge pull request #163 from bope/master

OpenAL examples build fails on Linux
Ivan Safrin 13 жил өмнө
parent
commit
95eb80e011

+ 1 - 1
CMake/openal.cmake

@@ -57,7 +57,7 @@ OPTION(WERROR  "Treat compile warnings as errors"      OFF)
 
 OPTION(UTILS  "Build and install utility programs"  ON)
 
-OPTION(EXAMPLES  "Build and install example programs"  ON)
+OPTION(EXAMPLES  "Build and install example programs"  OFF)
 
 OPTION(ALSOFT_CONFIG "Install alsoft.conf configuration file" OFF)
 

+ 1 - 1
Core/Contents/Include/PolySDLCore.h

@@ -68,7 +68,7 @@ namespace Polycode {
 		std::vector<String> openFilePicker(std::vector<CoreFileExtension> extensions, bool allowMultiple);
 		void resizeTo(int xRes, int yRes);
 
-		String executeExternalCommand(String command, String inDirectory="");
+		String executeExternalCommand(String command, String args, String inDirectory="");
 		void openURL(String url);
 
 	private:

+ 8 - 2
Core/Contents/Source/PolySDLCore.cpp

@@ -160,8 +160,14 @@ void SDLCore::openURL(String url) {
     }
 }
 
-String SDLCore::executeExternalCommand(String command,  String inDirectory) {
-	FILE *fp = popen(command.c_str(), "r");
+String SDLCore::executeExternalCommand(String command, String args, String inDirectory) {
+	String finalCommand = command + " " + args;
+
+	if(inDirectory != "") {
+		finalCommand = "cd " + inDirectory + " && " + finalCommand;
+	}
+
+	FILE *fp = popen(finalCommand.c_str(), "r");
 	if(!fp) {
 		return "Unable to execute command";
 	}