{"action":"created","issue":{"url":"https://api.github.com/repos/SFML/SFML/issues/1436","repository_url":"https://api.github.com/repos/SFML/SFML","labels_url":"https://api.github.com/repos/SFML/SFML/issues/1436/labels{/name}","comments_url":"https://api.github.com/repos/SFML/SFML/issues/1436/comments","events_url":"https://api.github.com/repos/SFML/SFML/issues/1436/events","html_url":"https://github.com/SFML/SFML/issues/1436","id":322451075,"number":1436,"title":"CMAKE_OSX_DEPLOYMENT_TARGET setting is affecting targets outside of SFML","user":{"login":"ssrobins","id":14830765,"avatar_url":"https://avatars3.githubusercontent.com/u/14830765?v=4","gravatar_id":"","url":"https://api.github.com/users/ssrobins","html_url":"https://github.com/ssrobins","followers_url":"https://api.github.com/users/ssrobins/followers","following_url":"https://api.github.com/users/ssrobins/following{/other_user}","gists_url":"https://api.github.com/users/ssrobins/gists{/gist_id}","starred_url":"https://api.github.com/users/ssrobins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssrobins/subscriptions","organizations_url":"https://api.github.com/users/ssrobins/orgs","repos_url":"https://api.github.com/users/ssrobins/repos","events_url":"https://api.github.com/users/ssrobins/events{/privacy}","received_events_url":"https://api.github.com/users/ssrobins/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-05-11T22:22:21Z","updated_at":"2018-05-18T20:39:24Z","closed_at":null,"author_association":"NONE","body":"I build SFML by extracting the source into the CMake binary folder and use the CMake add_subdirectory command to add the targets to my build system.  That way, all I need to do to upgrade is change the version I'm targeting.\r\n\r\nAfter upgrading from SFML 2.4.2 to 2.5.0, I oddly started getting build errors in Google Test like this for Mac OS X:\r\n\r\ngtest-internal.h:894:44: error: no member named 'declval' in\r\n      namespace 'std'\r\n          class Iterator = decltype(::std::declval<const C&>().begin()),\r\n\r\nI'm using the CMake Makefile generator and then running 'make' to build.\r\n\r\nI traced it down to SFML setting CMAKE_OSX_DEPLOYMENT_TARGET to 10.7 if it didn't exist.\r\n\r\nI was able to work around the error by passing -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 in my CMake command.\r\n\r\nI don't think any library should be imposing settings on any other library, especially when they aren't dependent on each other.\r\n\r\nI'm not highly experienced on OS X version targeting, but here's what I've noticed so far:\r\n\r\nUp until this point, my variable CMAKE_OSX_DEPLOYMENT_TARGET had been blank.  Recently when I built a program on OS X 10.13.4 and tried to run it on OS X 10.11.6, it said I needed 10.13 or higher so I think the default target is the current OS X version.\r\n\r\nAccording to this:\r\nhttps://stackoverflow.com/questions/34208360/cmake-seems-to-ignore-cmake-osx-deployment-target\r\nThe variable has to be cached to work, which is unfortunate because that'll propagate it to the rest of the build system.\r\n\r\nThe CMake docs claim that it's initialized by MACOSX_DEPLOYMENT_TARGET environment variable, but mine was blank and I don't see that environment variable so I don't think it's present in a default config.\r\nhttps://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html\r\n\r\nThe CMAKE_OSX_SYSROOT on my machine looks like this:\r\nCMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk\r\n\r\nHow about this instead:\r\nDon't set CMAKE_OSX_DEPLOYMENT_TARGET at all\r\n\r\nIf CMAKE_OSX_DEPLOYMENT_TARGET is not set, grab the version from CMAKE_OSX_SYSROOT\r\n\r\nMake sure the value derived from the above logic is >= 10.7."},"comment":{"url":"https://api.github.com/repos/SFML/SFML/issues/comments/390325860","html_url":"https://github.com/SFML/SFML/issues/1436#issuecomment-390325860","issue_url":"https://api.github.com/repos/SFML/SFML/issues/1436","id":390325860,"user":{"login":"eXpl0it3r","id":920861,"avatar_url":"https://avatars1.githubusercontent.com/u/920861?v=4","gravatar_id":"","url":"https://api.github.com/users/eXpl0it3r","html_url":"https://github.com/eXpl0it3r","followers_url":"https://api.github.com/users/eXpl0it3r/followers","following_url":"https://api.github.com/users/eXpl0it3r/following{/other_user}","gists_url":"https://api.github.com/users/eXpl0it3r/gists{/gist_id}","starred_url":"https://api.github.com/users/eXpl0it3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eXpl0it3r/subscriptions","organizations_url":"https://api.github.com/users/eXpl0it3r/orgs","repos_url":"https://api.github.com/users/eXpl0it3r/repos","events_url":"https://api.github.com/users/eXpl0it3r/events{/privacy}","received_events_url":"https://api.github.com/users/eXpl0it3r/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T20:39:24Z","updated_at":"2018-05-18T20:39:24Z","author_association":"MEMBER","body":"Am I understanding this correctly that you can currently set OSX_DEPLOYMENT_TARGET manually with the first cmake command to a value that will work for both SFML and Google Test?\r\n\r\nHave you contacted Google Test and checked whether they think it might be a good idea to set OSX_DEPLOYMENT_TARGET if they expect a certain value anyways?"}}
{"actor":{"display_login":"eXpl0it3r"}}