I'm trying to get rid of linker-signed out of my xxx.dylib. So according to this, I added -no_adhoc_codesign
to linker flag with -DCMAKE_SHARED_LINKER_FLAGS="-no_adhoc_codesign"
but it seems clang has no idea about this flag. ld does have this option
clang: error: unknown argument: '-no_adhoc_codesign'
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c --version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
CodePudding user response:
You can use -Wl,-no_adhoc_codesign
to pass the option directly to the linker if the compiler doesn't support adding the option itself.