From 7d7ab70279df554959eec29ff43a2eb304a3d578 Mon Sep 17 00:00:00 2001 From: Johannes Ekberg Date: Wed, 24 Dec 2014 10:34:25 +0100 Subject: Generic PLATFORM_LIBRARIES var This both reduces redundancy in add_executable definitions, and makes it easier to link additional libraries. In particular, extra libraries are needed on OSX - see next commit. --- src/citra/CMakeLists.txt | 12 +----------- src/citra_qt/CMakeLists.txt | 9 +-------- 2 files changed, 2 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index bbb3374f2..7f3ab3e07 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -16,20 +16,10 @@ create_directory_groups(${SRCS} ${HEADERS}) add_executable(citra ${SRCS} ${HEADERS}) target_link_libraries(citra core common video_core) target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih) +target_link_libraries(citra ${PLATFORM_LIBRARIES}) if (UNIX) target_link_libraries(citra -pthread) endif() -if (APPLE) - target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY}) -elseif (WIN32) - target_link_libraries(citra winmm wsock32 ws2_32) - if (MINGW) # GCC does not support codecvt, so use iconv instead - target_link_libraries(citra iconv) - endif() -else() # Unix - target_link_libraries(citra rt) -endif() - #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index a0ba252b3..420bede1e 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -60,17 +60,10 @@ endif() add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) target_link_libraries(citra-qt core common video_core qhexedit) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) +target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) if (UNIX) target_link_libraries(citra-qt -pthread) endif() -if (APPLE) - target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY}) -elseif (WIN32) - target_link_libraries(citra-qt winmm wsock32 ws2_32) -else() # Unix - target_link_libraries(citra-qt rt) -endif() - #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) -- cgit v1.2.3 From d7ad14ae2088789a853d36fb3a465a920c0116ee Mon Sep 17 00:00:00 2001 From: Johannes Ekberg Date: Thu, 25 Dec 2014 11:49:00 +0100 Subject: Use -pthread where and only where needed Passing -pthread to GCC as a flag makes it both link to libpthread, and make C standard library routines reentrant. This makes the additional explicit links unnecessary. Additionally, on OSX, this is the default behavior, and clang will print a message about it being unused if it's present there. --- src/citra/CMakeLists.txt | 4 ---- src/citra_qt/CMakeLists.txt | 4 ---- 2 files changed, 8 deletions(-) (limited to 'src') diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index 7f3ab3e07..713f49193 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -18,8 +18,4 @@ target_link_libraries(citra core common video_core) target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih) target_link_libraries(citra ${PLATFORM_LIBRARIES}) -if (UNIX) - target_link_libraries(citra -pthread) -endif() - #install(TARGETS citra RUNTIME DESTINATION ${bindir}) diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 420bede1e..bbc521f8a 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -62,8 +62,4 @@ target_link_libraries(citra-qt core common video_core qhexedit) target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) -if (UNIX) - target_link_libraries(citra-qt -pthread) -endif() - #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) -- cgit v1.2.3