SoftwareNetwork / sw

Software Manager. Build System, Build System Generator and Package Manager. C/C++ and other languages. Tools and libraries for Software Management.
https://software-network.org
Other
118 stars 24 forks source link

Set Mac OS X deployment target #51

Closed ollydev closed 4 years ago

ollydev commented 4 years ago

Would it be possible to get an option to set MacOS target? I believe currently anything built with SW only runs on the latest macos version.

I think the option for apple clang is: -mmacosx-version-min=<value> Set Mac OS X deployment target

Thanks

egorpugin commented 4 years ago

Do you mean programs built by sw or sw binary itself?

ollydev commented 4 years ago

Programs built by SW. It would be similar to how the win-mt flag is done, just passing a extra option to the compiler?

egorpugin commented 4 years ago

There is no such flag at the moment. There is -os flag. Probably we could support version there. Like -os macos-10.14. What do you think? Is it understandable for you, other users?

ollydev commented 4 years ago

That would be perfect.

ollydev commented 4 years ago

It's the following in cmake: SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version" FORCE)

egorpugin commented 4 years ago

Yes, but we also need or be able to control: 1) win sdk version 2) linux kernel version

...using some uniform syntax. -os looks good to me too.

ollydev commented 4 years ago

I'm not sure other OS really apply to this. There doesn't exists flags for the other compilers (gcc, cl.exe) if you want a different kernel/sdk. You have to reinstall.

If this is correct maybe a new flag like -macos-version 10.13 would be more sufficient.

egorpugin commented 4 years ago

There doesn't exists flags for the other compilers (gcc, cl.exe) if you want a different kernel/sdk.

Yes, but sw will handle this in different ways for different OSes. For example, for windows it will set specific sdk version dependency. For linux - something else. (Maybe syscall list or linux kernel headers version.)

egorpugin commented 4 years ago

https://github.com/SoftwareNetwork/sw/commit/ac7229536a141084951bfdb638c68084e125a1db You can try it on macos. Pass -os macos-10.13 or other version. Even -os macos-10.14,macos-10.15. Add -trace to see commands as is to check for command line flag there.

ollydev commented 4 years ago

Everything apart from macOS is broken if you're not aware: https://github.com/SoftwareNetwork/sw/runs/1115062720

Downloading database from origin remote
/home/runner/work/_temp/d9e4c3d7-5f74-4f9d-b4cb-71ec6ed09d87.sh: line 1:  4266 Segmentation fault      (core dumped) ./sw -static build
egorpugin commented 4 years ago

Yes, I see. Cannot repro yet.

ollydev commented 4 years ago

-os macos-10.13 worked well. Thanks! 😄

egorpugin commented 4 years ago

Feel free to report any other issues or feature requests!