浏览代码

Build OpenAL on MSVC too.

Daniele Bartolini 11 年之前
父节点
当前提交
06ec520c40
共有 7 个文件被更改,包括 304 次插入37 次删除
  1. 8 8
      genie/crown.lua
  2. 33 1
      genie/genie.lua
  3. 38 7
      genie/openal.lua
  4. 3 2
      genie/toolchain.lua
  5. 19 19
      makefile
  6. 0 0
      third/openal/OpenAL32/config_linux/config.h
  7. 203 0
      third/openal/OpenAL32/config_vs2013/config.h

+ 8 - 8
genie/crown.lua

@@ -108,7 +108,7 @@ function crown_project(_name, _kind, _defines)
 				"$(PHYSX_SDK_ANDROID)/Include/vehicle",
 			}
 
-		configuration { "vs2012" }
+		configuration { "vs*" }
 			includedirs {
 				"$(PHYSX_SDK_WINDOWS)/Include",
 				"$(PHYSX_SDK_WINDOWS)/Include/common",
@@ -306,68 +306,68 @@ function crown_project(_name, _kind, _defines)
 			links {
 				"OpenGL32",
 				"lua51",
-				"OpenAL32",
+				"openal",
 				"dbghelp"
 			}
 
 		configuration { "debug", "x32", "vs*"}
 			links {
+				"bgfxDebug",
 				"PhysX3CharacterKinematicCHECKED_x86",
 				"PhysX3CHECKED_x86",
 				"PhysX3CommonCHECKED_x86",
 				"PhysX3CookingCHECKED_x86",
 				"PhysX3ExtensionsCHECKED",
-				"bgfxDebug"
 			}
 
 		configuration { "debug", "x64", "vs*" }
 			links {
+				"bgfxDebug",
 				"PhysX3CharacterKinematicCHECKED_x64",
 				"PhysX3CHECKED_x64",
 				"PhysX3CommonCHECKED_x64",
 				"PhysX3CookingCHECKED_x64",
 				"PhysX3ExtensionsCHECKED",
-				"bgfxDebug"
 			}
 
 		configuration { "development", "x32", "vs*" }
 			links {
+				"bgfxDebug",
 				"PhysX3CharacterKinematicPROFILE_x86",
 				"PhysX3PROFILE_x86",
 				"PhysX3CommonPROFILE_x86",
 				"PhysX3CookingPROFILE_x86",
 				"PhysX3ExtensionsPROFILE",
-				"bgfxDebug"
 			}
 
 		configuration { "development", "x64", "vs*" }
 			links {
+				"bgfxDebug",
 				"PhysX3CharacterKinematicPROFILE_x64",
 				"PhysX3PROFILE_x64",
 				"PhysX3CommonPROFILE_x64",
 				"PhysX3CookingPROFILE_x64",
 				"PhysX3ExtensionsPROFILE",
-				"bgfxDebug"
 			}
 
 		configuration { "release", "x32", "vs*" }
 			links {
+				"bgfxRelease",
 				"PhysX3CharacterKinematic_x86",
 				"PhysX3_x86",
 				"PhysX3Common_x86",
 				"PhysX3Cooking_x86",
 				"PhysX3Extensions",
-				"bgfxRelease"
 			}
 
 		configuration { "release", "x64", "vs*" }
 			links {
+				"bgfxRelease",
 				"PhysX3CharacterKinematic_x64",
 				"PhysX3_x64",
 				"PhysX3Common_x64",
 				"PhysX3Cooking_x64",
 				"PhysX3Extensions",
-				"bgfxRelease"
 			}
 
 		configuration {}

+ 33 - 1
genie/genie.lua

@@ -34,7 +34,7 @@ if _OPTIONS["with-openal"] then
 end
 
 dofile "crown.lua"
-crown_project("", "WindowedApp", {})
+crown_project("", "ConsoleApp", {})
 
 -- Install
 configuration { "android-arm" }
@@ -61,6 +61,11 @@ configuration { "x32", "vs*" }
 		"cp -r " .. CROWN_DIR .. ".build/win32/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/luajit.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32/",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.lib " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.exp " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.dll " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
+		"cp    " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/PhysX3* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
+		"cp    " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/nvToolsExt32_1.dll " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
 	}
 
 configuration { "x64", "vs*" }
@@ -68,6 +73,11 @@ configuration { "x64", "vs*" }
 		"cp -r " .. CROWN_DIR .. ".build/win64/bin/* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
 		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/luajit.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
 		"cp -r " .. CROWN_THIRD_DIR .. "luajit/src/jit " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64/",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.lib " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.exp " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64",
+		"cp    " .. CROWN_THIRD_DIR .. "luajit/src/lua51.dll " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64",
+		"cp    " .. "$(PHYSX_SDK_WINDOWS)/bin/win64/PhysX3* " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64",
+		"cp    " .. "$(PHYSX_SDK_WINDOWS)/bin/win32/nvToolsExt64_1.dll " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32",
 	}
 
 configuration { "debug or development", "x32", "linux-*" }
@@ -89,3 +99,25 @@ configuration { "release", "x64", "linux-*" }
 	postbuildcommands {
 		"cp " .. CROWN_THIRD_DIR .. "bgfx/.build/linux64_gcc/bin/shadercRelease " .. "$(CROWN_INSTALL_DIR)/" .. "bin/linux64"
 	}
+
+
+configuration { "debug or development", "x32", "vs*" }
+	postbuildcommands {
+		"cp " .. CROWN_THIRD_DIR .. "bgfx/.build/win32_vs2013/bin/shadercDebug.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32"
+	}
+
+configuration { "release", "x32", "vs*" }
+	postbuildcommands {
+		"cp " .. CROWN_THIRD_DIR .. "bgfx/.build/win32_vs2013/bin/shadercRelease.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win32"
+	}
+
+configuration { "debug or development", "x64", "vs*" }
+	postbuildcommands {
+		"cp " .. CROWN_THIRD_DIR .. "bgfx/.build/win64_vs2013/bin/shadercDebug.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64"
+	}
+
+configuration { "release", "x64", "vs*" }
+	postbuildcommands {
+		"cp " .. CROWN_THIRD_DIR .. "bgfx/.build/win64_vs2013/bin/shadercRelease.exe " .. "$(CROWN_INSTALL_DIR)/" .. "bin/win64"
+	}
+

+ 38 - 7
genie/openal.lua

@@ -15,26 +15,53 @@ project "openal"
 		"AL_BUILD_LIBRARY",
 		"_LARGEFILE_SOURCE",
 		"_LARGE_FILES",
-		"openal_EXPORTS",
 	}
 
-	configuration { "debug", "linux-*" }
+	configuration { "debug" }
 		defines {
 			"_DEBUG",
 		}
-		buildoptions {
-			"-g3",
-		}
 
-	configuration { "development or release", "linux-*" }
+	configuration { "development or release" }
 		defines {
 			"NDEBUG",
 		}
+
+	configuration { "development or release", "linux-*" }
 		buildoptions {
 			"-O2",
 			"-fomit-frame-pointer",
 		}
 
+	configuration { "vs*" }
+		defines {
+			"WIN32",
+			"_WINDOWS",
+			"_WIN32",
+			"_WIN32_WINNT=0x0502",
+			"restrict=",
+			"inline=__inline",
+			"_CRT_SECURE_NO_WARNINGS",
+			"_CRT_NONSTDC_NO_DEPRECATE",
+			"strcasecmp=_stricmp",
+			"strncasecmp=_strnicmp",
+			"snprintf=_snprintf",
+		}
+		buildoptions {
+			"/wd4098",
+		}
+		includedirs {
+			AL_DIR .. "OpenAL32/config_vs2013",
+		}
+		files {
+			AL_DIR .. "Alc/backends/mmdevapi.c",
+			AL_DIR .. "Alc/backends/dsound.c",
+			AL_DIR .. "Alc/backends/winmm.c",
+		}
+		links {
+			"winmm",
+		}
+
 	configuration { "linux-*" }
 		defines {
 			-- These are needed on non-Windows systems for extra features
@@ -90,16 +117,20 @@ project "openal"
 			"-fvisibility=hidden",
 			"-pthread",
 		}
