summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Johannes Ekberg2014-12-24 10:34:25 +0100
committerGravatar Johannes Ekberg2015-01-09 15:50:46 +0100
commit7d7ab70279df554959eec29ff43a2eb304a3d578 (patch)
tree13443156725388ffc3fe8b1208a7a39c6d29ea93
parentMerge pull request #255 from Subv/cbranch_3 (diff)
downloadyuzu-7d7ab70279df554959eec29ff43a2eb304a3d578.tar.gz
yuzu-7d7ab70279df554959eec29ff43a2eb304a3d578.tar.xz
yuzu-7d7ab70279df554959eec29ff43a2eb304a3d578.zip
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.
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/citra/CMakeLists.txt12
-rw-r--r--src/citra_qt/CMakeLists.txt9
3 files changed, 8 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 884520cef..36b9344e4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,8 +108,14 @@ endif()
108IF (APPLE) 108IF (APPLE)
109 # CoreFoundation is required only on OSX 109 # CoreFoundation is required only on OSX
110 FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) 110 FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
111 SET(PLATFORM_LIBRARIES iconv ${COREFOUNDATION_LIBRARY})
112
111 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") 113 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
112 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") 114 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
115ELSEIF(WIN32)
116 set(PLATFORM_LIBRARIES winmm)
117ELSE()
118 set(PLATFORM_LIBRARIES rt)
113ENDIF (APPLE) 119ENDIF (APPLE)
114 120
115option(ENABLE_QT "Enable the Qt frontend" ON) 121option(ENABLE_QT "Enable the Qt frontend" ON)
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})
16add_executable(citra ${SRCS} ${HEADERS}) 16add_executable(citra ${SRCS} ${HEADERS})
17target_link_libraries(citra core common video_core) 17target_link_libraries(citra core common video_core)
18target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih) 18target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih)
19target_link_libraries(citra ${PLATFORM_LIBRARIES})
19 20
20if (UNIX) 21if (UNIX)
21 target_link_libraries(citra -pthread) 22 target_link_libraries(citra -pthread)
22endif() 23endif()
23 24
24if (APPLE)
25 target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY})
26elseif (WIN32)
27 target_link_libraries(citra winmm wsock32 ws2_32)
28 if (MINGW) # GCC does not support codecvt, so use iconv instead
29 target_link_libraries(citra iconv)
30 endif()
31else() # Unix
32 target_link_libraries(citra rt)
33endif()
34
35#install(TARGETS citra RUNTIME DESTINATION ${bindir}) 25#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()
60add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) 60add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
61target_link_libraries(citra-qt core common video_core qhexedit) 61target_link_libraries(citra-qt core common video_core qhexedit)
62target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) 62target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS})
63target_link_libraries(citra-qt ${PLATFORM_LIBRARIES})
63 64
64if (UNIX) 65if (UNIX)
65 target_link_libraries(citra-qt -pthread) 66 target_link_libraries(citra-qt -pthread)
66endif() 67endif()
67 68
68if (APPLE)
69 target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY})
70elseif (WIN32)
71 target_link_libraries(citra-qt winmm wsock32 ws2_32)
72else() # Unix
73 target_link_libraries(citra-qt rt)
74endif()
75
76#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) 69#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})