Commit 7ef84fdb authored by mercury233's avatar mercury233 Committed by GitHub

fix usage of os.findheader (#2795)

* remove invalid param miniaudio-lib-dir

* add missing opusfile-include-dir

* fix OGG_LIB_DIR

* use brew --prefix

* fix usage of os.findheader
parent c471f388
...@@ -313,9 +313,7 @@ jobs: ...@@ -313,9 +313,7 @@ jobs:
- name: Use premake to generate make files - name: Use premake to generate make files
run: | run: |
./premake5 gmake \ ./premake5 gmake
--freetype-include-dir="/usr/include/freetype2" \
--opus-include-dir="/usr/include/opus"
- name: Make - name: Make
run: | run: |
...@@ -406,31 +404,24 @@ jobs: ...@@ -406,31 +404,24 @@ jobs:
cp -r premake/* . cp -r premake/* .
cp -r resource/* . cp -r resource/* .
- name: Use premake to generate make files (Intel) - name: Use premake to generate make files
if: runner.arch == 'X64'
run: |
./premake5 gmake \
--cc=clang \
--freetype-include-dir="/usr/local/include/freetype2" \
--opus-include-dir="/usr/local/include/opus"
- name: Use premake to generate make files (ARM64)
if: runner.arch == 'ARM64'
run: | run: |
./premake5 gmake \ ./premake5 gmake \
--cc=clang \ --cc=clang \
--event-include-dir="/opt/homebrew/include" \ --event-include-dir="$(brew --prefix libevent)/include" \
--event-lib-dir="/opt/homebrew/lib" \ --event-lib-dir="$(brew --prefix libevent)/lib" \
--freetype-include-dir="/opt/homebrew/include/freetype2" \ --freetype-include-dir="$(brew --prefix freetype)/include/freetype2" \
--freetype-lib-dir="/opt/homebrew/lib" \ --freetype-lib-dir="$(brew --prefix freetype)/lib" \
--sqlite-include-dir="/opt/homebrew/opt/sqlite/include" \ --sqlite-include-dir="$(brew --prefix sqlite)/include" \
--sqlite-lib-dir="/opt/homebrew/opt/sqlite/lib" \ --sqlite-lib-dir="$(brew --prefix sqlite)/lib" \
--miniaudio-include-dir="/opt/homebrew/include" \ --ogg-include-dir="$(brew --prefix libogg)/include" \
--miniaudio-lib-dir="/opt/homebrew/lib" \ --ogg-lib-dir="$(brew --prefix libogg)/lib" \
--opus-include-dir="/opt/homebrew/include/opus" \ --opus-include-dir="$(brew --prefix opus)/include/opus" \
--opus-lib-dir="/opt/homebrew/lib" \ --opus-lib-dir="$(brew --prefix opus)/lib" \
--vorbis-include-dir="/opt/homebrew/include" \ --opusfile-include-dir="$(brew --prefix opusfile)/include/opus" \
--vorbis-lib-dir="/opt/homebrew/lib" --opusfile-lib-dir="$(brew --prefix opusfile)/lib" \
--vorbis-include-dir="$(brew --prefix libvorbis)/include" \
--vorbis-lib-dir="$(brew --prefix libvorbis)/lib"
- name: Make - name: Make
run: | run: |
......
...@@ -49,7 +49,7 @@ project "YGOPro" ...@@ -49,7 +49,7 @@ project "YGOPro"
includedirs { "../miniaudio/extras/decoders/libopus", "../miniaudio/extras/decoders/libvorbis" } includedirs { "../miniaudio/extras/decoders/libopus", "../miniaudio/extras/decoders/libvorbis" }
if not MINIAUDIO_BUILD_OPUS_VORBIS then if not MINIAUDIO_BUILD_OPUS_VORBIS then
links { "opusfile", "vorbisfile", "opus", "vorbis", "ogg" } links { "opusfile", "vorbisfile", "opus", "vorbis", "ogg" }
libdirs { OPUS_LIB_DIR, VORBIS_LIB_DIR, OGG_LIBDIR } libdirs { OPUS_LIB_DIR, OPUSFILE_LIB_DIR, VORBIS_LIB_DIR, OGG_LIB_DIR }
end end
end end
end end
......
...@@ -123,7 +123,7 @@ project "miniaudio" ...@@ -123,7 +123,7 @@ project "miniaudio"
"OPUS_HAVE_RTCD", "OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2", "OPUS_HAVE_RTCD", "OPUS_X86_MAY_HAVE_SSE", "OPUS_X86_MAY_HAVE_SSE4_1", "OPUS_X86_MAY_HAVE_AVX2",
} }
else else
includedirs { OPUS_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR } includedirs { OPUS_INCLUDE_DIR, OPUSFILE_INCLUDE_DIR, VORBIS_INCLUDE_DIR, OGG_INCLUDE_DIR }
end end
end end
......
...@@ -46,14 +46,14 @@ newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", descri ...@@ -46,14 +46,14 @@ newoption { trigger = "irrlicht-lib-dir", category = "YGOPro - irrlicht", descri
newoption { trigger = "no-audio", category = "YGOPro", description = "" } newoption { trigger = "no-audio", category = "YGOPro", description = "" }
newoption { trigger = "audio-lib", category = "YGOPro", description = "", value = "miniaudio, irrklang", default = AUDIO_LIB } newoption { trigger = "audio-lib", category = "YGOPro", description = "", value = "miniaudio, irrklang", default = AUDIO_LIB }
newoption { trigger = "miniaudio-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "miniaudio-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "miniaudio-support-opus-vorbis", category = "YGOPro - miniaudio", description = "" } newoption { trigger = "miniaudio-support-opus-vorbis", category = "YGOPro - miniaudio", description = "" }
newoption { trigger = "no-miniaudio-support-opus-vorbis", category = "YGOPro - miniaudio", description = "" } newoption { trigger = "no-miniaudio-support-opus-vorbis", category = "YGOPro - miniaudio", description = "" }
newoption { trigger = "build-opus-vorbis", category = "YGOPro - miniaudio", description = "" } newoption { trigger = "build-opus-vorbis", category = "YGOPro - miniaudio", description = "" }
newoption { trigger = "no-build-opus-vorbis", category = "YGOPro - miniaudio", description = "" } newoption { trigger = "no-build-opus-vorbis", category = "YGOPro - miniaudio", description = "" }
newoption { trigger = "opus-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" } newoption { trigger = "opus-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "opus-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" } newoption { trigger = "opus-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "opusfile-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "opusfile-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "vorbis-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" } newoption { trigger = "vorbis-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "vorbis-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" } newoption { trigger = "vorbis-lib-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
newoption { trigger = "ogg-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" } newoption { trigger = "ogg-include-dir", category = "YGOPro - miniaudio", description = "", value = "PATH" }
...@@ -86,7 +86,7 @@ if not BUILD_LUA then ...@@ -86,7 +86,7 @@ if not BUILD_LUA then
-- at most times you need to change this if you change BUILD_LUA to false -- at most times you need to change this if you change BUILD_LUA to false
-- make sure your lua lib is built with C++ and version >= 5.3 -- make sure your lua lib is built with C++ and version >= 5.3
LUA_LIB_NAME = GetParam("lua-lib-name") LUA_LIB_NAME = GetParam("lua-lib-name")
LUA_INCLUDE_DIR = GetParam("lua-include-dir") or os.findheader(LUA_LIB_NAME) LUA_INCLUDE_DIR = GetParam("lua-include-dir") or os.findheader("lua.h")
LUA_LIB_DIR = GetParam("lua-lib-dir") or os.findlib(LUA_LIB_NAME) LUA_LIB_DIR = GetParam("lua-lib-dir") or os.findlib(LUA_LIB_NAME)
end end
...@@ -96,7 +96,7 @@ elseif GetParam("no-build-event") then ...@@ -96,7 +96,7 @@ elseif GetParam("no-build-event") then
BUILD_EVENT = false BUILD_EVENT = false
end end
if not BUILD_EVENT then if not BUILD_EVENT then
EVENT_INCLUDE_DIR = GetParam("event-include-dir") or os.findheader("event") EVENT_INCLUDE_DIR = GetParam("event-include-dir") or os.findheader("event2/event.h")
EVENT_LIB_DIR = GetParam("event-lib-dir") or os.findlib("event") EVENT_LIB_DIR = GetParam("event-lib-dir") or os.findlib("event")
end end
...@@ -106,7 +106,7 @@ elseif GetParam("no-build-freetype") then ...@@ -106,7 +106,7 @@ elseif GetParam("no-build-freetype") then
BUILD_FREETYPE = false BUILD_FREETYPE = false
end end
if not BUILD_FREETYPE then if not BUILD_FREETYPE then
FREETYPE_INCLUDE_DIR = GetParam("freetype-include-dir") or os.findheader("freetype") FREETYPE_INCLUDE_DIR = GetParam("freetype-include-dir") or os.findheader("freetype2/ft2build.h") .. "/freetype2"
FREETYPE_LIB_DIR = GetParam("freetype-lib-dir") or os.findlib("freetype") FREETYPE_LIB_DIR = GetParam("freetype-lib-dir") or os.findlib("freetype")
end end
...@@ -116,7 +116,7 @@ elseif GetParam("no-build-sqlite") then ...@@ -116,7 +116,7 @@ elseif GetParam("no-build-sqlite") then
BUILD_SQLITE = false BUILD_SQLITE = false
end end
if not BUILD_SQLITE then if not BUILD_SQLITE then
SQLITE_INCLUDE_DIR = GetParam("sqlite-include-dir") or os.findheader("sqlite3") SQLITE_INCLUDE_DIR = GetParam("sqlite-include-dir") or os.findheader("sqlite3.h")
SQLITE_LIB_DIR = GetParam("sqlite-lib-dir") or os.findlib("sqlite3") SQLITE_LIB_DIR = GetParam("sqlite-lib-dir") or os.findlib("sqlite3")
end end
...@@ -126,7 +126,7 @@ elseif GetParam("no-build-irrlicht") then ...@@ -126,7 +126,7 @@ elseif GetParam("no-build-irrlicht") then
BUILD_IRRLICHT = false BUILD_IRRLICHT = false
end end
if not BUILD_IRRLICHT then if not BUILD_IRRLICHT then
IRRLICHT_INCLUDE_DIR = GetParam("irrlicht-include-dir") or os.findheader("irrlicht") IRRLICHT_INCLUDE_DIR = GetParam("irrlicht-include-dir") or os.findheader("irrlicht.h")
IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or os.findlib("irrlicht") IRRLICHT_LIB_DIR = GetParam("irrlicht-lib-dir") or os.findlib("irrlicht")
end end
...@@ -163,12 +163,14 @@ if USE_AUDIO then ...@@ -163,12 +163,14 @@ if USE_AUDIO then
MINIAUDIO_BUILD_OPUS_VORBIS = true MINIAUDIO_BUILD_OPUS_VORBIS = true
end end
if not MINIAUDIO_BUILD_OPUS_VORBIS then if not MINIAUDIO_BUILD_OPUS_VORBIS then
OPUS_INCLUDE_DIR = GetParam("opus-include-dir") or os.findheader("opus") OPUS_INCLUDE_DIR = GetParam("opus-include-dir") or os.findheader("opus/opus.h") .. "/opus"
OPUS_LIB_DIR = GetParam("opus-lib-dir") or os.findlib("opusfile") OPUS_LIB_DIR = GetParam("opus-lib-dir") or os.findlib("opus")
VORBIS_INCLUDE_DIR = GetParam("vorbis-include-dir") or os.findheader("vorbis") OPUSFILE_INCLUDE_DIR = GetParam("opusfile-include-dir") or os.findheader("opus/opusfile.h") .. "/opus"
OPUSFILE_LIB_DIR = GetParam("opusfile-lib-dir") or os.findlib("opusfile")
VORBIS_INCLUDE_DIR = GetParam("vorbis-include-dir") or os.findheader("vorbis/vorbisfile.h")
VORBIS_LIB_DIR = GetParam("vorbis-lib-dir") or os.findlib("vorbis") VORBIS_LIB_DIR = GetParam("vorbis-lib-dir") or os.findlib("vorbis")
OGG_INCLUDE_DIR = GetParam("ogg-include-dir") or os.findheader("ogg") OGG_INCLUDE_DIR = GetParam("ogg-include-dir") or os.findheader("ogg/ogg.h")
OCG_LIB_DIR = GetParam("ogg-lib-dir") or os.findlib("ogg") OGG_LIB_DIR = GetParam("ogg-lib-dir") or os.findlib("ogg")
end end
end end
elseif AUDIO_LIB == "irrklang" then elseif AUDIO_LIB == "irrklang" then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment