Allow libmad to be compiled in Windows.
This removes the need for an externally built library, thus officially removing the deprecated Xbox projects. Other minimal changes were made to ensure consistency. Comments will be made in the PR. Thanks to @Prcuvu for the initial push.
This commit is contained in:
+34
-5
@@ -48,28 +48,51 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
# Checks the standard include directories for c-style headers.
|
||||
# We may use C++ in this project, but the check works better with plain C headers.
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files(math.h HAVE_MATH_H)
|
||||
check_include_files(alloca.h HAVE_ALLOCA_H)
|
||||
check_include_files(assert.h HAVE_ASSERT_H)
|
||||
check_include_files(dlfcn.h HAVE_DLFCN_H)
|
||||
check_include_files(dirent.h HAVE_DIRENT_H)
|
||||
check_include_files(errno.h HAVE_ERRNO_H)
|
||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_files(float.h HAVE_FLOAT_H)
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(limits.h HAVE_LIMITS_H)
|
||||
check_include_files(math.h HAVE_MATH_H)
|
||||
check_include_files(memory.h HAVE_MEMORY_H)
|
||||
check_include_files(stdarg.h HAVE_STDARG_H)
|
||||
check_include_files(stddef.h HAVE_STDDEF_H)
|
||||
check_include_files(stdint.h HAVE_STDINT_H)
|
||||
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files(strings.h HAVE_STRINGS_H)
|
||||
check_include_files(string.h HAVE_STRING_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
||||
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
|
||||
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
|
||||
|
||||
check_include_files(endian.h HAVE_ENDIAN_H)
|
||||
check_include_files(sys/endian.h HAVE_SYS_ENDIAN_H)
|
||||
check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
|
||||
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
if (HAVE_STDLIB_H AND HAVE_STDARG_H AND HAVE_STRING_H AND HAVE_FLOAT_H)
|
||||
set(STDC_HEADERS 1)
|
||||
endif()
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckCXXSymbolExists)
|
||||
|
||||
if (WIN32 AND MSVC)
|
||||
check_function_exists(_mkdir HAVE__MKDIR)
|
||||
check_function_exists(_snprintf HAVE__SNPRINTF)
|
||||
else()
|
||||
check_function_exists(fcntl HAVE_FCNTL)
|
||||
check_function_exists(fork HAVE_FORK)
|
||||
check_function_exists(mkdir HAVE_MKDIR)
|
||||
check_function_exists(snprintf HAVE_SNPRINTF)
|
||||
check_function_exists(waitpid HAVE_WAITPID)
|
||||
endif()
|
||||
check_cxx_symbol_exists(powf cmath HAVE_POWF)
|
||||
check_cxx_symbol_exists(sqrtf cmath HAVE_SQRTF)
|
||||
@@ -85,6 +108,12 @@ check_symbol_exists(M_PI math.h HAVE_M_PI)
|
||||
|
||||
# Checks to make it easier to work with 32-bit/64-bit builds if required.
|
||||
include(CheckTypeSize)
|
||||
check_type_size(short SIZEOF_SHORT)
|
||||
check_type_size(int SIZEOF_INT)
|
||||
check_type_size(long SIZEOF_LONG)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||
check_type_size(float SIZEOF_FLOAT)
|
||||
check_type_size(double SIZEOF_DOUBLE)
|
||||
check_type_size(intptr_t SIZEOF_INTPTR_T)
|
||||
check_type_size(pid_t SIZEOF_PID_T)
|
||||
check_type_size(size_t SIZEOF_SIZE_T)
|
||||
|
||||
Reference in New Issue
Block a user