+		includedirs {
+			AL_DIR .. "OpenAL32/config_linux",
+		}
 		files {
 			AL_DIR .. "Alc/backends/alsa.c",
 			AL_DIR .. "Alc/backends/pulseaudio.c",
 		}
 
+	configuration {}
+
 	includedirs {
 		AL_DIR .. "include",
 		AL_DIR .. "Alc",
 		AL_DIR .. "OpenAL32/Include",
-		AL_DIR .. "OpenAL32", -- for config.h
 	}
 
 	files {

+ 3 - 2
genie/toolchain.lua

@@ -266,6 +266,7 @@ function toolchain(build_dir, lib_dir)
 		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
+			"/ignore:4099", -- LNK4099: The linker was unable to find your .pdb file.
 		}
 
 	configuration { "x32", "vs*" }
@@ -274,7 +275,7 @@ function toolchain(build_dir, lib_dir)
 		libdirs {
 			lib_dir .. "luajit/src",
 			lib_dir .. "openal/lib",
-			lib_dir .. "bgfx/.build/win32_vs2012/bin",
+			lib_dir .. "bgfx/.build/win32_vs2013/bin",
 			"$(PHYSX_SDK_WINDOWS)/Lib/win32",
 			"$(DXSDK_DIR)/Lib/x86",
 		}
@@ -285,7 +286,7 @@ function toolchain(build_dir, lib_dir)
 		libdirs {
 			lib_dir .. "luajit/src",
 			lib_dir .. "openal/lib",
-			lib_dir .. "bgfx/.build/win64_vs2012/bin",
+			lib_dir .. "bgfx/.build/win64_vs2013/bin",
 			"$(PHYSX_SDK_WINDOWS)/Lib/win64",
 			"$(DXSDK_DIR)/Lib/x64",
 		}

+ 19 - 19
makefile

@@ -36,14 +36,14 @@ bgfx-linux-release32:
 	make -R -C third/bgfx linux-release32
 bgfx-linux-release64:
 	make -R -C third/bgfx linux-release64
-bgfx-vs2012-debug32:
-	make -R -C third/bgfx && make -R -C third/bgfx .build/projects/vs2012
-bgfx-vs2012-release32:
-	make -R -C third/bgfx && make -R -C third/bgfx .build/projects/vs2012
-bgfx-vs2012-debug64:
-	make -R -C third/bgfx && make -R -C third/bgfx .build/projects/vs2012
-bgfx-vs2012-release64:
-	make -R -C third/bgfx && make -R -C third/bgfx .build/projects/vs2012
+bgfx-vs2013-debug32:
+	make -R -C third/bgfx .build/projects/vs2013
+bgfx-vs2013-release32:
+	make -R -C third/bgfx .build/projects/vs2013
+bgfx-vs2013-debug64:
+	make -R -C third/bgfx .build/projects/vs2013
+bgfx-vs2013-release64:
+	make -R -C third/bgfx .build/projects/vs2013
 bgfx-android-arm-debug:
 	make -R -C third/bgfx android-arm-debug
 bgfx-android-arm-release:
@@ -55,10 +55,10 @@ deps-linux-debug32: luajit-linux32 bgfx-linux-debug32
 deps-linux-debug64: luajit-linux64 bgfx-linux-debug64
 deps-linux-release32: luajit-linux32 bgfx-linux-release32
 deps-linux-release64: luajit-linux64 bgfx-linux-release64
-deps-windows-debug32: luajit-windows32 bgfx-vs2012-debug32
-deps-windows-debug64: luajit-windows64 bgfx-vs2012-debug64
-deps-windows-release32: luajit-windows32 bgfx-vs2012-release32
-deps-windows-release64: luajit-windows64 bgfx-vs2012-release64
+deps-windows-debug32: luajit-windows32 bgfx-vs2013-debug32
+deps-windows-debug64: luajit-windows64 bgfx-vs2013-debug64
+deps-windows-release32: luajit-windows32 bgfx-vs2013-release32
+deps-windows-release64: luajit-windows64 bgfx-vs2013-release64
 deps-android-arm-debug: luajit-arm bgfx-android-arm-debug
 deps-android-arm-release: luajit-arm bgfx-android-arm-release
 deps-clean: luajit-clean bgfx-clean
