2018-08-29 00:55:43 +00:00
cmake_minimum_required ( VERSION 3.8.2 )
2014-04-25 16:57:00 +00:00
2017-10-09 18:00:45 +00:00
option ( WITH_GDB "WITH_GDB" OFF )
option ( WITHOUT_LLVM "WITHOUT_LLVM" OFF )
2018-02-19 03:55:46 +00:00
option ( USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON )
2017-06-12 18:45:29 +00:00
if ( WITH_GDB )
add_definitions ( -DWITH_GDB_DEBUGGER )
endif ( )
2018-06-12 18:03:53 +00:00
set ( ASMJIT_EMBED TRUE )
set ( ASMJIT_DIR "${CMAKE_CURRENT_LIST_DIR}/asmjit" CACHE PATH "Location of 'asmjit'" )
include ( "${ASMJIT_DIR}/CMakeLists.txt" )
2014-04-25 16:57:00 +00:00
2014-07-10 16:46:10 +00:00
if ( NOT CMAKE_BUILD_TYPE )
message ( STATUS "No build type selected, default to Release" )
set ( CMAKE_BUILD_TYPE "Release" )
endif ( )
if ( NOT CMAKE_SIZEOF_VOID_P EQUAL 8 )
message ( FATAL_ERROR "RPCS3 can only be compiled on 64-bit platforms." )
endif ( )
2017-03-02 21:49:42 +00:00
find_program ( CCACHE_FOUND ccache )
if ( CCACHE_FOUND )
set_property ( GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache )
set_property ( GLOBAL PROPERTY RULE_LAUNCH_LINK ccache )
endif ( )
2018-06-14 19:39:48 +00:00
find_package ( ZLIB QUIET )
if ( NOT ZLIB_FOUND )
add_subdirectory ( 3rdparty/zlib EXCLUDE_FROM_ALL )
set ( ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zlib" "${CMAKE_CURRENT_BINARY_DIR}/3rdparty/zlib" CACHE INTERNAL "" )
set ( ZLIB_LIBRARY zlibstatic )
endif ( )
2016-07-01 04:07:16 +00:00
# Select the version of libpng to use, default is builtin
if ( NOT USE_SYSTEM_LIBPNG )
2018-06-10 18:37:34 +00:00
# We use libpng's static library and don't need to build the shared library and run the tests
set ( PNG_SHARED OFF CACHE BOOL "Build shared lib" FORCE )
set ( PNG_TESTS OFF CACHE BOOL "Build libpng tests" FORCE )
set ( SKIP_INSTALL_ALL ON )
2018-05-01 23:10:19 +00:00
add_subdirectory ( 3rdparty/libpng EXCLUDE_FROM_ALL )
2016-07-01 04:07:16 +00:00
endif ( )
2016-03-22 21:26:37 +00:00
2018-06-07 16:38:19 +00:00
add_subdirectory ( 3rdparty/pugixml EXCLUDE_FROM_ALL )
2015-08-07 21:53:39 +00:00
# TODO: do real installation, including copying directory structure
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${PROJECT_BINARY_DIR}/bin" )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin" )
2017-06-22 20:05:32 +00:00
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin" )
2017-06-12 18:45:29 +00:00
2018-05-01 23:10:19 +00:00
add_subdirectory ( Vulkan EXCLUDE_FROM_ALL )
add_subdirectory ( rpcs3 )
2017-04-29 00:57:12 +00:00
include_directories ( 3rdparty/hidapi/hidapi )
if ( APPLE )
2018-05-01 23:10:19 +00:00
add_subdirectory ( 3rdparty/hidapi/mac EXCLUDE_FROM_ALL )
2017-04-29 00:57:12 +00:00
#list(APPEND LIBS hidapi)
2018-05-28 20:16:29 +00:00
elseif ( CMAKE_SYSTEM MATCHES "Linux" )
2018-05-01 23:10:19 +00:00
add_subdirectory ( 3rdparty/hidapi/linux EXCLUDE_FROM_ALL )
2018-08-29 11:27:10 +00:00
elseif ( WIN32 )
2018-05-01 23:10:19 +00:00
add_subdirectory ( 3rdparty/hidapi/windows EXCLUDE_FROM_ALL )
2017-04-29 00:57:12 +00:00
else ( )
2018-05-01 23:10:19 +00:00
add_subdirectory ( 3rdparty/hidapi/libusb EXCLUDE_FROM_ALL )
2017-04-29 00:57:12 +00:00
#list(APPEND LIBS hidapi-libusb)
endif ( )
2018-05-15 00:27:50 +00:00
2018-03-24 21:16:05 +00:00
set ( YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Enable testing" FORCE )
set ( YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "Enable parse tools" FORCE )
set ( YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Enable contrib stuff in library" FORCE )
add_subdirectory ( 3rdparty/yaml-cpp EXCLUDE_FROM_ALL )
2018-05-15 00:27:50 +00:00
set ( XXHASH_BUNDLED_MODE ON )
set ( BUILD_SHARED_LIBS OFF CACHE BOOL "Make xxHash build static libs" )
add_subdirectory ( 3rdparty/xxHash/cmake_unofficial )