Closed dourgulf closed 2 years ago
if I change CMakeLists.txt line 234
if(PLATFORM MATCHES "mac")
to
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
this error will be solved.
But i don't know how to change others like where:
if(PLATFORM STREQUAL "mac32")
target_link_libraries(test_server xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(test_client xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(demo_server xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
target_link_libraries(demo_client xquic -lm ${CMAKE_CURRENT_SOURCE_DIR}/../libevent32/lib/libevent.dylib)
elseif(PLATFORM STREQUAL "mac")
target_link_libraries(test_server xquic -lm -L/usr/local/lib -levent)
target_link_libraries(test_client xquic -lm -L/usr/local/lib -levent)
target_link_libraries(demo_server xquic -lm -L/usr/local/lib -levent)
target_link_libraries(demo_client xquic -lm -L/usr/local/lib -levent)
else()
target_link_libraries(test_server xquic -levent -lm)
target_link_libraries(test_client xquic -levent -lm)
target_link_libraries(demo_server xquic -levent -lm)
target_link_libraries(demo_client xquic -levent -lm)
endif()
Hi, try to use the cmake variables -DPLATFORM=mac
to build xquic on MacOS as mentioned in https://github.com/alibaba/xquic/blob/main/docs/Platforms.md#macos-release. #12 Problem resolved after add -DPLATFORM=mac flag.
What happened?
execute
cmake -j
failed ld: unknown option: --whole-archive clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [libxquic.dylib] Error 1 make[1]: [CMakeFiles/xquic.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....Steps To Reproduce
cmake -j
failed ld: unknown option: --whole-archive clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [libxquic.dylib] Error 1 make[1]: [CMakeFiles/xquic.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....Relevant log output