@@ -90,19 +90,19 @@ android-arm-release: deps-android-arm-release android-build
 android-arm: android-arm-debug android-arm-development android-arm-release
 
 windows-build:
-	$(GENIE) --file=genie\genie.lua --with-openal vs2012
+	$(GENIE) --file=genie\genie.lua --with-openal vs2013
 windows-debug32: deps-windows-debug32 windows-build
-	devenv .build/windows/crown.sln /Build "debug|x32"
+	devenv .build/projects/vs2013/crown.sln /Build "debug|Win32"
 windows-development32: deps-windows-debug32 windows-build
-	devenv .build/windows/crown.sln /Build "development|x32"
+	devenv .build/projects/vs2013/crown.sln /Build "development|Win32"
 windows-release32: deps-windows-release32 windows-build
-	devenv .build/windows/crown.sln /Build "release|x32"
+	devenv .build/projects/vs2013/crown.sln /Build "release|Win32"
 windows-debug64: deps-windows-debug64 windows-build
-	devenv .build/windows/crown.sln /Build "debug|x64"
+	devenv .build/projects/vs2013/crown.sln /Build "debug|x64"
 windows-development64: deps-windows-debug64 windows-build
-	devenv .build/windows/crown.sln /Build "development|x64"
+	devenv .build/projects/vs2013/crown.sln /Build "development|x64"
 windows-release64: deps-windows-release64 windows-build
-	devenv .build/windows/crown.sln /Build "release|x64"
+	devenv .build/projects/vs2013/crown.sln /Build "release|x64"
 
 .PHONY: docs
 docs:

+ 0 - 0
third/openal/OpenAL32/config.h → third/openal/OpenAL32/config_linux/config.h


+ 203 - 0
third/openal/OpenAL32/config_vs2013/config.h

