Make Linux/MacOSX system checks correct in the cmake build. UNIX is true on both linux and osx. The cmake build probably still doesn't work on MacOSX though.
Also added an option to explicitly disable building with MPG framedumps. To use it add -DENCODE_FRAMEDUMPS=OFF to cmake on the command line. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6429 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0644295f3d
commit
a279b391cc
|
@ -52,12 +52,12 @@ if(VISIBILITY_INLINES_HIDDEN)
|
|||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden)
|
||||
endif(VISIBILITY_INLINES_HIDDEN)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
CHECK_CXX_COMPILER_FLAG(-fvisibility=hidden VISIBILITY_HIDDEN)
|
||||
if(VISIBILITY_HIDDEN)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
endif(VISIBILITY_HIDDEN)
|
||||
endif(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_SECURE_SCL=0)
|
||||
|
@ -150,7 +150,7 @@ endif(OPENAL_FOUND)
|
|||
|
||||
# Note: We do not need to explicitly check for X11 as it is done in the cmake
|
||||
# FindOpenGL module on linux.
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(X11_FOUND)
|
||||
add_definitions(-DHAVE_X11=1)
|
||||
include_directories(${X11_INCLUDE_DIR})
|
||||
|
@ -160,7 +160,7 @@ if(UNIX)
|
|||
endif(X11_FOUND)
|
||||
else()
|
||||
add_definitions(-DHAVE_X11=0)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
||||
pkg_search_module(XRANDR xrandr)
|
||||
if(XRANDR_FOUND)
|
||||
|
@ -171,15 +171,18 @@ else()
|
|||
message("Xrandr NOT found")
|
||||
endif(XRANDR_FOUND)
|
||||
|
||||
pkg_search_module(AVCODEC libavcodec>=52.72.2)
|
||||
pkg_search_module(SWSCALE libswscale>=0.11.0)
|
||||
if(AVCODEC_FOUND AND SWSCALE_FOUND)
|
||||
message("avcodec found, enabling MPG frame dumps")
|
||||
set(ENCODE_FRAMEDUMPS TRUE)
|
||||
add_definitions(-DHAVE_AVCODEC)
|
||||
else()
|
||||
set(ENCODE_FRAMEDUMPS FALSE)
|
||||
message("avcodec not found, disabling MPG frame dumps")
|
||||
option(ENCODE_FRAMEDUMPS "Encode framedumps in MPG format" ON)
|
||||
if(ENCODE_FRAMEDUMPS)
|
||||
pkg_search_module(AVCODEC libavcodec>=52.72.2)
|
||||
pkg_search_module(SWSCALE libswscale>=0.11.0)
|
||||
if(AVCODEC_FOUND AND SWSCALE_FOUND)
|
||||
message("avcodec found, enabling MPG frame dumps")
|
||||
set(ENCODE_FRAMEDUMPS ON)
|
||||
add_definitions(-DHAVE_AVCODEC)
|
||||
else()
|
||||
set(ENCODE_FRAMEDUMPS OFF)
|
||||
message("avcodec not found, disabling MPG frame dumps")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckCXXSourceRuns)
|
||||
|
@ -303,34 +306,33 @@ else()
|
|||
check_lib(CGGL CgGL REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT APPLE)
|
||||
if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
|
||||
include_directories(Externals/CLRun/include)
|
||||
add_subdirectory(Externals/CLRun)
|
||||
add_definitions(-DUSE_CLRUN)
|
||||
endif(NOT APPLE)
|
||||
endif()
|
||||
|
||||
option(DISABLE_WX OFF "Disable wxWidgets (use CLI interface)")
|
||||
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
|
||||
if(NOT DISABLE_WX)
|
||||
include(FindwxWidgets OPTIONAL)
|
||||
|
||||
if(wxWidgets_FOUND)
|
||||
add_definitions(-DHAVE_WX=1)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
check_lib(GTK2 gtk+-2.0 REQUIRED)
|
||||
if(GTK2_FOUND)
|
||||
include_directories(${GTK2_INCLUDE_DIRS})
|
||||
endif(GTK2_FOUND)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
||||
message("wxWidgets found, enabling GUI build")
|
||||
else(wxWidgets_FOUND)
|
||||
message("Shared wxWidgets not found, falling back to the static library")
|
||||
add_definitions(-DHAVE_WX=1)
|
||||
include_directories(Externals/wxWidgets/include)
|
||||
add_subdirectory(Externals/wxWidgets)
|
||||
endif(wxWidgets_FOUND)
|
||||
add_definitions(-DHAVE_WX=1)
|
||||
endif(NOT DISABLE_WX)
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,6 @@ set(SRCS clrun/clrun.c
|
|||
clrun/genclgl.c)
|
||||
|
||||
add_library(clrun STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-DLUA_USE_LINUX)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
||||
set(SRCS lapi.c
|
||||
lauxlib.c
|
||||
|
|
|
@ -4,6 +4,6 @@ set(SRCS image_DXT.c
|
|||
stb_image_aug.c)
|
||||
|
||||
add_library(SOIL STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -6,7 +6,7 @@ set(SRCS Src/AudioCommon.cpp
|
|||
|
||||
set(LIBS "")
|
||||
|
||||
if(APPLE)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(SRCS ${SRCS} Src/CoreAudioSoundStream.cpp)
|
||||
else()
|
||||
if(ALSA_FOUND)
|
||||
|
@ -37,6 +37,6 @@ endif()
|
|||
|
||||
add_library(audiocommon STATIC ${SRCS})
|
||||
target_link_libraries(audiocommon ${LIBS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -40,6 +40,6 @@ if(WIN32)
|
|||
endif(WIN32)
|
||||
|
||||
add_library(common STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -133,9 +133,9 @@ set(SRCS Src/ActionReplay.cpp
|
|||
|
||||
if(WIN32)
|
||||
set(SRCS ${SRCS} Src/HW/BBA-TAP/TAP_Win32.cpp Src/stdafx.cpp)
|
||||
elseif(APPLE)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(SRCS ${SRCS} Src/HW/BBA-TAP/TAP_Apple.cpp)
|
||||
elseif(UNIX)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(SRCS ${SRCS} Src/HW/BBA-TAP/TAP_Unix.cpp)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@ set(SRCS Src/assemble.cpp
|
|||
Src/Jit/DSPJitMisc.cpp)
|
||||
|
||||
add_library(dspcore STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -3,6 +3,6 @@ set(SRCS Src/CodeView.cpp
|
|||
Src/MemoryView.cpp)
|
||||
|
||||
add_library(debugger_ui_util STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -63,9 +63,9 @@ endif(XRANDR_FOUND)
|
|||
|
||||
if(WIN32)
|
||||
set(SRCS ${SRCS} Src/stdafx.cpp)
|
||||
elseif(APPLE AND NOT wxWidgets_FOUND)
|
||||
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND NOT wxWidgets_FOUND)
|
||||
# TODO
|
||||
elseif(APPLE AND wxWidgets_FOUND)
|
||||
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND wxWidgets_FOUND)
|
||||
# TODO
|
||||
else()
|
||||
set(SRCS ${SRCS} Src/X11Utils.cpp)
|
||||
|
|
|
@ -11,7 +11,7 @@ if(WIN32)
|
|||
Src/ControllerInterface/DInput/DInputKeyboardMouse.cpp
|
||||
Src/ControllerInterface/SDL/SDL.cpp
|
||||
Src/ControllerInterface/XInput/XInput.cpp)
|
||||
elseif(APPLE)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(SRCS ${SRCS}
|
||||
Src/ControllerInterface/OSX/OSX.mm
|
||||
Src/ControllerInterface/OSX/OSXKeyboard.mm
|
||||
|
|
|
@ -40,10 +40,10 @@ if(ENCODE_FRAMEDUMPS OR WIN32)
|
|||
endif()
|
||||
|
||||
add_library(videocommon STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(ENCODE_FRAMEDUMPS)
|
||||
target_link_libraries(videocommon avcodec swscale)
|
||||
add_definitions(-D__STDC_CONSTANT_MACROS)
|
||||
endif()
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
set(SRCS Src/VideoConfigDiag.cpp)
|
||||
|
||||
add_library(videouicommon STATIC ${SRCS})
|
||||
if(UNIX)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-fPIC)
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
set(SRCS Src/ir.cpp
|
||||
Src/wiiuse.cpp)
|
||||
|
||||
if(APPLE)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(SRCS ${SRCS} Src/io_osx.m)
|
||||
elseif(UNIX AND BLUEZ_FOUND)
|
||||
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND BLUEZ_FOUND)
|
||||
set(SRCS ${SRCS} Src/io_nix.cpp)
|
||||
set(LIBS ${LIBS} bluetooth)
|
||||
elseif(WIN32)
|
||||
|
|
|
@ -25,11 +25,11 @@ if(wxWidgets_FOUND)
|
|||
set(LIBS videouicommon ${LIBS})
|
||||
endif(wxWidgets_FOUND)
|
||||
|
||||
if(APPLE AND NOT wxWidgets_FOUND)
|
||||
if((${CMAKE_SYSTEM_NAME} MATCHES "Darwin") AND NOT wxWidgets_FOUND)
|
||||
set(SRCS ${SRCS} Src/cocoaGL.m)
|
||||
elseif(WIN32)
|
||||
set(SRCS ${SRCS} Src/OS/Win32.cpp)
|
||||
elseif(NOT APPLE)
|
||||
elseif(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
|
||||
set(LIBS ${LIBS} clrun)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue