cmake: fix testnative for Macos

This commit is contained in:
Anonymous Maarten 2023-03-28 03:22:29 +02:00
parent 1259a60731
commit cb076b83ff

View file

@ -179,11 +179,11 @@ if(SDL3_TESTS_SUBPROJECT)
testnativecocoa.m testnativecocoa.m
testnativex11.c testnativex11.c
) )
target_compile_definitions(testnative PRIVATE TEST_NATIVE_COCOA)
cmake_push_check_state() cmake_push_check_state()
check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
cmake_pop_check_state() cmake_pop_check_state()
target_link_libraries(testnative PRIVATE "-Wl,-framework,Cocoa")
if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS)
set_property(SOURCE "testnativecocoa.m" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error=deprecated-declarations") set_property(SOURCE "testnativecocoa.m" APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error=deprecated-declarations")
endif() endif()