浏览代码

Fixed CMake Win64 build configuration problem by working around the bug temporarily. Stream lined the Windows batch files for sample applications. Enhanced cmake_vs20xx to accept optional parameter to enable 64bit build. Updated documentation.

Wei Tjong Yao 12 年之前
父节点
当前提交
86a04ae472

+ 1 - 1
Bin/Chat.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Chat.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Chat.as %*

+ 1 - 1
Bin/ChatServer.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Chat.as server -headless %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Chat.as server -headless %*

+ 1 - 1
Bin/Editor.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Editor.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Editor.as %*

+ 1 - 1
Bin/LightTest.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/LightTest.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/LightTest.as %*

+ 1 - 1
Bin/Navigation.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Navigation.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Navigation.as %*

+ 1 - 1
Bin/NinjaSnowWar.bat

@@ -9,4 +9,4 @@
 ::   Start the server with "NinjaSnowWar -w server"
 ::   Start the server with "NinjaSnowWar -w server"
 ::   Start the client on the same host with "NinjaSnowWar -w -nobgm <put-your-host-name-here>"
 ::   Start the client on the same host with "NinjaSnowWar -w -nobgm <put-your-host-name-here>"
 ::
 ::
-Urho3D.exe Scripts/NinjaSnowWar.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/NinjaSnowWar.as %*

+ 1 - 1
Bin/Physics.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Physics.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Physics.as %*

+ 1 - 1
Bin/SpriteTest.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/SpriteTest.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/SpriteTest.as %*

+ 1 - 1
Bin/Terrain.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/Terrain.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/Terrain.as %*

+ 1 - 1
Bin/TestScene.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/TestScene.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/TestScene.as %*

+ 1 - 1
Bin/TestSceneOld.bat

@@ -1 +1 @@
-Urho3D.exe Scripts/TestSceneOld.as %1 %2 %3 %4 %5 %6 %7 %8
+Urho3D.exe Scripts/TestSceneOld.as %*

+ 2 - 2
Docs/GettingStarted.dox

@@ -82,9 +82,9 @@ To run from Xcode on iPhone/iPad Simulator, edit the Product Scheme to set "Run"
 
 
 \section Building_64bit Desktop 64bit build
 \section Building_64bit Desktop 64bit build
 
 
-To enable 64bit build for Visual Studio, run CMake using a 64bit solution generator, for example cmake -G "Visual Studio 9 2008 Win64". You will have to manually set the assembly source files (in AngelScript and LibCpuId projects) to compile using MASM. This is a CMake bug.
+Currently CMake build configuration has been set to compile Urho3D as 32bit by default. To enable 64bit build for Visual Studio, run one of the cmake_vs20xx.bat by passing the option "Win64" explicitly. This will overrides CMake to use a 64bit solution generator.
 
 
-Currently CMake build configuration has been set to compile Urho3D as 32bit by default for non-MSVC/non-Windows platform. To enable 64bit build, pass the option "-DENABLE_64BIT=1" explicitly when invoking cmake_eclipse.sh/cmake_macosx.sh/cmake_gcc.sh. Alternatively, you can modify the main CMakeLists.txt to enable 64bit by default for non-MSVC/non-Windows platform.
+To enable 64bit build for non-MSVC/non-Windows platform, pass the option "-DENABLE_64BIT=1" explicitly when invoking cmake_eclipse.sh/cmake_macosx.sh/cmake_gcc.sh. Alternatively, you can modify the main CMakeLists.txt to enable 64bit by default for non-MSVC/non-Windows platform.
 
 
 \section Building_Shaders Compiling Direct3D shaders
 \section Building_Shaders Compiling Direct3D shaders
 
 

+ 5 - 6
Readme.txt

@@ -242,13 +242,12 @@ to "Urho3D.app".
 Desktop 64bit build
 Desktop 64bit build
 -------------------
 -------------------
 
 
-To enable 64bit build for Visual Studio, run CMake using a 64bit solution
-generator, for example cmake -G "Visual Studio 9 2008 Win64". You will have to
-manually set the assembly source files (in AngelScript and LibCpuId projects)
-to compile using MASM. This is a CMake bug.
-
 Currently CMake build configuration has been set to compile Urho3D as 32bit by
 Currently CMake build configuration has been set to compile Urho3D as 32bit by
-default for non-MSVC/non-Windows platform. To enable 64bit build, pass the
+default. To enable 64bit build for Visual Studio, run one of the cmake_vs20xx.bat
+by passing the option "Win64" explicitly. This will overrides CMake to use a
+64bit solution generator.
+
+To enable 64bit build for non-MSVC/non-Windows platform, pass the
 option "-DENABLE_64BIT=1" explicitly when invoking cmake_eclipse.sh/
 option "-DENABLE_64BIT=1" explicitly when invoking cmake_eclipse.sh/
 cmake_macosx.sh/cmake_gcc.sh. Alternatively, you can modify the main 
 cmake_macosx.sh/cmake_gcc.sh. Alternatively, you can modify the main 
 CMakeLists.txt to enable 64bit by default for non-MSVC/non-Windows platform.
 CMakeLists.txt to enable 64bit by default for non-MSVC/non-Windows platform.

+ 6 - 1
ThirdParty/AngelScript/CMakeLists.txt

@@ -14,7 +14,12 @@ if (IOS)
 endif ()
 endif ()
 
 
 if (MSVC AND ENABLE_64BIT)
 if (MSVC AND ENABLE_64BIT)
-    set (ASM_FILES source/as_callfunc_x64_msvc_asm.asm)
+    # Commented out due to cmake bug
+    #enable_language(ASM_MASM)
+    #set (ASM_FILES source/as_callfunc_x64_msvc_asm.asm)
+    # As a temporary workaround
+    add_custom_command(OUTPUT as_callfunc_x64_msvc_asm.obj COMMAND ${CMAKE_ASM_MASM_COMPILER} -c source/as_callfunc_x64_msvc_asm.asm DEPENDS source/as_callfunc_x64_msvc_asm.asm COMMENT "Temporary workaround for MASM") 
+    set (ASM_FILES as_callfunc_x64_msvc_asm.obj)
 endif ()
 endif ()
 
 
 set (SOURCE_FILES ${CPP_FILES} ${ASM_FILES} ${H_FILES})
 set (SOURCE_FILES ${CPP_FILES} ${ASM_FILES} ${H_FILES})

+ 6 - 1
ThirdParty/LibCpuId/CMakeLists.txt

@@ -11,7 +11,12 @@ file (GLOB H_FILES
 )
 )
 
 
 if (MSVC AND ENABLE_64BIT)
 if (MSVC AND ENABLE_64BIT)
-    set (ASM_FILES libcpuid/masm-x64.asm)
+    # Commented out due to cmake bug
+    #enable_language(ASM_MASM)
+    #set (ASM_FILES libcpuid/masm-x64.asm)
+    # As a temporary workaround
+    add_custom_command(OUTPUT masm-x64.obj COMMAND ${CMAKE_ASM_MASM_COMPILER} -c libcpuid/masm-x64.asm DEPENDS libcpuid/masm-x64.asm COMMENT "Temporary workaround for MASM") 
+    set (ASM_FILES masm-x64.obj)
 endif ()
 endif ()
 
 
 set (SOURCE_FILES ${C_FILES} ${H_FILES} ${ASM_FILES})
 set (SOURCE_FILES ${C_FILES} ${H_FILES} ${ASM_FILES})

+ 3 - 1
cmake_vs2008.bat

@@ -1 +1,3 @@
-cmake -G "Visual Studio 9 2008"
+del /F CMakeCache.txt
+if "%1" == "Win64" set "arch= %1"
+cmake -G "Visual Studio 9 2008%arch%"

+ 3 - 1
cmake_vs2010.bat

@@ -1 +1,3 @@
-cmake -G "Visual Studio 10"
+del /F CMakeCache.txt
+if "%1" == "Win64" set "arch= %1"
+cmake -G "Visual Studio 10%arch%"

+ 3 - 1
cmake_vs2012.bat

@@ -1 +1,3 @@
-cmake -G "Visual Studio 11"
+del /F CMakeCache.txt
+if "%1" == "Win64" set "arch= %1"
+cmake -G "Visual Studio 11%arch%"