mirror of https://github.com/encounter/SDL.git
cmake: Fix building for macOS with Xcode generator (thanks, dungaipara!).
Fixes Bugzilla #3625.
This commit is contained in:
parent
e3e6b4fd35
commit
f75caa2ff6
|
@ -433,11 +433,15 @@ if(USE_GCC OR USE_CLANG)
|
||||||
list(APPEND EXTRA_CFLAGS "-Wshadow")
|
list(APPEND EXTRA_CFLAGS "-Wshadow")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
|
if(APPLE)
|
||||||
check_c_compiler_flag("" HAVE_NO_UNDEFINED)
|
list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
|
||||||
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
else()
|
||||||
if(HAVE_NO_UNDEFINED)
|
set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
|
||||||
list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
|
check_c_compiler_flag("" HAVE_NO_UNDEFINED)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
|
||||||
|
if(HAVE_NO_UNDEFINED)
|
||||||
|
list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue