2017-11-15 20:47:30 +01:00
cmake_minimum_required(VERSION 3.1)
2014-04-25 18:57:00 +02:00
2017-10-09 11:00:45 -07:00
option(WITH_GDB "WITH_GDB" OFF)
option(WITHOUT_LLVM "WITHOUT_LLVM" OFF)
2018-02-18 19:55:46 -08: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)
2018-02-18 19:58:58 -08:00
option(VULKAN_PREBUILT "" OFF)
2017-06-12 11:45:29 -07:00
if (WITH_GDB)
add_definitions(-DWITH_GDB_DEBUGGER)
endif()
2014-04-25 18:57:00 +02:00
set(ASMJIT_STATIC TRUE)
2014-07-11 02:46:10 +10: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-03 05:49:42 +08: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()
2016-07-01 06:07:16 +02:00
add_definitions(-DCMAKE_BUILD)
2016-02-13 08:15:41 +02: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 tests." FORCE)
2016-07-01 06:07:16 +02:00
# Select the version of libpng to use, default is builtin
if (NOT USE_SYSTEM_LIBPNG)
add_subdirectory( 3rdparty/libpng )
endif()
2016-03-22 22:26:37 +01:00
2015-08-08 00:53:39 +03: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 13:05:32 -07:00
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${PROJECT_BINARY_DIR}/bin")
2017-06-12 11:45:29 -07:00
2016-02-16 20:23:17 +01:00
add_subdirectory( Vulkan )
2014-04-25 18:57:00 +02:00
add_subdirectory( rpcs3 )
2018-05-13 04:18:05 -05:00
add_subdirectory(3rdparty/xxHash/cmake_unofficial)
2017-04-28 19:57:12 -05:00
include_directories(3rdparty/hidapi/hidapi)
if(APPLE)
add_subdirectory(3rdparty/hidapi/mac)
#list(APPEND LIBS hidapi)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_subdirectory(3rdparty/hidapi/linux)
elseif(MSVC)
add_subdirectory(3rdparty/hidapi/windows)
else()
add_subdirectory(3rdparty/hidapi/libusb)
#list(APPEND LIBS hidapi-libusb)
endif()