microsoft / omi

Open Management Infrastructure
Other
367 stars 116 forks source link

Can't build with MacOSX SDK #687

Closed gaelicWizard closed 9 months ago

gaelicWizard commented 3 years ago

Apple's SDKs have a macro "__API_AVAILABLE" which has an associated macro named just "macos"...but OMI's configure script adds "-Dmacos" to $CFLAGS so ń̥otḩing builds.

I realize that OMI for Mac for server config is a bit niche, but I'm actually trying to build it for client side. I'm using VSCode and would like to be able to compile DSC configs, &c.

Thanks, JP2

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:291:22: error: expected ',' API_AVAILABLE(macos(10.10), ios(8.0)) ^ In file included from pthread_rwlock_t_func.c:1: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:218:22: error: expected ',' API_AVAILABLE(macos(10.4), ios(2.0)) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:222:22: error: expected ',' API_AVAILABLE(macos(10.4), ios(2.0)) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:225:22: error: expected ',' __API_AVAILABLE(macos(10.4), ios(2.0)) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:228:22: error: expected ',' API_AVAILABLE(macos(10.4), ios(2.0)) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:231:22: error: expected ',' __API_AVAILABLE(macos(10.4), ios(2.0)) ^ fatal error: too many errors emitted, stopping now [-ferror-limit=]

gaelicWizard commented 3 years ago

It seems like this can be resolved by changing the "-Dmacos" to "-Dmacos=macos" in buildtool

polluks commented 3 years ago

@gaelicWizard Indeed, there's a name clash: We use the macro macos w/o parameter, Apple uses macos(version) w/ check for minimal version... See also https://stackoverflow.com/questions/142508/how-do-i-check-os-with-a-preprocessor-directive

JumpingYang001 commented 9 months ago

no supported scenarios.