Kaynağa Gözat

Add argument to arg parsing to not set directories

Argument parsing sets the source/build directories, but they may have
been (meaningfully) set before hand. Let's not overwrite them.
Ben Boeckel 15 yıl önce
ebeveyn
işleme
5aa535bdcb
2 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 2 2
      Source/cmake.cxx
  2. 1 1
      Source/cmake.h

+ 2 - 2
Source/cmake.cxx

@@ -524,9 +524,9 @@ void cmake::ReadListFile(const char *path)
 }
 
 // Parse the args
-void cmake::SetArgs(const std::vector<std::string>& args)
+void cmake::SetArgs(const std::vector<std::string>& args, bool directoriesSetBefore)
 {
-  bool directoriesSet = false;
+  bool directoriesSet = directoriesSetBefore;
   for(unsigned int i=1; i < args.size(); ++i)
     {
     std::string arg = args[i];

+ 1 - 1
Source/cmake.h

@@ -212,7 +212,7 @@ class cmake
   bool CommandExists(const char* name) const;
     
   ///! Parse command line arguments
-  void SetArgs(const std::vector<std::string>&);
+  void SetArgs(const std::vector<std::string>&, bool directoriesSetBefore = false);
 
   ///! Is this cmake running as a result of a TRY_COMPILE command
   bool GetIsInTryCompile() { return this->InTryCompile; }