summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 17 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 884520cef..20a5a011a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,8 @@ cmake_minimum_required(VERSION 2.8.11)
project(citra)
if (NOT MSVC)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes")
- add_definitions(-pthread)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes -pthread")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
else()
# Silence deprecation warnings
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
@@ -17,14 +17,14 @@ else()
# As far as I can tell, there's no way to override the CMake defaults while leaving user
# changes intact, so we'll just clobber everything and say sorry.
message(STATUS "Cache compiler flags ignored, please edit CMakeFiles.txt to change the flags.")
+ # /MP - Multi-threaded compilation
# /MD - Multi-threaded runtime
# /Ox - Full optimization
- # /Oi - Use intrinsic functions
# /Oy- - Don't omit frame pointer
# /GR- - Disable RTTI
# /GS- - No stack buffer overflow checks
# /EHsc - C++-only exception handling semantics
- set(optimization_flags "/MD /Ox /Oi /Oy- /DNDEBUG /GR- /GS- /EHsc")
+ set(optimization_flags "/MP /MD /Ox /Oy- /GR- /GS- /EHsc")
# /Zi - Output debugging information
# /Zo - enahnced debug info for optimized builds
set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE)
@@ -32,7 +32,11 @@ else()
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE)
endif()
+
add_definitions(-DSINGLETHREADED)
+# CMake seems to only define _DEBUG on Windows
+set_property(DIRECTORY APPEND PROPERTY
+ COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
find_package(PNG QUIET)
if (PNG_FOUND)
@@ -106,10 +110,17 @@ if (ENABLE_GLFW)
endif()
IF (APPLE)
- # CoreFoundation is required only on OSX
- FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation)
+ FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related
+ FIND_LIBRARY(IOKIT_LIBRARY IOKit) # GLFW dependency
+ FIND_LIBRARY(COREVIDEO_LIBRARY CoreVideo) # GLFW dependency
+ set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
+ELSEIF(WIN32)
+ set(PLATFORM_LIBRARIES winmm ws2_32)
+ELSE()
+ set(PLATFORM_LIBRARIES rt)
ENDIF (APPLE)
option(ENABLE_QT "Enable the Qt frontend" ON)