Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miniaudio: Add support for split version and expose extra/nodes #5686

Merged
merged 14 commits into from
Nov 8, 2024

Conversation

SirLynix
Copy link
Member

@SirLynix SirLynix commented Nov 6, 2024

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

@SirLynix SirLynix marked this pull request as draft November 6, 2024 14:25
@SirLynix
Copy link
Member Author

SirLynix commented Nov 6, 2024

> clang "-MMD" "-MF" "/dev/null" "-pipe" "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" "-Qunused-arguments" "-arch" "arm64" "-miphoneos-version-min=17.5" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk" "-fobjc-arc"
error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/modules/private/action/build/object.lua:91: @programdir/modules/core/tools/gcc.lua:938: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:601:1: error: expected identifier or '('
@class NSString, Protocol;
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:603:9: error: unknown type name 'NSString'
typedef NSString * NSExceptionName NS_TYPED_EXTENSIBLE_ENUM;
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:604:9: error: unknown type name 'NSString'
typedef NSString * NSRunLoopMode NS_TYPED_EXTENSIBLE_ENUM;
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:606:19: error: unknown type name 'NSString'
FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:607:[44](https://github.com/xmake-io/xmake-repo/actions/runs/11706342602/job/32603226596?pr=5686#step:4:45): error: unknown type name 'NSString'
FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:609:19: error: unknown type name 'NSString'
FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
  > in extras/miniaudio_split/miniaudio.c

why doesn't it build as an objc file? (-fobjc flag)

@waruqi
Copy link
Member

waruqi commented Nov 7, 2024

> clang "-MMD" "-MF" "/dev/null" "-pipe" "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" "-Qunused-arguments" "-arch" "arm64" "-miphoneos-version-min=17.5" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk" "-fobjc-arc"
error: @programdir/core/main.lua:329: @programdir/actions/build/main.lua:148: @programdir/modules/async/runjobs.lua:325: @programdir/modules/private/action/build/object.lua:91: @programdir/modules/core/tools/gcc.lua:938: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:601:1: error: expected identifier or '('
@class NSString, Protocol;
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:603:9: error: unknown type name 'NSString'
typedef NSString * NSExceptionName NS_TYPED_EXTENSIBLE_ENUM;
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:604:9: error: unknown type name 'NSString'
typedef NSString * NSRunLoopMode NS_TYPED_EXTENSIBLE_ENUM;
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:606:19: error: unknown type name 'NSString'
FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
                  ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:607:[44](https://github.com/xmake-io/xmake-repo/actions/runs/11706342602/job/32603226596?pr=5686#step:4:45): error: unknown type name 'NSString'
FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
                                           ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:609:19: error: unknown type name 'NSString'
FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
  > in extras/miniaudio_split/miniaudio.c

why doesn't it build as an objc file? (-fobjc flag)

package:has_cfuncs only check code snippet as c code, not objc code.

but -fobjc is only for objc, not c

@SirLynix
Copy link
Member Author

SirLynix commented Nov 7, 2024

it fails in on_install, when compiling miniaudio.c which should be treated as an objective C file on iOS, which is why I used

add_files("extras/miniaudio_split/miniaudio.c", {sourcekind = "mm"})

but xmake still doesn't pass the -fobjc flag, how to make xmake treat miniaudio.c like an .m file?

@waruqi
Copy link
Member

waruqi commented Nov 7, 2024

you can use os.mv to rename it in on_install

@SirLynix
Copy link
Member Author

SirLynix commented Nov 7, 2024

I will do that, but does it mean sourcekind is broken for add_files?

@SirLynix
Copy link
Member Author

SirLynix commented Nov 7, 2024

error: @programdir/core/package/package.lua:2473: package(miniaudio): links not found!

any reason this doesn't work? I found it in another package:

    on_load(function (package)
        if package:config("headeronly") then
            package:set("kind", "library", {headeronly = true})
        end
    end)

@SirLynix
Copy link
Member Author

SirLynix commented Nov 7, 2024

nvm I just noticed I have two on_load functions 😓

@SirLynix SirLynix marked this pull request as ready for review November 7, 2024 11:21
@waruqi waruqi merged commit c8bd247 into dev Nov 8, 2024
67 checks passed
@waruqi waruqi deleted the SirLynix-patch-2 branch November 8, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants