Browse Source

update build

mikymod 11 năm trước cách đây
mục cha
commit
52aaf1daf5
2 tập tin đã thay đổi với 217 bổ sung4 xóa
  1. 8 2
      makefile
  2. 209 2
      premake/premake4.lua

+ 8 - 2
makefile

@@ -1,7 +1,7 @@
 UNAME := $(shell uname)
 ifeq ($(UNAME), $(filter $(UNAME), Linux))
 	OS=linux
-else ifeq ($(UNAME), $(filter $(UNAME), Windows))
+else
 	OS=windows
 endif
 
@@ -23,6 +23,7 @@ linux-release64:	linux-build
 	make -R -C .build/linux config=release64
 linux:	linux-debug32	linux-development32	linux-release32	linux-debug64	linux-development64	linux-release64
 
+
 android-build:
 	$(PREMAKE) --file=premake/premake4.lua --compiler=android gmake
 android-debug:	android-build
@@ -33,10 +34,15 @@ android-release:	android-build
 	make -R -C .build/android config=release
 android:	android-debug	android-development	android-release
 
+
+windows-build:
+	$(PREMAKE) --file=premake\premake4.lua vs2008
+windows-debug64:	windows-build
+	devenv .build/windows/crown.sln /Build "Debug|x64"
 # docs:
 # 	doxygen premake/crown.doxygen
 # 	# markdown README.md > .build/docs/readme.html
 
 clean:
 	@echo Cleaning...
-	-@rm -rf .build
+	@rm -rf .build

+ 209 - 2
premake/premake4.lua

@@ -98,8 +98,9 @@ solution "crown"
 	end
 
 	if _ACTION == "vs2010" or _ACTION == "vs2008" then
+
 		if not os.is("windows") then print("Action not valid in current OS.") end
-		if not os.getenv("DXSDK_DIR") then print("Set DXSDK_DIR environment variable.") end
+		if not os.getenv("DXSDK_DIR") then print("Environment variable DXSDK_DIR must be set.") end
 		location(CROWN_BUILD_DIR .. "windows")
 
 	end
@@ -501,4 +502,210 @@ solution "crown"
 				"	SceneQuery" ..
 				"	SimulationController" ..
 				") -Wl,--end-group"
-			}
+			}
+
+
+		-- it's necessary to define DXSDK_DIR env variable to DirectX sdk directory
+
+		configuration { "vs*" }
+			kind "ConsoleApp"
+
+			defines { "CROWN_WINDOWS" }
+
+			targetdir (CROWN_INSTALL_DIR .. "windows")
+
+			linkoptions {
+				"/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll
+				"/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
+
+			}
+			links { -- this is needed only for testing with GLES2/3 on Windows with VS2008
+				"DelayImp",
+			}
+			defines {
+				"WIN32",
+				"_WIN32",
+				"_HAS_EXCEPTIONS=0",
+				"_HAS_ITERATOR_DEBUGGING=0",
+				"_SCL_SECURE=0",
+				"_SECURE_SCL=0",
+				"_SCL_SECURE_NO_WARNINGS",
+				"_CRT_SECURE_NO_WARNINGS",
+				"_CRT_SECURE_NO_DEPRECATE"
+			}
+			buildoptions {
+				"/Oy-", -- Suppresses creation of frame pointers on the call stack.
+				"/Ob2", -- The Inline Function Expansion
+			}
+			links
+			{
+				"OpenGL32",
+				"lua51",
+				"OpenAL32"
+			}
+			includedirs {
+				CROWN_SOURCE_DIR .. "/engine/os/win",
+				CROWN_SOURCE_DIR .. "/engine/renderers/backend/gl/wgl"
+			}
+
+			libdirs
+			{
+				CROWN_THIRD_DIR .. "openal/lib"
+			}
+
+			excludes
+			{
+				CROWN_SOURCE_DIR .. "engine/os/android/*",
+				CROWN_SOURCE_DIR .. "engine/os/linux/*",
+				CROWN_SOURCE_DIR .. "engine/os/posix/*",
+				CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/egl/*",
+				CROWN_SOURCE_DIR .. "engine/renderers/backend/gl/glx/*",
+				CROWN_SOURCE_DIR .. "engine/audio/backend/SLESSoundWorld.cpp"
+			}
+
+		configuration { "vs2010" }
+			linkoptions { 
+				"/DELAYLOAD:\"libEGL.dll\"", -- this is needed only for testing with GLES2/3 on Windows with VS201x
+				"/DELAYLOAD:\"libGLESv2.dll\""
+			}
+
+		configuration { "vs*", "debug" }
+			links
+			{
+				"PhysX3ExtensionsCHECKED",
+				"PhysXProfileSDKCHECKED",
+				"PhysXVisualDebuggerSDKCHECKED",
+				"PxTaskCHECKED"
+			}
+
+		configuration { "vs*", "development" }
+			links
+			{
+				"PhysX3ExtensionsPROFILE",
+				"PhysXProfileSDKPROFILE",
+				"PhysXVisualDebuggerSDKPROFILE",
+				"PxTaskPROFILE"
+			}
+
+		configuration { "vs*", "release" }
+			links
+			{
+				"PhysX3Extensions",
+				"PhysXProfileSDK",
+				"PhysXVisualDebuggerSDK",
+				"PxTask",
+			}
+
+		configuration { "x32", "vs*" }
+			includedirs {
+				CROWN_THIRD_DIR .. "luajit/win32/include/luajit-2.0",
+				CROWN_THIRD_DIR .. "physx/win32/include",
+				CROWN_THIRD_DIR .. "physx/win32/include/common",
+				CROWN_THIRD_DIR .. "physx/win32/include/characterkinematic",
+				CROWN_THIRD_DIR .. "physx/win32/include/cloth",
+				CROWN_THIRD_DIR .. "physx/win32/include/common",
+				CROWN_THIRD_DIR .. "physx/win32/include/cooking",
+				CROWN_THIRD_DIR .. "physx/win32/include/extensions",
+				CROWN_THIRD_DIR .. "physx/win32/include/foundation",
+				CROWN_THIRD_DIR .. "physx/win32/include/geometry",
+				CROWN_THIRD_DIR .. "physx/win32/include/particles",
+				CROWN_THIRD_DIR .. "physx/win32/include/physxprofilesdk",
+				CROWN_THIRD_DIR .. "physx/win32/include/physxvisualdebuggersdk",
+				CROWN_THIRD_DIR .. "physx/win32/include/pvd",
+				CROWN_THIRD_DIR .. "physx/win32/include/pxtask",
+				CROWN_THIRD_DIR .. "physx/win32/include/RepX",
+				CROWN_THIRD_DIR .. "physx/win32/include/RepXUpgrader",
+				CROWN_THIRD_DIR .. "physx/win32/include/vehicle",
+				CROWN_THIRD_DIR .. "opengl",
+				CROWN_THIRD_DIR .. "openal/include",
+				CROWN_THIRD_DIR .. "freetype",
+				CROWN_THIRD_DIR .. "stb_image",
+				CROWN_THIRD_DIR .. "stb_vorbis"
+			}
+			libdirs
+			{
+				CROWN_THIRD_DIR .. "luajit/win32/lib",
+				CROWN_THIRD_DIR .. "physx/win32/lib"
+			}
+
+		configuration { "x64", "vs*" }
+			defines { "_WIN64" }
+
+			includedirs {
+				CROWN_THIRD_DIR .. "luajit/win64/include/luajit-2.0",
+				CROWN_THIRD_DIR .. "physx/win64/include",
+				CROWN_THIRD_DIR .. "physx/win64/include/common",
+				CROWN_THIRD_DIR .. "physx/win64/include/characterkinematic",
+				CROWN_THIRD_DIR .. "physx/win64/include/cloth",
+				CROWN_THIRD_DIR .. "physx/win64/include/common",
+				CROWN_THIRD_DIR .. "physx/win64/include/cooking",
+				CROWN_THIRD_DIR .. "physx/win64/include/extensions",
+				CROWN_THIRD_DIR .. "physx/win64/include/foundation",
+				CROWN_THIRD_DIR .. "physx/win64/include/geometry",
+				CROWN_THIRD_DIR .. "physx/win64/include/particles",
+				CROWN_THIRD_DIR .. "physx/win64/include/physxprofilesdk",
+				CROWN_THIRD_DIR .. "physx/win64/include/physxvisualdebuggersdk",
+				CROWN_THIRD_DIR .. "physx/win64/include/pvd",
+				CROWN_THIRD_DIR .. "physx/win64/include/pxtask",
+				CROWN_THIRD_DIR .. "physx/win64/include/RepX",
+				CROWN_THIRD_DIR .. "physx/win64/include/RepXUpgrader",
+				CROWN_THIRD_DIR .. "physx/win64/include/vehicle",
+				CROWN_THIRD_DIR .. "opengl",
+				CROWN_THIRD_DIR .. "openal/include",
+				CROWN_THIRD_DIR .. "freetype",
+				CROWN_THIRD_DIR .. "stb_image",
+				CROWN_THIRD_DIR .. "stb_vorbis"
+			}
+
+			libdirs {
+				CROWN_THIRD_DIR .. "luajit/win64/lib",
+				CROWN_THIRD_DIR .. "physx/win64/lib"
+			}
+
+		configuration { "debug", "x32", "vs*"}
+			links {
+				"PhysX3CharacterKinematicCHECKED_x86",
+				"PhysX3CHECKED_x86",
+				"PhysX3CommonCHECKED_x86",
+				"PhysX3CookingCHECKED_x86"
+			}
+
+		configuration { "debug", "x64", "vs*" }
+			links {
+				"PhysX3CharacterKinematicCHECKED_x64",
+				"PhysX3CHECKED_x64",
+				"PhysX3CommonCHECKED_x64",
+				"PhysX3CookingCHECKED_x64"
+			}
+
+		configuration { "development", "x32", "vs*" }
+			links {
+				"PhysX3CharacterKinematicPROFILE_x86",
+				"PhysX3PROFILE_x86",
+				"PhysX3CommonPROFILE_x86",
+				"PhysX3CookingPROFILE_x86"
+			}
+
+		configuration { "development", "x64", "vs*" }
+			links {
+				"PhysX3CharacterKinematicPROFILE_x64",
+				"PhysX3PROFILE_x64",
+				"PhysX3CommonPROFILE_x64",
+				"PhysX3CookingPROFILE_x64"
+			}
+
+		configuration { "debug", "x32", "vs*" }
+			links {
+				"PhysX3CharacterKinematic_x86",
+				"PhysX3_x86",
+				"PhysX3Common_x86",
+				"PhysX3Cooking_x86"
+			}
+			
+		configuration { "debug", "x64", "vs*" }
+			links {
+				"PhysX3CharacterKinematic_x64",
+				"PhysX3_x64",
+				"PhysX3Common_x64",
+				"PhysX3Cooking_x64"
+			}