Browse Source

Support for distributed AtomicEditor on Windows, default to x86 builds on Windows

JoshEngebretson 10 years ago
parent
commit
afdb4bf662

BIN
Build/Windows/Binaries/x86/D3DCompiler_47.dll


+ 6 - 1
CMake/Modules/AtomicWindows.cmake

@@ -5,7 +5,12 @@ set (JAVASCRIPT_BINDINGS_PLATFORM "WINDOWS")
 
 #set (CMAKE_DEBUG_POSTFIX _d)
 
-set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x64/D3DCompiler_47.dll)
+
+if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+    set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x64/D3DCompiler_47.dll)
+else()
+    set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x86/D3DCompiler_47.dll)
+endif()
 
 add_definitions(-DATOMIC_PLATFORM_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DATOMIC_TBUI)
 

+ 44 - 1
Rakefile

@@ -26,6 +26,7 @@ CMAKE_LINUX_BUILD_FOLDER = "#{ARTIFACTS_FOLDER}/Linux_Build"
 ATOMICTOOL_BIN_MACOSX = "#{CMAKE_MACOSX_BUILD_FOLDER}/Source/AtomicTool/Release/AtomicTool"
 
 PACKAGE_FOLDER_MACOSX = "#{ARTIFACTS_FOLDER}/MacOSX_Package"
+PACKAGE_FOLDER_WINDOWS = "#{ARTIFACTS_FOLDER}/Windows_Package"
 
 namespace :build  do
 
@@ -58,7 +59,7 @@ namespace :build  do
 
     Dir.chdir(CMAKE_WINDOWS_BUILD_FOLDER) do
 
-      sh "cmake ../../ -G \"Visual Studio 12 2013 Win64\""
+      sh "cmake ../../ -G \"Visual Studio 14 2015\""
       sh "msbuild /m Atomic.sln /p:Configuration=Release"
 
     end
@@ -170,6 +171,26 @@ namespace :clean do
 
   end
 
+
+  task :windows do
+
+    folders = ["#{CMAKE_WINDOWS_BUILD_FOLDER}", "#{PACKAGE_FOLDER_WINDOWS}"]
+
+    for index in 0 ... folders.size
+
+        if Dir.exists?(folders[index])
+          FileUtils.rmtree("#{folders[index]}")
+        end
+
+        if Dir.exists?(folders[index])
+            abort("Unable to clean #{folders[index]}")
+        end
+
+    end
+
+  end
+
+
 end
 
 
@@ -195,4 +216,26 @@ namespace :package  do
 
   end
 
+  task :windows => ["clean:windows", "build:windows"] do
+
+    FileUtils.mkdir_p("#{PACKAGE_FOLDER_WINDOWS}/Resources")
+
+    FileUtils.cp("#{CMAKE_WINDOWS_BUILD_FOLDER}/Source/AtomicEditor/Release/AtomicEditor.exe", "#{PACKAGE_FOLDER_WINDOWS}/AtomicEditor.exe" )
+
+    #32 bit build for packaging!
+
+
+    FileUtils.cp("#{$RAKE_ROOT}/Build/Windows/Binaries/x86/D3DCompiler_47.dll", "#{PACKAGE_FOLDER_WINDOWS}/D3DCompiler_47.dll" )
+
+    # copy resources
+
+    FileUtils.cp_r("#{$RAKE_ROOT}/Resources/CoreData",  "#{PACKAGE_FOLDER_WINDOWS}/Resources");
+    FileUtils.cp_r("#{$RAKE_ROOT}/Resources/EditorData", "#{PACKAGE_FOLDER_WINDOWS}/Resources");
+    FileUtils.cp_r("#{$RAKE_ROOT}/Resources/PlayerData", "#{PACKAGE_FOLDER_WINDOWS}/Resources");
+    FileUtils.cp_r("#{$RAKE_ROOT}/Script", "#{PACKAGE_FOLDER_WINDOWS}/Resources");
+    FileUtils.cp_r("#{$RAKE_ROOT}/Data/AtomicEditor/ProjectTemplates", "#{PACKAGE_FOLDER_WINDOWS}/Resources");
+
+  end
+
+
 end

+ 6 - 2
Source/AtomicEditor/Application/AEEditorApp.cpp

@@ -130,11 +130,15 @@ void AEEditorApp::Setup()
     engineParameters_["ResourcePaths"] = resourcePaths;
 #else
 
-#ifdef __APPLE__
+#ifdef ATOMIC_PLATFORM_OSX
     engineParameters_["ResourcePrefixPath"] = "../Resources";
-    engineParameters_["ResourcePaths"] = "CoreData;EditorData;Script";
+    
+#else
+	engineParameters_["ResourcePrefixPath"] = filesystem->GetProgramDir() + "Resources";
 #endif
 
+	engineParameters_["ResourcePaths"] = "CoreData;EditorData;Script";
+
 #endif // ATOMIC_DEV_BUILD
 
 

+ 2 - 0
Source/AtomicEditor/Application/AEPlayerApp.cpp

@@ -124,6 +124,8 @@ void AEPlayerApplication::Setup()
 
 #ifdef __APPLE__
                 engineParameters_["ResourcePrefixPath"] = "../Resources";
+#else
+				engineParameters_["ResourcePrefixPath"] = filesystem->GetProgramDir() + "Resources";
 #endif
 
                 String resourcePaths = ToString("CoreData;PlayerData;%s/;%s/Resources;%s;%sCache",

+ 4 - 4
Source/ToolCore/ToolEnvironment.cpp

@@ -32,15 +32,15 @@ bool ToolEnvironment::InitFromPackage()
     FileSystem* fileSystem = GetSubsystem<FileSystem>();
 
 #ifdef ATOMIC_PLATFORM_WINDOWS
-    editorBinary_ = rootBuildDir_ + fileSystem->GetProgramDir();
+	editorBinary_ = fileSystem->GetProgramDir() + "AtomicEditor.exe";
 #else
     editorBinary_ = fileSystem->GetProgramDir() + "AtomicEditor";
-    String resourcesDir = GetPath(RemoveTrailingSlash(fileSystem->GetProgramDir())) + "Resources/";
-    projectTemplatesDir_ = resourcesDir + "ProjectTemplates/";
 #endif
 
-    return true;
+	String resourcesDir = GetPath(RemoveTrailingSlash(fileSystem->GetProgramDir())) + "Resources/";
+	projectTemplatesDir_ = resourcesDir + "ProjectTemplates/";
 
+    return true;
 }
 
 bool ToolEnvironment::InitFromJSON(bool atomicTool)