@@ -0,0 +1,203 @@
+/* API declaration export attribute */
+#define AL_API  __declspec(dllexport)
+#define ALC_API __declspec(dllexport)
+
+/* Define to the library version */
+#define ALSOFT_VERSION "1.16.0"
+
+#ifdef IN_IDE_PARSER
+/* KDevelop's parser doesn't recognize the C99-standard restrict keyword, but
+ * recent versions (at least 4.5.1) do recognize GCC's __restrict. */
+#define restrict __restrict
+#endif
+
+/* Define any available alignment declaration */
+#define ALIGN(x) __declspec(align(x))
+
+/* Define if we have the C11 aligned_alloc function */
+/* #undef HAVE_ALIGNED_ALLOC */
+
+/* Define if we have the posix_memalign function */
+/* #undef HAVE_POSIX_MEMALIGN */
+
+/* Define if we have the _aligned_malloc function */
+#define HAVE__ALIGNED_MALLOC
+
+/* Define if we have SSE CPU extensions */
+#define HAVE_SSE
+#define HAVE_SSE2
+/* #undef HAVE_SSE4_1 */
+
+/* Define if we have ARM Neon CPU extensions */
+/* #undef HAVE_NEON */
+
+/* Define if we have FluidSynth support */
+/* #undef HAVE_FLUIDSYNTH */
+
+/* Define if we have the ALSA backend */
+/* #undef HAVE_ALSA */
+
+/* Define if we have the OSS backend */
+/* #undef HAVE_OSS */
+
+/* Define if we have the Solaris backend */
+/* #undef HAVE_SOLARIS */
+
+/* Define if we have the SndIO backend */
+/* #undef HAVE_SNDIO */
+
+/* Define if we have the QSA backend */
+/* #undef HAVE_QSA */
+
+/* Define if we have the MMDevApi backend */
+#define HAVE_MMDEVAPI
+
+/* Define if we have the DSound backend */
+#define HAVE_DSOUND
+
+/* Define if we have the Windows Multimedia backend */
+#define HAVE_WINMM
+
+/* Define if we have the PortAudio backend */
+/* #undef HAVE_PORTAUDIO */
+
+/* Define if we have the PulseAudio backend */
+/* #undef HAVE_PULSEAUDIO */
+
+/* Define if we have the CoreAudio backend */
+/* #undef HAVE_COREAUDIO */
+
+/* Define if we have the OpenSL backend */
+/* #undef HAVE_OPENSL */
+
+/* Define if we have the Wave Writer backend */
+/* #undef HAVE_WAVE */
+
+/* Define if we have the stat function */
+#define HAVE_STAT
+
+/* Define if we have the lrintf function */
+#define HAVE_LRINTF
+
+/* Define if we have the strtof function */
+#define HAVE_STRTOF
+
+/* Define if we have the __int64 type */
+/* #undef HAVE___INT64 */
+
+/* Define to the size of a long int type */
+#define SIZEOF_LONG 4
+
+/* Define to the size of a long long int type */
+#define SIZEOF_LONG_LONG 8
+
+/* Define if we have C99 variable-length array support */
+/* #undef HAVE_C99_VLA */
+
+/* Define if we have C99 _Bool support */
+#define HAVE_C99_BOOL
+
+/* Define if we have C11 _Static_assert support */
+/* #undef HAVE_C11_STATIC_ASSERT */
+
+/* Define if we have C11 _Alignas support */
+/* #undef HAVE_C11_ALIGNAS */
+
+/* Define if we have C11 _Atomic support */
+/* #undef HAVE_C11_ATOMIC */
+
+/* Define if we have GCC's destructor attribute */
+/* #undef HAVE_GCC_DESTRUCTOR */
+
+/* Define if we have GCC's format attribute */
+/* #undef HAVE_GCC_FORMAT */
+
+/* Define if we have stdint.h */
+#define HAVE_STDINT_H
+
+/* Define if we have stdbool.h */
+#define HAVE_STDBOOL_H
+
+/* Define if we have stdalign.h */
+/* #undef HAVE_STDALIGN_H */
+
+/* Define if we have windows.h */
+#define HAVE_WINDOWS_H
+
+/* Define if we have dlfcn.h */
+/* #undef HAVE_DLFCN_H */
+
+/* Define if we have pthread_np.h */
+/* #undef HAVE_PTHREAD_NP_H */
+
+/* Define if we have alloca.h */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if we have malloc.h */
+#define HAVE_MALLOC_H
+
+/* Define if we have ftw.h */
+/* #undef HAVE_FTW_H */
+
+/* Define if we have io.h */
+#define HAVE_IO_H
+
+/* Define if we have strings.h */
+/* #undef HAVE_STRINGS_H */
+
+/* Define if we have cpuid.h */
+/* #undef HAVE_CPUID_H */
+
+/* Define if we have intrin.h */
+#define HAVE_INTRIN_H
+
+/* Define if we have sys/sysconf.h */
+/* #undef HAVE_SYS_SYSCONF_H */
+
+/* Define if we have guiddef.h */
+#define HAVE_GUIDDEF_H
+
+/* Define if we have initguid.h */
+/* #undef HAVE_INITGUID_H */
+
+/* Define if we have ieeefp.h */
+/* #undef HAVE_IEEEFP_H */
+
+/* Define if we have float.h */
+#define HAVE_FLOAT_H
+
+/* Define if we have fenv.h */
+#define HAVE_FENV_H
+
+/* Define if we have GCC's __get_cpuid() */
+/* #undef HAVE_GCC_GET_CPUID */
+
+/* Define if we have the __cpuid() intrinsic */
+#define HAVE_CPUID_INTRINSIC
+
+/* Define if we have _controlfp() */
+#define HAVE__CONTROLFP
+
+/* Define if we have __control87_2() */
+#define HAVE___CONTROL87_2
+
+/* Define if we have ftw() */
+/* #undef HAVE_FTW */
+
+/* Define if we have _wfindfirst() */
+#define HAVE__WFINDFIRST
+
+/* Define if we have pthread_setschedparam() */
+/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
+
+/* Define if we have pthread_setname_np() */
+/* #undef HAVE_PTHREAD_SETNAME_NP */
+
+/* Define if we have pthread_set_name_np() */
+/* #undef HAVE_PTHREAD_SET_NAME_NP */
+
+/* Define if we have pthread_mutexattr_setkind_np() */
+/* #undef HAVE_PTHREAD_MUTEXATTR_SETKIND_NP */
+
+/* Define if we have pthread_mutex_timedlock() */
+/* #undef HAVE_PTHREAD_MUTEX_TIMEDLOCK */