summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt18
-rw-r--r--src/citra/CMakeLists.txt16
-rw-r--r--src/citra_qt/CMakeLists.txt13
3 files changed, 14 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2cba5e8a1..2711336fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,8 @@ cmake_minimum_required(VERSION 2.8.11)
5project(citra) 5project(citra)
6 6
7if (NOT MSVC) 7if (NOT MSVC)
8 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes") 8 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread")
9 add_definitions(-pthread) 9 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
10else() 10else()
11 # Silence deprecation warnings 11 # Silence deprecation warnings
12 add_definitions(/D_CRT_SECURE_NO_WARNINGS) 12 add_definitions(/D_CRT_SECURE_NO_WARNINGS)
@@ -20,12 +20,11 @@ else()
20 # /MP - Multi-threaded compilation 20 # /MP - Multi-threaded compilation
21 # /MD - Multi-threaded runtime 21 # /MD - Multi-threaded runtime
22 # /Ox - Full optimization 22 # /Ox - Full optimization
23 # /Oi - Use intrinsic functions
24 # /Oy- - Don't omit frame pointer 23 # /Oy- - Don't omit frame pointer
25 # /GR- - Disable RTTI 24 # /GR- - Disable RTTI
26 # /GS- - No stack buffer overflow checks 25 # /GS- - No stack buffer overflow checks
27 # /EHsc - C++-only exception handling semantics 26 # /EHsc - C++-only exception handling semantics
28 set(optimization_flags "/MP /MD /Ox /Oi /Oy- /DNDEBUG /GR- /GS- /EHsc") 27 set(optimization_flags "/MP /MD /Ox /Oy- /DNDEBUG /GR- /GS- /EHsc")
29 # /Zi - Output debugging information 28 # /Zi - Output debugging information
30 # /Zo - enahnced debug info for optimized builds 29 # /Zo - enahnced debug info for optimized builds
31 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE) 30 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE)
@@ -107,10 +106,17 @@ if (ENABLE_GLFW)
107endif() 106endif()
108 107
109IF (APPLE) 108IF (APPLE)
110 # CoreFoundation is required only on OSX 109 FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related
111 FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) 110 FIND_LIBRARY(IOKIT_LIBRARY IOKit) # GLFW dependency
111 FIND_LIBRARY(COREVIDEO_LIBRARY CoreVideo) # GLFW dependency
112 set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
113
112 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") 114 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
113 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") 115 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
116ELSEIF(WIN32)
117 set(PLATFORM_LIBRARIES winmm ws2_32)
118ELSE()
119 set(PLATFORM_LIBRARIES rt)
114ENDIF (APPLE) 120ENDIF (APPLE)
115 121
116option(ENABLE_QT "Enable the Qt frontend" ON) 122option(ENABLE_QT "Enable the Qt frontend" ON)
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index bbb3374f2..713f49193 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -16,20 +16,6 @@ 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)
19 19target_link_libraries(citra ${PLATFORM_LIBRARIES})
20if (UNIX)
21 target_link_libraries(citra -pthread)
22endif()
23
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 20
35#install(TARGETS citra RUNTIME DESTINATION ${bindir}) 21#install(TARGETS citra RUNTIME DESTINATION ${bindir})
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index a0ba252b3..bbc521f8a 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -60,17 +60,6 @@ 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})
63 63target_link_libraries(citra-qt ${PLATFORM_LIBRARIES})
64if (UNIX)
65 target_link_libraries(citra-qt -pthread)
66endif()
67
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 64
76#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) 65#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})