fix flac and ogg scripts so that the project can be built within a docker containter
This commit is contained in:
parent
e4a039bb87
commit
562888b62d
|
|
@ -36,6 +36,7 @@ function m.generateproject(liboutdir, intdir)
|
|||
"FLAC__NO_DLL",
|
||||
"CPU_IS_BIG_ENDIAN=0",
|
||||
"FLAC__HAS_OGG=1",
|
||||
"HAVE_INTTYPES_H",
|
||||
"PACKAGE_VERSION=\"\"",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,42 @@ local m = {}
|
|||
|
||||
local rootdir = path.join(path.getabsolute(path.getdirectory(_SCRIPT)), "../")
|
||||
|
||||
local function generate_config_header(include_dir)
|
||||
local output_file = path.join(include_dir, "ogg/config_types.h")
|
||||
|
||||
-- Only generate if it doesn't exist to avoid rebuilding every time
|
||||
if os.isfile(output_file) then return end
|
||||
|
||||
print("Generating " .. output_file)
|
||||
|
||||
-- "Modern" config_types.h content that uses stdint.h (works on 32 and 64 bit)
|
||||
local content = [[
|
||||
#ifndef __CONFIG_TYPES_H__
|
||||
#define __CONFIG_TYPES_H__
|
||||
|
||||
/* Generated automatically by Premake script */
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef uint16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef uint32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
typedef uint64_t ogg_uint64_t;
|
||||
|
||||
#endif
|
||||
]]
|
||||
|
||||
|
||||
local f = io.open(output_file, "w")
|
||||
if f then
|
||||
f:write(content)
|
||||
f:close()
|
||||
else
|
||||
print("Error: Failed to write to " .. output_file)
|
||||
end
|
||||
end
|
||||
|
||||
function m.generateproject(liboutdir, intdir)
|
||||
project"ogg"
|
||||
language"C" -- c++ will mangle names and sfml wont build
|
||||
|
|
@ -10,7 +46,11 @@ function m.generateproject(liboutdir, intdir)
|
|||
objdir(intdir)
|
||||
warnings"Off"
|
||||
|
||||
includedirs {path.join(rootdir, "ogg/include")}
|
||||
local include_path = path.join(rootdir, "ogg/include")
|
||||
|
||||
generate_config_header(include_path)
|
||||
|
||||
includedirs {include_path}
|
||||
|
||||
files
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue