CMake/Master working, tested on windows with Clang && MSC (x86,x64)
This commit is contained in:
parent
3d1b82854e
commit
cc9d5ec55b
|
@ -0,0 +1,313 @@
|
||||||
|
cmake_minimum_required(VERSION 3.5.0 FATAL_ERROR)
|
||||||
|
|
||||||
|
set(TNAME reicast)
|
||||||
|
|
||||||
|
project(${TNAME})
|
||||||
|
|
||||||
|
enable_language(ASM)
|
||||||
|
|
||||||
|
set(DEBUG_CMAKE ON)
|
||||||
|
|
||||||
|
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
|
||||||
|
|
||||||
|
## built-in cmake modules #
|
||||||
|
#
|
||||||
|
#include(CheckIncludeFiles)
|
||||||
|
#include(CheckFunctionExists)
|
||||||
|
#include(CheckCSourceCompiles)
|
||||||
|
|
||||||
|
#set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||||
|
#set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(reicast_root_path "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(reicast_core_path "${reicast_root_path}/core")
|
||||||
|
set(reicast_shell_path "${reicast_root_path}/shell")
|
||||||
|
|
||||||
|
include_directories ("${reicast_core_path}")
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${reicast_shell_path}/cmake")
|
||||||
|
|
||||||
|
|
||||||
|
include(GetGitRevisionDescription)
|
||||||
|
git_describe(GIT_VERSION --tags)
|
||||||
|
configure_file(${reicast_core_path}/version.h.in ${reicast_core_path}/version.h @ONLY)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## reicast build modules #
|
||||||
|
#
|
||||||
|
|
||||||
|
set(reicast_SRCS "")
|
||||||
|
|
||||||
|
include(config) # configure build settings, must be first
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### libdreamcast.cmake #########################################################################
|
||||||
|
|
||||||
|
set(d_core ${reicast_core_path})
|
||||||
|
|
||||||
|
file(GLOB_RECURSE hw_SRCS ${d_core}/hw/*.cpp ${d_core}/hw/*.h)
|
||||||
|
|
||||||
|
file(GLOB cfg_SRCS ${d_core}/cfg/*.cpp ${d_core}/cfg/*.h)
|
||||||
|
file(GLOB rend_SRCS ${d_core}/rend/*.cpp ${d_core}/rend/*.h)
|
||||||
|
file(GLOB input_SRCS ${d_core}/input/*.cpp ${d_core}/input/*.h)
|
||||||
|
file(GLOB reios_SRCS ${d_core}/reios/*.cpp ${d_core}/reios/*.h)
|
||||||
|
file(GLOB imgread_SRCS ${d_core}/imgread/*.cpp ${d_core}/imgread/*.h)
|
||||||
|
file(GLOB profiler_SRCS ${d_core}/profiler/*.cpp ${d_core}/profiler/*.h)
|
||||||
|
file(GLOB archive_SRCS ${d_core}/archive/*.cpp ${d_core}/archive/*.h)
|
||||||
|
|
||||||
|
#### option(rend)
|
||||||
|
file(GLOB gl4_SRCS ${d_core}/rend/gl4/*.cpp ${d_core}/rend/gl4/*.h)
|
||||||
|
file(GLOB gles_SRCS ${d_core}/rend/gles/*.cpp ${d_core}/rend/gles/*.h)
|
||||||
|
|
||||||
|
set(core_SRCS
|
||||||
|
${hw_SRCS}
|
||||||
|
${cfg_SRCS}
|
||||||
|
${rend_SRCS}
|
||||||
|
${gl4_SRCS}
|
||||||
|
${gles_SRCS}
|
||||||
|
${input_SRCS}
|
||||||
|
${reios_SRCS}
|
||||||
|
${imgread_SRCS}
|
||||||
|
${profiler_SRCS}
|
||||||
|
# ${archive_SRCS}
|
||||||
|
${d_core}/archive/archive.cpp ${d_core}/archive/archive.h
|
||||||
|
${d_core}/nullDC.cpp
|
||||||
|
${d_core}/stdclass.cpp
|
||||||
|
${d_core}/dispframe.cpp
|
||||||
|
${d_core}/serialize.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if(${FEAT_SHREC} EQUAL ${DYNAREC_JIT})
|
||||||
|
#
|
||||||
|
if(${HOST_CPU} EQUAL ${CPU_X86})
|
||||||
|
list(APPEND core_SRCS
|
||||||
|
${d_core}/rec-x86/rec_x86_driver.cpp
|
||||||
|
${d_core}/rec-x86/rec_x86_il.cpp
|
||||||
|
${d_core}/rec-x86/rec_x86_asm.cpp # change for linux , rec_lin86_asm.S
|
||||||
|
${d_core}/rec-x86/rec_x86_ngen.h
|
||||||
|
)
|
||||||
|
elseif(${HOST_CPU} EQUAL ${CPU_ARM})
|
||||||
|
list(APPEND core_SRCS
|
||||||
|
${d_core}/rec-ARM/ngen_arm.S
|
||||||
|
${d_core}/rec-ARM/rec_arm.cpp
|
||||||
|
)
|
||||||
|
elseif(${HOST_CPU} EQUAL ${CPU_X64})
|
||||||
|
|
||||||
|
### FIXME: asm with cmake ninja+VC
|
||||||
|
if(${BUILD_COMPILER} EQUAL ${COMPILER_VC})
|
||||||
|
list(APPEND core_SRCS ${d_core}/rec-x64/msvc.asm)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND core_SRCS ${d_core}/rec-x64/rec_x64.cpp ${d_core}/rec-x64/x64_regalloc.h)
|
||||||
|
|
||||||
|
elseif(${HOST_CPU} EQUAL ${CPU_A64})
|
||||||
|
list(APPEND core_SRCS ${d_core}/rec-ARM64/rec_arm64.cpp ${d_core}/rec-ARM64/arm64_regalloc.h)
|
||||||
|
|
||||||
|
else()
|
||||||
|
message(" FEAT_SHREC==DYNAREC_JIT && HOST_CPU Unknown Default add arch or disable rec if not avail.")
|
||||||
|
error()
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
elseif(${FEAT_SHREC} EQUAL ${DYNAREC_CPP})
|
||||||
|
list(APPEND core_SRCS ${d_core}/rec-cpp/rec_cpp.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_definitions(/DFEAT_HAS_SOFTREND=0)
|
||||||
|
|
||||||
|
|
||||||
|
### deps.cmake #################################################################################
|
||||||
|
|
||||||
|
set(d_deps ${reicast_core_path}/deps)
|
||||||
|
include_directories ("${d_deps}")
|
||||||
|
include_directories ("${d_deps}/picotcp/include")
|
||||||
|
include_directories ("${d_deps}/picotcp/modules")
|
||||||
|
|
||||||
|
file(GLOB xbyak_H ${d_deps}/xbyak/*.h) # include headers into cmake target/project view
|
||||||
|
|
||||||
|
file(GLOB chdr_SRCS ${d_deps}/chdr/*.c)
|
||||||
|
file(GLOB lzma_SRCS ${d_deps}/lzma/*.c)
|
||||||
|
file(GLOB lz_SRCS ${d_deps}/zlib/*.c)
|
||||||
|
file(GLOB lzip_SRCS ${d_deps}/libzip/*.c)
|
||||||
|
file(GLOB lpng_SRCS ${d_deps}/libpng/*.c)
|
||||||
|
file(GLOB lelf_SRCS ${d_deps}/libelf/el*.cpp)
|
||||||
|
file(GLOB crypt_SRCS ${d_deps}/crypto/*.cpp)
|
||||||
|
file(GLOB imgui_SRCS ${d_deps}/imgui/*.cpp)
|
||||||
|
file(GLOB lws_SRCS ${d_deps}/libwebsocket/*.c)
|
||||||
|
|
||||||
|
file(GLOB picoModS ${d_deps}/picotcp/modules/*.c)
|
||||||
|
file(GLOB picoStkS ${d_deps}/picotcp/stack/*.c)
|
||||||
|
set(pico_SRCS ${picoModS} ${picoStkS})
|
||||||
|
|
||||||
|
set(deps_SRCS
|
||||||
|
${lz_SRCS}
|
||||||
|
# ${lzip_SRCS}
|
||||||
|
# ${lzma_SRCS}
|
||||||
|
# ${pico_SRCS}
|
||||||
|
${lpng_SRCS}
|
||||||
|
${lelf_SRCS}
|
||||||
|
${chdr_SRCS}
|
||||||
|
${crypt_SRCS}
|
||||||
|
${imgui_SRCS}
|
||||||
|
${d_deps}/xbrz/xbrz.cpp
|
||||||
|
${d_deps}/dirent/dirent.c
|
||||||
|
${d_deps}/xxhash/xxhash.c
|
||||||
|
${d_deps}/chdpsr/cdipsr.cpp # sigh, this dir is named chdpsr for some reason ...
|
||||||
|
${d_deps}/coreio/coreio.cpp
|
||||||
|
# ${d_deps}/ifaddrs/ifaddrs.c
|
||||||
|
${xbyak_H}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### libosd.cmake ################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
set(d_aout ${reicast_core_path}/oslib)
|
||||||
|
|
||||||
|
include_directories ("${d_core}/khronos")
|
||||||
|
|
||||||
|
## I really should just glob all of the dirs and ;shrug; if guards don't do it all ##
|
||||||
|
|
||||||
|
set(osd_SRCS "")
|
||||||
|
|
||||||
|
list(APPEND osd_SRCS ${d_aout}/audiostream.cpp)
|
||||||
|
|
||||||
|
if (${HOST_OS} EQUAL ${OS_WINDOWS})
|
||||||
|
|
||||||
|
list(APPEND osd_SRCS ${d_core}/windows/winmain.cpp)
|
||||||
|
list(APPEND osd_SRCS ${d_aout}/audiobackend_directsound.cpp)
|
||||||
|
|
||||||
|
|
||||||
|
link_libraries(Dsound.lib winmm.lib)
|
||||||
|
|
||||||
|
|
||||||
|
elseif (${HOST_OS} EQUAL ${OS_LINUX} OR ${HOST_OS} EQUAL ${OS_ANDROID})
|
||||||
|
|
||||||
|
list(APPEND osd_SRCS
|
||||||
|
${d_core}/linux/common.cpp
|
||||||
|
${d_core}/linux/context.cpp
|
||||||
|
${d_core}/linux/nixprof/nixprof.cpp
|
||||||
|
|
||||||
|
${d_aout}/audiobackend_oss.cpp # add option
|
||||||
|
) # todo: configure linux audio lib options
|
||||||
|
|
||||||
|
if(NOT ANDROID)
|
||||||
|
list(APPEND osd_SRCS
|
||||||
|
${d_core}/linux-dist/x11.cpp
|
||||||
|
${d_core}/linux-dist/main.cpp
|
||||||
|
${d_core}/linux-dist/evdev.cpp)
|
||||||
|
|
||||||
|
add_definitions(-DSUPPORT_X11) ## don't use GLES ?
|
||||||
|
link_libraries(X11)
|
||||||
|
else()
|
||||||
|
list(APPEND osd_SRCS
|
||||||
|
.//android-studio/reicast/src/main/jni/src/Android.cpp
|
||||||
|
.//android-studio/reicast/src/main/jni/src/utils.cpp
|
||||||
|
# .//android-studio/reicast/src/main/jni/src/XperiaPlay.c
|
||||||
|
)
|
||||||
|
endif() # ANDROID
|
||||||
|
|
||||||
|
add_definitions(-DGLES -DUSE_EVDEV)
|
||||||
|
|
||||||
|
link_libraries(pthread dl rt asound Xext GLESv2 EGL)
|
||||||
|
|
||||||
|
elseif(${HOST_OS} EQUAL ${OS_DARWIN})
|
||||||
|
#
|
||||||
|
list(APPEND objc_SRCS
|
||||||
|
./shell/apple/emulator-osx/emulator-osx/osx-main.mm
|
||||||
|
./shell/apple/emulator-osx/emulator-osx/AppDelegate.swift
|
||||||
|
./shell/apple/emulator-osx/emulator-osx/EmuGLView.swift
|
||||||
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(${objc_SRCS} PROPERTIES COMPILE_FLAGS "-x objective-c++")
|
||||||
|
|
||||||
|
list(APPEND osd_SRCS ${objc_SRCS}
|
||||||
|
${d_osd}/linux/common.cpp
|
||||||
|
${d_osd}/linux/context.cpp
|
||||||
|
${d_osd}/audiobackend/audiobackend_coreaudio.cpp
|
||||||
|
# if NOT USE_SWIFT / ObjC
|
||||||
|
#${d_osd}/apple/osx_osd.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
else()
|
||||||
|
#
|
||||||
|
message("OS Unhandled")
|
||||||
|
error()
|
||||||
|
#
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(reicast_SRCS ${core_SRCS} ${deps_SRCS} ${osd_SRCS})
|
||||||
|
|
||||||
|
add_executable(${TNAME}${binSuffix} ${reicast_SRCS} ${deps_SRCS})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
enable_language(Swift)
|
||||||
|
set_property(TARGET ${TNAME} PROPERTY XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "./shell/apple/emulator-osx/emulator-osx/emulator-osx-Bridging-Header.h")
|
||||||
|
|
||||||
|
target_link_libraries(${TNAME}
|
||||||
|
# "-framework Cocoa"
|
||||||
|
# "-framework AppKit"
|
||||||
|
"-framework CoreData"
|
||||||
|
"-framework CoreAudio"
|
||||||
|
"-framework AudioUnit"
|
||||||
|
"-framework AudioToolbox"
|
||||||
|
"-framework Foundation"
|
||||||
|
)
|
||||||
|
|
||||||
|
#### OSX Notes, when not using xcode you have to make app bundle, edit plist and copy, convert MainMenu.xib to nib and copy,
|
||||||
|
#null@devpc:~$ /Users/null/Documents/projects/reicast-emulator/bin/RelWithDebInfo/Reicast.app/Contents/MacOS/reicast ; exit;
|
||||||
|
#2019-03-18 14:28:44.842 reicast[11468:131797] Unknown class _TtC12emulator_osx9EmuGLView in Interface Builder file at path /Users/null/Documents/projects/reicast-emulator/bin/RelWithDebInfo/Reicast.app/Contents/Resources/MainMenu.nib.
|
||||||
|
#2019-03-18 14:28:44.842 reicast[11468:131797] Unknown class _TtC12emulator_osx11AppDelegate in Interface Builder file at path /Users/null/Documents/projects/reicast-emulator/bin/RelWithDebInfo/Reicast.app/Contents/Resources/MainMenu.nib.
|
||||||
|
#2019-03-18 14:28:44.860 reicast[11468:131797] Failed to connect (window) outlet from (NSObject) to (NSWindow): missing setter or instance variable
|
||||||
|
#
|
||||||
|
|
||||||
|
endif() #APPLE
|
||||||
|
|
||||||
|
|
||||||
|
if(DEBUG_CMAKE)
|
||||||
|
message(" ------------------------------------------------")
|
||||||
|
message(" - HOST_OS: ${HOST_OS} - HOST_CPU: ${HOST_CPU} ")
|
||||||
|
message(" - host_os: ${host_os} - host_arch: ${host_arch} ")
|
||||||
|
message(" ------------------------------------------------")
|
||||||
|
message(" C Flags: ${CMAKE_C_FLAGS} ")
|
||||||
|
message(" CXX Flags: ${CMAKE_CXX_FLAGS} ")
|
||||||
|
message(" LINK_DIRS: ${LINK_DIRECTORIES}")
|
||||||
|
message("LINK_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
message(" ------------------------------------------------\n")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,216 @@
|
||||||
|
{
|
||||||
|
"environments": [
|
||||||
|
{
|
||||||
|
"environment": "toolchain.generic",
|
||||||
|
"TOOLCHAIN_FILE": "ps4sdk.cmake"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "win-x86-Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_x86Debug",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x86"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "win-x86-Release",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_x86Release",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x86"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "win-x64-Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_x64Debug",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x64_x64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "-DNINJA=1",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "win-x64-Release",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_x64Release",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x64_x64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "-DNINJA=1",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "win-x64-Clang-RelWithDebInfo",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_x64Release",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x64_x64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "CMAKE_C_COMPILER",
|
||||||
|
"value": "clang-cl.exe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CMAKE_CXX_COMPILER",
|
||||||
|
"value": "clang-cl.exe"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "PS4 SDK",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_PS4SDK",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"toolchain.generic"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "-DCMAKE_TOOLCHAIN_FILE=${projectDir}\\cmake\\ps4sdk.cmake",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "NSW SDK",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"description": "TemplateDescription_Localize_PS4SDK",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"toolchain.generic"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "-DCMAKE_TOOLCHAIN_FILE=${projectDir}\\cmake\\devkitA64.cmake",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "uwp-x64-Release",
|
||||||
|
"generator": "Visual Studio 15 2017 Win64",
|
||||||
|
"description": "TemplateDescription_Localize_x64Release",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x64_x64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "win-x64-MSBuild-Release",
|
||||||
|
"generator": "Visual Studio 15 2017 Win64",
|
||||||
|
"description": "TemplateDescription_Localize_x64Release",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"msvc_x64_x64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "",
|
||||||
|
"ctestCommandArgs": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"environments": [
|
||||||
|
{
|
||||||
|
"MINGW64_ROOT": "C:\\msys64\\mingw64",
|
||||||
|
"BIN_ROOT": "${env.MINGW64_ROOT}\\bin",
|
||||||
|
"FLAVOR": "x86_64-w64-mingw32",
|
||||||
|
"TOOLSET_VERSION": "7.3.0",
|
||||||
|
"PATH": "${env.MINGW64_ROOT}\\bin;${env.MINGW64_ROOT}\\..\\usr\\local\\bin;${env.MINGW64_ROOT}\\..\\usr\\bin;${env.MINGW64_ROOT}\\..\\bin;${env.PATH}",
|
||||||
|
"INCLUDE": "${env.INCLUDE};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\tr1;${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\${env.FLAVOR}",
|
||||||
|
"environment": "mingw_64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Mingw64-Release",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "RelWithDebInfo",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"mingw_64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"intelliSenseMode": "linux-gcc-x64",
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "CMAKE_C_COMPILER",
|
||||||
|
"value": "${env.BIN_ROOT}\\gcc.exe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CMAKE_CXX_COMPILER",
|
||||||
|
"value": "${env.BIN_ROOT}\\g++.exe"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"environments": [
|
||||||
|
{
|
||||||
|
"MINGW64_ROOT": "C:\\msys64\\mingw64",
|
||||||
|
"BIN_ROOT": "${env.MINGW64_ROOT}\\bin",
|
||||||
|
"FLAVOR": "x86_64-w64-mingw32",
|
||||||
|
"TOOLSET_VERSION": "7.3.0",
|
||||||
|
"PATH": "${env.MINGW64_ROOT}\\bin;${env.MINGW64_ROOT}\\..\\usr\\local\\bin;${env.MINGW64_ROOT}\\..\\usr\\bin;${env.MINGW64_ROOT}\\..\\bin;${env.PATH}",
|
||||||
|
"INCLUDE": "${env.INCLUDE};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION};${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\tr1;${env.MINGW64_ROOT}\\include\\c++\\${env.TOOLSET_VERSION}\\${env.FLAVOR}",
|
||||||
|
"environment": "mingw_64"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"name": "Mingw64-Debug",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"configurationType": "Debug",
|
||||||
|
"inheritEnvironments": [
|
||||||
|
"mingw_64"
|
||||||
|
],
|
||||||
|
"buildRoot": "${projectDir}\\build\\${name}",
|
||||||
|
"installRoot": "${projectDir}\\build\\${name}\\install",
|
||||||
|
"cmakeCommandArgs": "",
|
||||||
|
"buildCommandArgs": "-v",
|
||||||
|
"ctestCommandArgs": "",
|
||||||
|
"intelliSenseMode": "linux-gcc-x64",
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "CMAKE_C_COMPILER",
|
||||||
|
"value": "${env.BIN_ROOT}\\gcc.exe"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "CMAKE_CXX_COMPILER",
|
||||||
|
"value": "${env.BIN_ROOT}\\g++.exe"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
36
core/build.h
36
core/build.h
|
@ -127,10 +127,18 @@
|
||||||
#define DC_PLATFORM_AURORA 6 /* Needs to be done, Uses newer 300 mhz sh4 + 150 mhz pvr mbx SoC */
|
#define DC_PLATFORM_AURORA 6 /* Needs to be done, Uses newer 300 mhz sh4 + 150 mhz pvr mbx SoC */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//HOST_OS
|
//HOST_OS
|
||||||
#define OS_WINDOWS 0x10000001
|
#define OS_WINDOWS 0x10000001
|
||||||
#define OS_LINUX 0x10000002
|
#define OS_LINUX 0x10000002
|
||||||
#define OS_DARWIN 0x10000003
|
#define OS_DARWIN 0x10000003
|
||||||
|
#define OS_IOS 0x10000004
|
||||||
|
#define OS_ANDROID 0x10000005
|
||||||
|
|
||||||
|
#define OS_UWP 0x10000011
|
||||||
|
#define OS_NSW_HOS 0x80000001
|
||||||
|
#define OS_PS4_BSD 0x80000002
|
||||||
|
|
||||||
|
|
||||||
//HOST_CPU
|
//HOST_CPU
|
||||||
#define CPU_X86 0x20000001
|
#define CPU_X86 0x20000001
|
||||||
|
@ -138,11 +146,16 @@
|
||||||
#define CPU_MIPS 0x20000003
|
#define CPU_MIPS 0x20000003
|
||||||
#define CPU_X64 0x20000004
|
#define CPU_X64 0x20000004
|
||||||
#define CPU_GENERIC 0x20000005 //used for pnacl, emscripten, etc
|
#define CPU_GENERIC 0x20000005 //used for pnacl, emscripten, etc
|
||||||
#define CPU_ARM64 0x20000006
|
#define CPU_PPC 0x20000006
|
||||||
|
#define CPU_PPC64 0x20000007
|
||||||
|
#define CPU_A64 0x20000008
|
||||||
|
#define CPU_MIPS64 0x20000009
|
||||||
|
|
||||||
//BUILD_COMPILER
|
//BUILD_COMPILER
|
||||||
#define COMPILER_VC 0x30000001
|
#define COMPILER_VC 0x30000001
|
||||||
#define COMPILER_GCC 0x30000002
|
#define COMPILER_GCC 0x30000002
|
||||||
|
#define COMPILER_CLANG 0x30000002
|
||||||
|
#define COMPILER_INTEL 0x30000002
|
||||||
|
|
||||||
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
|
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
|
||||||
#define DYNAREC_NONE 0x40000001
|
#define DYNAREC_NONE 0x40000001
|
||||||
|
@ -152,6 +165,8 @@
|
||||||
|
|
||||||
//automatic
|
//automatic
|
||||||
|
|
||||||
|
#ifndef CMAKE_BUILD
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(TARGET_WIN86) && !defined(TARGET_WIN64)
|
#if defined(_WIN32) && !defined(TARGET_WIN86) && !defined(TARGET_WIN64)
|
||||||
#if !defined(_M_AMD64) && !defined(__x86_64__)
|
#if !defined(_M_AMD64) && !defined(__x86_64__)
|
||||||
#define TARGET_WIN86
|
#define TARGET_WIN86
|
||||||
|
@ -233,6 +248,8 @@
|
||||||
#define FEAT_DSPREC DYNAREC_NONE
|
#define FEAT_DSPREC DYNAREC_NONE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // !CMAKE_BUILD
|
||||||
|
|
||||||
|
|
||||||
#if defined(TARGET_NO_NIXPROF)
|
#if defined(TARGET_NO_NIXPROF)
|
||||||
#define FEAT_HAS_NIXPROF 0
|
#define FEAT_HAS_NIXPROF 0
|
||||||
|
@ -295,6 +312,19 @@
|
||||||
#error Dont use HOST_NO_AREC
|
#error Dont use HOST_NO_AREC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Compiler Related
|
||||||
|
|
||||||
|
#if BUILD_COMPILER!=COMPILER_VC
|
||||||
|
#define ATTR_USED __attribute__((used))
|
||||||
|
#define ATTR_UNUSED __attribute__((used))
|
||||||
|
#else
|
||||||
|
#define ATTR_USED
|
||||||
|
#define ATTR_UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TARGET PLATFORM
|
// TARGET PLATFORM
|
||||||
|
|
||||||
#define RAM_SIZE_MAX (32*1024*1024)
|
#define RAM_SIZE_MAX (32*1024*1024)
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with reicast. If not, see <https://www.gnu.org/licenses/>.
|
along with reicast. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
#if BUILD_COMPILER!=COMPILER_VC && (BUILD_COMPILER!=COMPILER_CLANG || !WIN32)
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -145,3 +148,5 @@ char *read_name(char *reader, char *buffer, int *count)
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // BUILD_COMPILER!=COMPILER_VC
|
|
@ -86,10 +86,7 @@ void bm_WriteBlockMap(const string& file);
|
||||||
DynarecCodeEntryPtr DYNACALL bm_GetCode(u32 addr);
|
DynarecCodeEntryPtr DYNACALL bm_GetCode(u32 addr);
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#ifndef _MSC_VER
|
ATTR_USED DynarecCodeEntryPtr DYNACALL bm_GetCode2(u32 addr);
|
||||||
__attribute__((used))
|
|
||||||
#endif
|
|
||||||
DynarecCodeEntryPtr DYNACALL bm_GetCode2(u32 addr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RuntimeBlockInfo* bm_GetBlock(void* dynarec_code);
|
RuntimeBlockInfo* bm_GetBlock(void* dynarec_code);
|
||||||
|
|
|
@ -61,9 +61,7 @@ void ExecuteDelayslot_RTE();
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
int UpdateSystem();
|
int UpdateSystem();
|
||||||
#ifndef _MSC_VER
|
|
||||||
__attribute__((used))
|
ATTR_USED int UpdateSystem_INTC();
|
||||||
#endif
|
|
||||||
int UpdateSystem_INTC();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,15 +25,15 @@ u64 sh4_sched_ffb;
|
||||||
u32 sh4_sched_intr;
|
u32 sh4_sched_intr;
|
||||||
|
|
||||||
|
|
||||||
vector<sched_list> list;
|
vector<sched_list> sch_list; // using list as external inside a macro confuses clang and msc
|
||||||
|
|
||||||
int sh4_sched_next_id=-1;
|
int sh4_sched_next_id=-1;
|
||||||
|
|
||||||
u32 sh4_sched_remaining(int id, u32 reference)
|
u32 sh4_sched_remaining(int id, u32 reference)
|
||||||
{
|
{
|
||||||
if (list[id].end != -1)
|
if (sch_list[id].end != -1)
|
||||||
{
|
{
|
||||||
return list[id].end - reference;
|
return sch_list[id].end - reference;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -51,7 +51,7 @@ void sh4_sched_ffts()
|
||||||
u32 diff=-1;
|
u32 diff=-1;
|
||||||
int slot=-1;
|
int slot=-1;
|
||||||
|
|
||||||
for (size_t i=0;i<list.size();i++)
|
for (size_t i=0;i<sch_list.size();i++)
|
||||||
{
|
{
|
||||||
if (sh4_sched_remaining(i)<diff)
|
if (sh4_sched_remaining(i)<diff)
|
||||||
{
|
{
|
||||||
|
@ -79,9 +79,9 @@ int sh4_sched_register(int tag, sh4_sched_callback* ssc)
|
||||||
{
|
{
|
||||||
sched_list t={ssc,tag,-1,-1};
|
sched_list t={ssc,tag,-1,-1};
|
||||||
|
|
||||||
list.push_back(t);
|
sch_list.push_back(t);
|
||||||
|
|
||||||
return list.size()-1;
|
return sch_list.size()-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -103,16 +103,16 @@ void sh4_sched_request(int id, int cycles)
|
||||||
{
|
{
|
||||||
verify(cycles== -1 || (cycles >= 0 && cycles <= SH4_MAIN_CLOCK));
|
verify(cycles== -1 || (cycles >= 0 && cycles <= SH4_MAIN_CLOCK));
|
||||||
|
|
||||||
list[id].start=sh4_sched_now();
|
sch_list[id].start=sh4_sched_now();
|
||||||
|
|
||||||
if (cycles == -1) {
|
if (cycles == -1) {
|
||||||
list[id].end = -1;
|
sch_list[id].end = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
list[id].end = list[id].start + cycles;
|
sch_list[id].end = sch_list[id].start + cycles;
|
||||||
if (list[id].end == -1)
|
if (sch_list[id].end == -1)
|
||||||
list[id].end++;
|
sch_list[id].end++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sh4_sched_ffts();
|
sh4_sched_ffts();
|
||||||
|
@ -120,10 +120,10 @@ void sh4_sched_request(int id, int cycles)
|
||||||
|
|
||||||
int sh4_sched_elapsed(int id)
|
int sh4_sched_elapsed(int id)
|
||||||
{
|
{
|
||||||
if (list[id].end!=-1)
|
if (sch_list[id].end!=-1)
|
||||||
{
|
{
|
||||||
int rv=sh4_sched_now()-list[id].start;
|
int rv=sh4_sched_now()-sch_list[id].start;
|
||||||
list[id].start=sh4_sched_now();
|
sch_list[id].start=sh4_sched_now();
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -132,12 +132,12 @@ int sh4_sched_elapsed(int id)
|
||||||
|
|
||||||
void handle_cb(int id)
|
void handle_cb(int id)
|
||||||
{
|
{
|
||||||
int remain=list[id].end-list[id].start;
|
int remain=sch_list[id].end-sch_list[id].start;
|
||||||
int elapsd=sh4_sched_elapsed(id);
|
int elapsd=sh4_sched_elapsed(id);
|
||||||
int jitter=elapsd-remain;
|
int jitter=elapsd-remain;
|
||||||
|
|
||||||
list[id].end=-1;
|
sch_list[id].end=-1;
|
||||||
int re_sch=list[id].cb(list[id].tag,remain,jitter);
|
int re_sch=sch_list[id].cb(sch_list[id].tag,remain,jitter);
|
||||||
|
|
||||||
if (re_sch > 0)
|
if (re_sch > 0)
|
||||||
sh4_sched_request(id, max(0, re_sch - jitter));
|
sh4_sched_request(id, max(0, re_sch - jitter));
|
||||||
|
@ -156,7 +156,7 @@ void sh4_sched_tick(int cycles)
|
||||||
sh4_sched_intr++;
|
sh4_sched_intr++;
|
||||||
if (sh4_sched_next_id!=-1)
|
if (sh4_sched_next_id!=-1)
|
||||||
{
|
{
|
||||||
for (int i=0;i<list.size();i++)
|
for (int i=0;i<sch_list.size();i++)
|
||||||
{
|
{
|
||||||
int remaining = sh4_sched_remaining(i, fztime);
|
int remaining = sh4_sched_remaining(i, fztime);
|
||||||
verify(remaining >= 0 || remaining == -1);
|
verify(remaining >= 0 || remaining == -1);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "gl4.h"
|
#include "gl4.h"
|
||||||
#include "glcache.h"
|
#include "../gles/glcache.h"
|
||||||
|
|
||||||
GLuint gl4BindRTT(u32 addy, u32 fbw, u32 fbh, u32 channels, u32 fmt)
|
GLuint gl4BindRTT(u32 addy, u32 fbw, u32 fbh, u32 channels, u32 fmt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
#include "linux-dist/main.h" // FIXME for kcode[]
|
#include "linux-dist/main.h" // FIXME for kcode[]
|
||||||
#include "gui_util.h"
|
#include "gui_util.h"
|
||||||
#include "gui_android.h"
|
#include "gui_android.h"
|
||||||
#include "version/version.h"
|
|
||||||
|
#include "version.h"
|
||||||
#include "oslib/audiostream.h"
|
#include "oslib/audiostream.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -441,7 +441,7 @@ extern u32 old_dn;
|
||||||
//./core/hw/sh4/sh4_sched.o
|
//./core/hw/sh4/sh4_sched.o
|
||||||
extern u64 sh4_sched_ffb;
|
extern u64 sh4_sched_ffb;
|
||||||
extern u32 sh4_sched_intr;
|
extern u32 sh4_sched_intr;
|
||||||
extern vector<sched_list> list;
|
extern vector<sched_list> sch_list;
|
||||||
//extern int sh4_sched_next_id;
|
//extern int sh4_sched_next_id;
|
||||||
|
|
||||||
|
|
||||||
|
@ -975,8 +975,6 @@ bool dc_serialize(void **data, unsigned int *total_size)
|
||||||
REICAST_S(decoded_srimask);
|
REICAST_S(decoded_srimask);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//default to nommu_full
|
//default to nommu_full
|
||||||
i = 3 ;
|
i = 3 ;
|
||||||
if ( do_sqw_nommu == &do_sqw_nommu_area_3)
|
if ( do_sqw_nommu == &do_sqw_nommu_area_3)
|
||||||
|
@ -1008,48 +1006,49 @@ bool dc_serialize(void **data, unsigned int *total_size)
|
||||||
|
|
||||||
//extern vector<sched_list> list;
|
//extern vector<sched_list> list;
|
||||||
|
|
||||||
REICAST_S(list[aica_schid].tag) ;
|
|
||||||
REICAST_S(list[aica_schid].start) ;
|
|
||||||
REICAST_S(list[aica_schid].end) ;
|
|
||||||
|
|
||||||
REICAST_S(list[rtc_schid].tag) ;
|
REICAST_S(sch_list[aica_schid].tag) ;
|
||||||
REICAST_S(list[rtc_schid].start) ;
|
REICAST_S(sch_list[aica_schid].start) ;
|
||||||
REICAST_S(list[rtc_schid].end) ;
|
REICAST_S(sch_list[aica_schid].end) ;
|
||||||
|
|
||||||
REICAST_S(list[gdrom_schid].tag) ;
|
REICAST_S(sch_list[rtc_schid].tag) ;
|
||||||
REICAST_S(list[gdrom_schid].start) ;
|
REICAST_S(sch_list[rtc_schid].start) ;
|
||||||
REICAST_S(list[gdrom_schid].end) ;
|
REICAST_S(sch_list[rtc_schid].end) ;
|
||||||
|
|
||||||
REICAST_S(list[maple_schid].tag) ;
|
REICAST_S(sch_list[gdrom_schid].tag) ;
|
||||||
REICAST_S(list[maple_schid].start) ;
|
REICAST_S(sch_list[gdrom_schid].start) ;
|
||||||
REICAST_S(list[maple_schid].end) ;
|
REICAST_S(sch_list[gdrom_schid].end) ;
|
||||||
|
|
||||||
REICAST_S(list[dma_sched_id].tag) ;
|
REICAST_S(sch_list[maple_schid].tag) ;
|
||||||
REICAST_S(list[dma_sched_id].start) ;
|
REICAST_S(sch_list[maple_schid].start) ;
|
||||||
REICAST_S(list[dma_sched_id].end) ;
|
REICAST_S(sch_list[maple_schid].end) ;
|
||||||
|
|
||||||
|
REICAST_S(sch_list[dma_sched_id].tag) ;
|
||||||
|
REICAST_S(sch_list[dma_sched_id].start) ;
|
||||||
|
REICAST_S(sch_list[dma_sched_id].end) ;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
REICAST_S(list[tmu_sched[i]].tag) ;
|
REICAST_S(sch_list[tmu_sched[i]].tag) ;
|
||||||
REICAST_S(list[tmu_sched[i]].start) ;
|
REICAST_S(sch_list[tmu_sched[i]].start) ;
|
||||||
REICAST_S(list[tmu_sched[i]].end) ;
|
REICAST_S(sch_list[tmu_sched[i]].end) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
REICAST_S(list[render_end_schid].tag) ;
|
REICAST_S(sch_list[render_end_schid].tag) ;
|
||||||
REICAST_S(list[render_end_schid].start) ;
|
REICAST_S(sch_list[render_end_schid].start) ;
|
||||||
REICAST_S(list[render_end_schid].end) ;
|
REICAST_S(sch_list[render_end_schid].end) ;
|
||||||
|
|
||||||
REICAST_S(list[vblank_schid].tag) ;
|
REICAST_S(sch_list[vblank_schid].tag) ;
|
||||||
REICAST_S(list[vblank_schid].start) ;
|
REICAST_S(sch_list[vblank_schid].start) ;
|
||||||
REICAST_S(list[vblank_schid].end) ;
|
REICAST_S(sch_list[vblank_schid].end) ;
|
||||||
|
|
||||||
REICAST_S(list[time_sync].tag) ;
|
REICAST_S(sch_list[time_sync].tag) ;
|
||||||
REICAST_S(list[time_sync].start) ;
|
REICAST_S(sch_list[time_sync].start) ;
|
||||||
REICAST_S(list[time_sync].end) ;
|
REICAST_S(sch_list[time_sync].end) ;
|
||||||
|
|
||||||
REICAST_S(list[modem_sched].tag) ;
|
REICAST_S(sch_list[modem_sched].tag) ;
|
||||||
REICAST_S(list[modem_sched].start) ;
|
REICAST_S(sch_list[modem_sched].start) ;
|
||||||
REICAST_S(list[modem_sched].end) ;
|
REICAST_S(sch_list[modem_sched].end) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1408,50 +1407,50 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
|
||||||
REICAST_US(sh4_sched_ffb);
|
REICAST_US(sh4_sched_ffb);
|
||||||
REICAST_US(sh4_sched_intr);
|
REICAST_US(sh4_sched_intr);
|
||||||
|
|
||||||
//extern vector<sched_list> list;
|
//extern vector<sched_list> sch_list;
|
||||||
|
|
||||||
REICAST_US(list[aica_schid].tag) ;
|
REICAST_US(sch_list[aica_schid].tag) ;
|
||||||
REICAST_US(list[aica_schid].start) ;
|
REICAST_US(sch_list[aica_schid].start) ;
|
||||||
REICAST_US(list[aica_schid].end) ;
|
REICAST_US(sch_list[aica_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[rtc_schid].tag) ;
|
REICAST_US(sch_list[rtc_schid].tag) ;
|
||||||
REICAST_US(list[rtc_schid].start) ;
|
REICAST_US(sch_list[rtc_schid].start) ;
|
||||||
REICAST_US(list[rtc_schid].end) ;
|
REICAST_US(sch_list[rtc_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[gdrom_schid].tag) ;
|
REICAST_US(sch_list[gdrom_schid].tag) ;
|
||||||
REICAST_US(list[gdrom_schid].start) ;
|
REICAST_US(sch_list[gdrom_schid].start) ;
|
||||||
REICAST_US(list[gdrom_schid].end) ;
|
REICAST_US(sch_list[gdrom_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[maple_schid].tag) ;
|
REICAST_US(sch_list[maple_schid].tag) ;
|
||||||
REICAST_US(list[maple_schid].start) ;
|
REICAST_US(sch_list[maple_schid].start) ;
|
||||||
REICAST_US(list[maple_schid].end) ;
|
REICAST_US(sch_list[maple_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[dma_sched_id].tag) ;
|
REICAST_US(sch_list[dma_sched_id].tag) ;
|
||||||
REICAST_US(list[dma_sched_id].start) ;
|
REICAST_US(sch_list[dma_sched_id].start) ;
|
||||||
REICAST_US(list[dma_sched_id].end) ;
|
REICAST_US(sch_list[dma_sched_id].end) ;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
REICAST_US(list[tmu_sched[i]].tag) ;
|
REICAST_US(sch_list[tmu_sched[i]].tag) ;
|
||||||
REICAST_US(list[tmu_sched[i]].start) ;
|
REICAST_US(sch_list[tmu_sched[i]].start) ;
|
||||||
REICAST_US(list[tmu_sched[i]].end) ;
|
REICAST_US(sch_list[tmu_sched[i]].end) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
REICAST_US(list[render_end_schid].tag) ;
|
REICAST_US(sch_list[render_end_schid].tag) ;
|
||||||
REICAST_US(list[render_end_schid].start) ;
|
REICAST_US(sch_list[render_end_schid].start) ;
|
||||||
REICAST_US(list[render_end_schid].end) ;
|
REICAST_US(sch_list[render_end_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[vblank_schid].tag) ;
|
REICAST_US(sch_list[vblank_schid].tag) ;
|
||||||
REICAST_US(list[vblank_schid].start) ;
|
REICAST_US(sch_list[vblank_schid].start) ;
|
||||||
REICAST_US(list[vblank_schid].end) ;
|
REICAST_US(sch_list[vblank_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[time_sync].tag) ;
|
REICAST_US(sch_list[time_sync].tag) ;
|
||||||
REICAST_US(list[time_sync].start) ;
|
REICAST_US(sch_list[time_sync].start) ;
|
||||||
REICAST_US(list[time_sync].end) ;
|
REICAST_US(sch_list[time_sync].end) ;
|
||||||
|
|
||||||
REICAST_US(list[modem_sched].tag) ;
|
REICAST_US(sch_list[modem_sched].tag) ;
|
||||||
REICAST_US(list[modem_sched].start) ;
|
REICAST_US(sch_list[modem_sched].start) ;
|
||||||
REICAST_US(list[modem_sched].end) ;
|
REICAST_US(sch_list[modem_sched].end) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1800,48 +1799,48 @@ bool dc_unserialize(void **data, unsigned int *total_size)
|
||||||
|
|
||||||
//extern vector<sched_list> list;
|
//extern vector<sched_list> list;
|
||||||
|
|
||||||
REICAST_US(list[aica_schid].tag) ;
|
REICAST_US(sch_list[aica_schid].tag) ;
|
||||||
REICAST_US(list[aica_schid].start) ;
|
REICAST_US(sch_list[aica_schid].start) ;
|
||||||
REICAST_US(list[aica_schid].end) ;
|
REICAST_US(sch_list[aica_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[rtc_schid].tag) ;
|
REICAST_US(sch_list[rtc_schid].tag) ;
|
||||||
REICAST_US(list[rtc_schid].start) ;
|
REICAST_US(sch_list[rtc_schid].start) ;
|
||||||
REICAST_US(list[rtc_schid].end) ;
|
REICAST_US(sch_list[rtc_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[gdrom_schid].tag) ;
|
REICAST_US(sch_list[gdrom_schid].tag) ;
|
||||||
REICAST_US(list[gdrom_schid].start) ;
|
REICAST_US(sch_list[gdrom_schid].start) ;
|
||||||
REICAST_US(list[gdrom_schid].end) ;
|
REICAST_US(sch_list[gdrom_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[maple_schid].tag) ;
|
REICAST_US(sch_list[maple_schid].tag) ;
|
||||||
REICAST_US(list[maple_schid].start) ;
|
REICAST_US(sch_list[maple_schid].start) ;
|
||||||
REICAST_US(list[maple_schid].end) ;
|
REICAST_US(sch_list[maple_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[dma_sched_id].tag) ;
|
REICAST_US(sch_list[dma_sched_id].tag) ;
|
||||||
REICAST_US(list[dma_sched_id].start) ;
|
REICAST_US(sch_list[dma_sched_id].start) ;
|
||||||
REICAST_US(list[dma_sched_id].end) ;
|
REICAST_US(sch_list[dma_sched_id].end) ;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
REICAST_US(list[tmu_sched[i]].tag) ;
|
REICAST_US(sch_list[tmu_sched[i]].tag) ;
|
||||||
REICAST_US(list[tmu_sched[i]].start) ;
|
REICAST_US(sch_list[tmu_sched[i]].start) ;
|
||||||
REICAST_US(list[tmu_sched[i]].end) ;
|
REICAST_US(sch_list[tmu_sched[i]].end) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
REICAST_US(list[render_end_schid].tag) ;
|
REICAST_US(sch_list[render_end_schid].tag) ;
|
||||||
REICAST_US(list[render_end_schid].start) ;
|
REICAST_US(sch_list[render_end_schid].start) ;
|
||||||
REICAST_US(list[render_end_schid].end) ;
|
REICAST_US(sch_list[render_end_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[vblank_schid].tag) ;
|
REICAST_US(sch_list[vblank_schid].tag) ;
|
||||||
REICAST_US(list[vblank_schid].start) ;
|
REICAST_US(sch_list[vblank_schid].start) ;
|
||||||
REICAST_US(list[vblank_schid].end) ;
|
REICAST_US(sch_list[vblank_schid].end) ;
|
||||||
|
|
||||||
REICAST_US(list[time_sync].tag) ;
|
REICAST_US(sch_list[time_sync].tag) ;
|
||||||
REICAST_US(list[time_sync].start) ;
|
REICAST_US(sch_list[time_sync].start) ;
|
||||||
REICAST_US(list[time_sync].end) ;
|
REICAST_US(sch_list[time_sync].end) ;
|
||||||
|
|
||||||
REICAST_US(list[modem_sched].tag) ;
|
REICAST_US(sch_list[modem_sched].tag) ;
|
||||||
REICAST_US(list[modem_sched].start) ;
|
REICAST_US(sch_list[modem_sched].start) ;
|
||||||
REICAST_US(list[modem_sched].end) ;
|
REICAST_US(sch_list[modem_sched].end) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,10 @@
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "cfg/cfg.h"
|
#include "cfg/cfg.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
#include <direct.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BUILD_COMPILER==COMPILER_VC
|
#if BUILD_COMPILER==COMPILER_VC || (WIN32 && BUILD_COMPILER==COMPILER_CLANG)
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
#include <direct.h>
|
||||||
#define access _access
|
#define access _access
|
||||||
#define R_OK 4
|
#define R_OK 4
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -385,9 +385,9 @@ using namespace std;
|
||||||
#include "stdclass.h"
|
#include "stdclass.h"
|
||||||
|
|
||||||
#ifndef RELEASE
|
#ifndef RELEASE
|
||||||
#define EMUERROR(format, ...) printf("Error in %s:%s:%d: " format "\n", \
|
#define EMUERROR(format, ...) printf("Error in %20s:%s:%d: " format "\n", \
|
||||||
strlen(__FILE__) <= 20 ? __FILE__ : __FILE__ + strlen(__FILE__) - 20, \
|
__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||||
__FUNCTION__, __LINE__, ##__VA_ARGS__)
|
//strlen(__FILE__) <= 20 ? __FILE__ : __FILE__ + strlen(__FILE__) - 20,
|
||||||
#else
|
#else
|
||||||
#define EMUERROR(format, ...)
|
#define EMUERROR(format, ...)
|
||||||
#endif
|
#endif
|
||||||
|
@ -521,7 +521,7 @@ typedef union
|
||||||
#if COMPILER_VC==BUILD_COMPILER
|
#if COMPILER_VC==BUILD_COMPILER
|
||||||
#pragma warning( disable : 4127 4996 /*4244*/)
|
#pragma warning( disable : 4127 4996 /*4244*/)
|
||||||
#else
|
#else
|
||||||
#define stricmp strcasecmp
|
#define stricmp _stricmp // ISO , was strcasecmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STRIP_TEXT
|
#ifndef STRIP_TEXT
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* reicast: version.h
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define REICAST_VERSION "@GIT_VERSION@"
|
||||||
|
#define GIT_HASH "@GIT_HASH@"
|
||||||
|
#define BUILD_DATE __DATE__
|
|
@ -673,7 +673,7 @@ int CALLBACK WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
AddVectoredExceptionHandler(1, ExeptionHandler);
|
AddVectoredExceptionHandler(1, ExeptionHandler);
|
||||||
#else
|
#else
|
||||||
SetUnhandledExceptionFilter(&ExeptionHandler);
|
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)&ExeptionHandler);
|
||||||
#endif
|
#endif
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
__try
|
__try
|
||||||
|
|
|
@ -0,0 +1,168 @@
|
||||||
|
# - Returns a version string from Git
|
||||||
|
#
|
||||||
|
# These functions force a re-configure on each git commit so that you can
|
||||||
|
# trust the values of the variables in your build system.
|
||||||
|
#
|
||||||
|
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the refspec and sha hash of the current head revision
|
||||||
|
#
|
||||||
|
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe on the source tree, and adjusting
|
||||||
|
# the output so that it tests false if an error occurs.
|
||||||
|
#
|
||||||
|
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||||
|
#
|
||||||
|
# Returns the results of git describe --exact-match on the source tree,
|
||||||
|
# and adjusting the output so that it tests false if there was no exact
|
||||||
|
# matching tag.
|
||||||
|
#
|
||||||
|
# git_local_changes(<var>)
|
||||||
|
#
|
||||||
|
# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes.
|
||||||
|
# Uses the return code of "git diff-index --quiet HEAD --".
|
||||||
|
# Does not regard untracked files.
|
||||||
|
#
|
||||||
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
|
#
|
||||||
|
# Original Author:
|
||||||
|
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||||
|
# http://academic.cleardefinition.com
|
||||||
|
# Iowa State University HCI Graduate Program/VRAC
|
||||||
|
#
|
||||||
|
# Copyright Iowa State University 2009-2010.
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
if(__get_git_revision_description)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__get_git_revision_description YES)
|
||||||
|
|
||||||
|
# We must run the following at "include" time, not at function call time,
|
||||||
|
# to find the path to this module rather than the path to a calling list file
|
||||||
|
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||||
|
|
||||||
|
function(get_git_head_revision _refspecvar _hashvar)
|
||||||
|
set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||||
|
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||||
|
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||||
|
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||||
|
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||||
|
# We have reached the root directory, we are not in git
|
||||||
|
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||||
|
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||||
|
endwhile()
|
||||||
|
# check if this is a submodule
|
||||||
|
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||||
|
file(READ ${GIT_DIR} submodule)
|
||||||
|
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
|
||||||
|
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||||
|
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
|
||||||
|
endif()
|
||||||
|
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||||
|
if(NOT EXISTS "${GIT_DATA}")
|
||||||
|
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||||
|
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
||||||
|
|
||||||
|
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||||
|
"${GIT_DATA}/grabRef.cmake"
|
||||||
|
@ONLY)
|
||||||
|
include("${GIT_DATA}/grabRef.cmake")
|
||||||
|
|
||||||
|
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||||
|
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_describe _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# TODO sanitize
|
||||||
|
#if((${ARGN}" MATCHES "&&") OR
|
||||||
|
# (ARGN MATCHES "||") OR
|
||||||
|
# (ARGN MATCHES "\\;"))
|
||||||
|
# message("Please report the following error to the project!")
|
||||||
|
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||||
|
#endif()
|
||||||
|
|
||||||
|
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||||
|
|
||||||
|
execute_process(COMMAND
|
||||||
|
"${GIT_EXECUTABLE}"
|
||||||
|
describe
|
||||||
|
${hash}
|
||||||
|
${ARGN}
|
||||||
|
WORKING_DIRECTORY
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE
|
||||||
|
res
|
||||||
|
OUTPUT_VARIABLE
|
||||||
|
out
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
set(out "${out}-${res}-NOTFOUND")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${_var} "${out}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_get_exact_tag _var)
|
||||||
|
git_describe(out --exact-match ${ARGN})
|
||||||
|
set(${_var} "${out}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(git_local_changes _var)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
find_package(Git QUIET)
|
||||||
|
endif()
|
||||||
|
get_git_head_revision(refspec hash)
|
||||||
|
if(NOT GIT_FOUND)
|
||||||
|
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
if(NOT hash)
|
||||||
|
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(COMMAND
|
||||||
|
"${GIT_EXECUTABLE}"
|
||||||
|
diff-index --quiet HEAD --
|
||||||
|
WORKING_DIRECTORY
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
RESULT_VARIABLE
|
||||||
|
res
|
||||||
|
OUTPUT_VARIABLE
|
||||||
|
out
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if(res EQUAL 0)
|
||||||
|
set(${_var} "CLEAN" PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${_var} "DIRTY" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
|
@ -0,0 +1,41 @@
|
||||||
|
#
|
||||||
|
# Internal file for GetGitRevisionDescription.cmake
|
||||||
|
#
|
||||||
|
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||||
|
#
|
||||||
|
# Original Author:
|
||||||
|
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||||
|
# http://academic.cleardefinition.com
|
||||||
|
# Iowa State University HCI Graduate Program/VRAC
|
||||||
|
#
|
||||||
|
# Copyright Iowa State University 2009-2010.
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
set(HEAD_HASH)
|
||||||
|
|
||||||
|
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||||
|
|
||||||
|
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||||
|
if(HEAD_CONTENTS MATCHES "ref")
|
||||||
|
# named branch
|
||||||
|
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||||
|
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||||
|
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
|
else()
|
||||||
|
configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
|
||||||
|
file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
|
||||||
|
if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
|
||||||
|
set(HEAD_HASH "${CMAKE_MATCH_1}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# detached HEAD
|
||||||
|
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT HEAD_HASH)
|
||||||
|
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||||
|
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||||
|
endif()
|
|
@ -0,0 +1,101 @@
|
||||||
|
## android.cmake
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function(TestPathNDK ndkPath)
|
||||||
|
#
|
||||||
|
file(TO_CMAKE_PATH "${ndkPath}" testPath)
|
||||||
|
|
||||||
|
if(NOT NDK AND EXISTS "${testPath}")
|
||||||
|
if(EXISTS "${testPath}/ndk-bundle")
|
||||||
|
set(NDK ${testPath}/ndk-bundle PARENT_SCOPE)
|
||||||
|
elseif(EXISTS "${testPath}/sysroot")
|
||||||
|
set(NDK ${testPath} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
endfunction(TestPathNDK)
|
||||||
|
|
||||||
|
|
||||||
|
TestPathNDK("$ENV{ANDROID_HOME}")
|
||||||
|
TestPathNDK("$ENV{NDK}")
|
||||||
|
TestPathNDK("$ENV{NDK_ROOT}")
|
||||||
|
|
||||||
|
if(NOT NDK)
|
||||||
|
message("Failed to find NDK !")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### option for ARM || ARM64 ? HOST isn't useful it's a cross ...
|
||||||
|
|
||||||
|
#set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_NAME Android)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 22) # API level
|
||||||
|
|
||||||
|
set(CMAKE_ANDROID_NDK ${NDK})
|
||||||
|
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a) #arm64-v8a , armeabi-v7a , armeabi
|
||||||
|
set(CMAKE_ANDROID_STL_TYPE c++_static) #gnustl_static libc++ will allow C++17, if you use _shared you must include in apk !
|
||||||
|
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang)
|
||||||
|
|
||||||
|
|
||||||
|
#arm $TOOLCHAIN/ arm-linux-androideabi /lib/
|
||||||
|
#arm64 $TOOLCHAIN/ aarch64-linux-android /lib/
|
||||||
|
#x86 $TOOLCHAIN/ i686-linux-android /lib/
|
||||||
|
#x86_64 $TOOLCHAIN/ x86_64-linux-android /lib/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include(${NDK}/build/cmake/android.toolchain.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
set(ANDROID ON)
|
||||||
|
|
||||||
|
add_definitions(-D_ANDROID -DANDROID)
|
||||||
|
add_definitions(-DANDROID_STL=c++_static)
|
||||||
|
|
||||||
|
|
||||||
|
add_definitions(-DTARGET_ANDROID)
|
||||||
|
|
||||||
|
add_definitions(-DGLES)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## FML
|
||||||
|
|
||||||
|
#[[
|
||||||
|
CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS
|
||||||
|
CMAKE_ANDROID_API
|
||||||
|
CMAKE_ANDROID_API_MIN
|
||||||
|
CMAKE_ANDROID_ARCH
|
||||||
|
CMAKE_ANDROID_ARCH_ABI
|
||||||
|
CMAKE_ANDROID_ARM_MODE
|
||||||
|
CMAKE_ANDROID_ARM_NEON
|
||||||
|
CMAKE_ANDROID_ASSETS_DIRECTORIES
|
||||||
|
CMAKE_ANDROID_GUI
|
||||||
|
CMAKE_ANDROID_JAR_DEPENDENCIES
|
||||||
|
CMAKE_ANDROID_JAR_DIRECTORIES
|
||||||
|
CMAKE_ANDROID_JAVA_SOURCE_DIR
|
||||||
|
CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES
|
||||||
|
CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES
|
||||||
|
CMAKE_ANDROID_NDK
|
||||||
|
CMAKE_ANDROID_NDK_DEPRECATED_HEADERS
|
||||||
|
CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG
|
||||||
|
CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION
|
||||||
|
CMAKE_ANDROID_PROCESS_MAX
|
||||||
|
CMAKE_ANDROID_PROGUARD
|
||||||
|
CMAKE_ANDROID_PROGUARD_CONFIG_PATH
|
||||||
|
CMAKE_ANDROID_SECURE_PROPS_PATH
|
||||||
|
CMAKE_ANDROID_SKIP_ANT_STEP
|
||||||
|
CMAKE_ANDROID_STANDALONE_TOOLCHAIN
|
||||||
|
CMAKE_ANDROID_STL_TYPE
|
||||||
|
#]]
|
|
@ -0,0 +1,481 @@
|
||||||
|
## config module
|
||||||
|
#
|
||||||
|
# get luserx0 to doc this shit or something, vars in all caps are to be exported as defs if they aren't in build.h already
|
||||||
|
# handle options for FEAT per platform, so rec isn't built for targets w.o one...
|
||||||
|
# *TODO* fix Android for build system in emu too, OS_LINUX is hardly fitting: prob works better as PLATFORM_ANDROID_{S,N}DK or something
|
||||||
|
# *TODO* setup git version like it's done in VS/make and configure header so --version works still
|
||||||
|
# *TODO* lots of other shit to improve build, add enabling/disabling libs/features, setting 3rd party libs as either built in static, dynamic or shared/system
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
set(ZBUILD Off)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(BUILD_LIBS OFF) ## Scope:Local If set will build libs { dreamcast, osd, ... }
|
||||||
|
set(BUILD_LIB_TYPE STATIC) ## Scope:Local If BUILD_LIBS is set, will use this as type of lib to use { STATIC, SHARED, MODULE (plugin) } *TODO*
|
||||||
|
set(BUILD_SHARED_LIBS OFF) ## Scope:CMAKE If type is not specified in add_library, use SHARED
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Build flags ##
|
||||||
|
#
|
||||||
|
|
||||||
|
set(DC_PLATFORM_MASK 7) # Z: Uh, not a bitset
|
||||||
|
set(DC_PLATFORM_DREAMCAST 0) # /* Works, for the most part */
|
||||||
|
set(DC_PLATFORM_DEV_UNIT 1) # /* This is missing hardware */
|
||||||
|
set(DC_PLATFORM_NAOMI 2) # /* Works, for the most part */
|
||||||
|
set(DC_PLATFORM_NAOMI2 3) # /* Needs to be done, 2xsh4 + 2xpvr + custom TNL */
|
||||||
|
set(DC_PLATFORM_ATOMISWAVE 4) # /* Needs to be done, DC-like hardware with possibly more ram */
|
||||||
|
set(DC_PLATFORM_HIKARU 5) # /* Needs to be done, 2xsh4, 2x aica , custom vpu */
|
||||||
|
set(DC_PLATFORM_AURORA 6) # /* Needs to be done, Uses newer 300 mhz sh4 + 150 mhz pvr mbx SoC */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(OS_WINDOWS 0x10000001) # HOST_OS
|
||||||
|
set(OS_LINUX 0x10000002)
|
||||||
|
set(OS_DARWIN 0x10000003)
|
||||||
|
set(OS_IOS 0x10000004) # todo: iOS != OS_DARWIN
|
||||||
|
set(OS_ANDROID 0x10000005) # todo: should be SYSTEM_ANDROID but ! OS_LINUX
|
||||||
|
|
||||||
|
set(OS_UWP 0x10000011)
|
||||||
|
set(OS_NSW_HOS 0x80000001)
|
||||||
|
set(OS_PS4_BSD 0x80000002)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CPU_X86 0x20000001) # HOST_CPU
|
||||||
|
set(CPU_X64 0x20000004)
|
||||||
|
set(CPU_ARM 0x20000002)
|
||||||
|
set(CPU_A64 0x20000008)
|
||||||
|
set(CPU_MIPS 0x20000003)
|
||||||
|
set(CPU_MIPS64 0x20000009)
|
||||||
|
set(CPU_PPC 0x20000006)
|
||||||
|
set(CPU_PPC64 0x20000007)
|
||||||
|
set(CPU_GENERIC 0x20000005) # used for pnacl, emscripten, etc
|
||||||
|
|
||||||
|
set(DYNAREC_NONE 0x40000001) # FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
|
||||||
|
set(DYNAREC_JIT 0x40000002)
|
||||||
|
set(DYNAREC_CPP 0x40000003)
|
||||||
|
|
||||||
|
set(COMPILER_VC 0x30000001) # BUILD_COMPILER
|
||||||
|
set(COMPILER_GCC 0x30000002)
|
||||||
|
set(COMPILER_CLANG 0x30000002)
|
||||||
|
set(COMPILER_INTEL 0x30000002)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## These default to host, but are used for cross so make sure not to contaminate
|
||||||
|
#
|
||||||
|
# CMAKE_SYSTEM ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}.
|
||||||
|
# CMAKE_SYSTEM_NAME CMAKE_HOST_SYSTEM_NAME uname -s Linux, Windows, and Darwin
|
||||||
|
# CMAKE_SYSTEM_VERSION CMAKE_HOST_SYSTEM_VERSION uname -r
|
||||||
|
# CMAKE_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_PROCESSOR uname -p
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# BOOL: CMAKE_HOST_UNIX CMAKE_HOST_WIN32 CMAKE_HOST_APPLE
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# CMAKE_LIBRARY_ARCHITECTURE CMAKE_<LANG>_LIBRARY_ARCHITECTURE <prefix>/lib/<arch>
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## strings are used to append to path/file names, and to filter multiple possibilities down to one
|
||||||
|
# AMD64/x86_64:x64, i*86:x86, ppc/powerpc[64][b|l]e:ppc[64] etc
|
||||||
|
#
|
||||||
|
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686") # todo: check MATCHES "i.86" ?
|
||||||
|
set(host_arch "x86")
|
||||||
|
set(HOST_CPU ${CPU_X86})
|
||||||
|
#
|
||||||
|
elseif(("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") OR
|
||||||
|
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64"))
|
||||||
|
set(host_arch "x64")
|
||||||
|
set(HOST_CPU ${CPU_X64})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64")
|
||||||
|
set(host_arch "arm64")
|
||||||
|
set(HOST_CPU ${CPU_A64})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
|
||||||
|
set(host_arch "arm")
|
||||||
|
set(HOST_CPU ${CPU_ARM})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc64")
|
||||||
|
set(host_arch "ppc64")
|
||||||
|
set(HOST_CPU ${CPU_PPC64})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc") # has to be done after ppc64 obv
|
||||||
|
set(host_arch "ppc")
|
||||||
|
set(HOST_CPU ${CPU_PPC})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips64") # todo: check , r* names?
|
||||||
|
set(host_arch "mips64")
|
||||||
|
set(HOST_CPU ${CPU_MIPS64})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips") # todo: check , r* names?
|
||||||
|
set(host_arch "mips")
|
||||||
|
set(HOST_CPU ${CPU_MIPS})
|
||||||
|
#
|
||||||
|
else()
|
||||||
|
message("Warning: Unknown Host System Processor: \"${CMAKE_SYSTEM_PROCESSOR}\"")
|
||||||
|
set(host_arch "${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
set(HOST_CPU ${CPU_GENERIC})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
string(TOLOWER ${CMAKE_SYSTEM_NAME} host_os)
|
||||||
|
|
||||||
|
#message(" - testing cmake host_os: \"${host_os}\"")
|
||||||
|
|
||||||
|
## HOST_* is not TARGET_* ;; change ndc-e internal naming it's wrong , then change this ;;
|
||||||
|
|
||||||
|
if("android" STREQUAL "${host_os}" OR ANDROID)
|
||||||
|
set(HOST_OS ${OS_LINUX}) # *FIXME* we might have to keep as OS_LINUX or add to full cleanup list :|
|
||||||
|
|
||||||
|
elseif("windowsstore" STREQUAL "${host_os}")
|
||||||
|
set(HOST_OS ${OS_UWP})
|
||||||
|
set(HOST_CPU ${CPU_X64})
|
||||||
|
|
||||||
|
elseif(CMAKE_HOST_WIN32)
|
||||||
|
set(HOST_OS ${OS_WINDOWS})
|
||||||
|
|
||||||
|
elseif(CMAKE_HOST_APPLE)
|
||||||
|
|
||||||
|
if("${host_arch}" MATCHES "arm")
|
||||||
|
set(HOST_OS ${OS_IOS})
|
||||||
|
set(TARGET_IOS On)
|
||||||
|
add_definitions(-DTARGET_IPHONE -DTARGET_IOS)
|
||||||
|
else()
|
||||||
|
set(HOST_OS ${OS_DARWIN}) # todo ios check, check compiler/arch?
|
||||||
|
set(TARGET_OSX On)
|
||||||
|
add_definitions(-DTARGET_OSX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
elseif(CMAKE_HOST_UNIX) # GP UNIX MUST BE AFTER OTHER UNIX'ish options such as APPLE , it matches both
|
||||||
|
|
||||||
|
set(HOST_OS ${OS_LINUX}) # todo android check, just check android vars?
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#option(TARGET_NO_REC BOOL "")
|
||||||
|
#option(TARGET_NO_AREC BOOL "")
|
||||||
|
#option(TARGET_NO_JIT BOOL "")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Dynarec avail on x86,x64,arm and aarch64 in arm.32 compat
|
||||||
|
#
|
||||||
|
if((${HOST_CPU} EQUAL ${CPU_X86}) OR (${HOST_CPU} EQUAL ${CPU_X64}) OR
|
||||||
|
(${HOST_CPU} EQUAL ${CPU_ARM}) OR (${HOST_CPU} EQUAL ${CPU_A64}))
|
||||||
|
#
|
||||||
|
message("Dynarec Features Available")
|
||||||
|
|
||||||
|
set(FEAT_SHREC ${DYNAREC_JIT})
|
||||||
|
set(FEAT_AREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_DSPREC ${DYNAREC_NONE})
|
||||||
|
#
|
||||||
|
else()
|
||||||
|
set(FEAT_SHREC ${DYNAREC_CPP})
|
||||||
|
set(FEAT_AREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_DSPREC ${DYNAREC_NONE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
## Handle TARGET_* to FEAT_ *FIXME* stupid use one or the other and propogate : part of build cleanup , TARGET_ will only be for platform specifics and FEAT_ as OPTIONS
|
||||||
|
#
|
||||||
|
if(TARGET_NO_REC)
|
||||||
|
set(FEAT_SHREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_AREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_DSPREC ${DYNAREC_NONE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(TARGET_NO_AREC)
|
||||||
|
set(FEAT_SHREC ${DYNAREC_JIT})
|
||||||
|
set(FEAT_AREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_DSPREC ${DYNAREC_NONE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(TARGET_NO_JIT)
|
||||||
|
set(FEAT_SHREC ${DYNAREC_CPP})
|
||||||
|
set(FEAT_AREC ${DYNAREC_NONE})
|
||||||
|
set(FEAT_DSPREC ${DYNAREC_NONE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
######## Looks like something to delete, but if we're going to handle options here and NOT in libosd/lib* #########
|
||||||
|
|
||||||
|
# FindNativeCompilers()
|
||||||
|
## options BUILD_COMPILER { GCC, Clang, Intel, RealView? }
|
||||||
|
|
||||||
|
|
||||||
|
#set(CMAKE_C_COMPILER clang)
|
||||||
|
#set(CMAKE_C_COMPILER_TARGET ${triple})
|
||||||
|
#set(CMAKE_CXX_COMPILER clang++)
|
||||||
|
#set(CMAKE_CXX_COMPILER_TARGET ${triple})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(${HOST_OS} EQUAL ${OS_LINUX})
|
||||||
|
# option SUPPORT_X11
|
||||||
|
# option FEAT_HAS_NIXPROF
|
||||||
|
# option EMSCripten
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
|
#
|
||||||
|
set(BUILD_COMPILER ${COMPILER_VC})
|
||||||
|
message("MSVC Platform: ${CMAKE_VS_PLATFORM_NAME}")
|
||||||
|
message("MSVC Toolset: ${CMAKE_VS_PLATFORM_TOOLSET}")
|
||||||
|
|
||||||
|
|
||||||
|
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
|
||||||
|
|
||||||
|
if("${HOST_OS}" STREQUAL "${OS_UWP}")
|
||||||
|
set(_CXX_FLAGS "/ZW ")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /AppContainer")
|
||||||
|
endif()
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
set(BUILD_COMPILER ${COMPILER_GCC})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # AppleClang ffs
|
||||||
|
set(BUILD_COMPILER ${COMPILER_CLANG})
|
||||||
|
#
|
||||||
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||||
|
set(BUILD_COMPILER ${COMPILER_INTEL})
|
||||||
|
#
|
||||||
|
else()
|
||||||
|
message("Unknown Compiler: ${CMAKE_CXX_COMPILER_ID}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Setup some common flags
|
||||||
|
#
|
||||||
|
if ((${BUILD_COMPILER} EQUAL ${COMPILER_VC}) OR
|
||||||
|
(${BUILD_COMPILER} EQUAL ${COMPILER_CLANG} AND ${HOST_OS} EQUAL ${OS_WINDOWS}))
|
||||||
|
|
||||||
|
if((${HOST_CPU} EQUAL ${CPU_X64}) AND (${FEAT_SHREC} EQUAL ${DYNAREC_JIT})) # AND NOT "${NINJA}" STREQUAL "")
|
||||||
|
set(FEAT_SHREC ${DYNAREC_CPP})
|
||||||
|
message("---x64 rec disabled for VC x64 via NINJA")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
|
||||||
|
|
||||||
|
if(${BUILD_COMPILER} EQUAL ${COMPILER_CLANG})
|
||||||
|
add_definitions(/DXBYAK_NO_OP_NAMES /DTARGET_NO_OPENMP) #*FIXME* check openmp on clang-cl
|
||||||
|
remove_definitions(/U_HAS_STD_BYTE)
|
||||||
|
set(_CXX_FLAGS "/std:c++14") # /U_HAS_STD_BYTE not working, have to use c++14 not 17 :|
|
||||||
|
set(_C_FLAGS "-Wno-unused-function -Wno-unused-variable")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
elseif ((${BUILD_COMPILER} EQUAL ${COMPILER_GCC}) OR
|
||||||
|
(${BUILD_COMPILER} EQUAL ${COMPILER_CLANG})) # AND NOT ${HOST_OS} EQUAL ${OS_WINDOWS}))
|
||||||
|
|
||||||
|
|
||||||
|
set(_C_FLAGS "-fno-operator-names") # or add_definitions(/DXBYAK_NO_OP_NAMES)
|
||||||
|
|
||||||
|
|
||||||
|
if(USE_32B OR TARGET_LINUX_X86)
|
||||||
|
set(_C_FLAGS "${_C_FLAGS} -m32")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if((${HOST_CPU} EQUAL ${CPU_X86}) OR (${HOST_CPU} EQUAL ${CPU_X64}))
|
||||||
|
set(_C_FLAGS "${_C_FLAGS} -msse4")
|
||||||
|
|
||||||
|
if(NOT CMAKE_HOST_APPLE)
|
||||||
|
set(_C_FLAGS "${_C_FLAGS} -fopenmp")
|
||||||
|
endif()
|
||||||
|
endif() # X86 family
|
||||||
|
|
||||||
|
|
||||||
|
set(_CXX_FLAGS "${_CXX_FLAGS} -std=c++17 -fcxx-exceptions") ## xbyak needs exceptions
|
||||||
|
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
set(_CXX_FLAGS "${_CXX_FLAGS} ${_C_FLAGS}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_C_FLAGS}")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_CXX_FLAGS}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(TARGET_NAOMI)
|
||||||
|
#define DC_PLATFORM DC_PLATFORM_NAOMI
|
||||||
|
#undef TARGET_NAOMI
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(TARGET_NO_NIXPROF)
|
||||||
|
#define FEAT_HAS_NIXPROF 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(TARGET_NO_COREIO_HTTP)
|
||||||
|
#define FEAT_HAS_COREIO_HTTP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(TARGET_SOFTREND) # need -fopenmp
|
||||||
|
#define FEAT_HAS_SOFTREND 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if (TARGET_NSW) # -DCMAKE_TOOLCHAIN_FILE=./cmake/devkitA64.cmake -DTARGET_NSW=ON
|
||||||
|
set(HOST_OS ${OS_NSW_HOS})
|
||||||
|
|
||||||
|
message(" DEVKITA64: ${DEVKITA64} ")
|
||||||
|
message("HOST_OS ${HOST_OS}")
|
||||||
|
|
||||||
|
add_definitions(-D__SWITCH__ -DGLES -DMESA_EGL_NO_X11_HEADERS)
|
||||||
|
add_definitions(-DTARGET_NO_THREADS -DTARGET_NO_EXCEPTIONS -DTARGET_NO_NIXPROF)
|
||||||
|
add_definitions(-DTARGET_NO_COREIO_HTTP -DTARGET_NO_WEBUI -UTARGET_SOFTREND)
|
||||||
|
add_definitions(-D_GLIBCXX_USE_C99_MATH_TR1 -D_LDBL_EQ_DBL)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (TARGET_PS4) # -DCMAKE_TOOLCHAIN_FILE=./cmake/{ps4sdk,clang_scei}.cmake -DTARGET_PS4=ON
|
||||||
|
set(HOST_OS ${OS_PS4_BSD})
|
||||||
|
message("HOST_OS ${HOST_OS}")
|
||||||
|
|
||||||
|
|
||||||
|
add_definitions(-DPS4 -DTARGET_PS4 -DTARGET_BSD -D__ORBIS__ -DGLES -DMESA_EGL_NO_X11_HEADERS) ## last needed for __unix__ on eglplatform.h
|
||||||
|
add_definitions(-DTARGET_NO_THREADS -DTARGET_NO_EXCEPTIONS -DTARGET_NO_NIXPROF)
|
||||||
|
add_definitions(-DTARGET_NO_COREIO_HTTP -DTARGET_NO_WEBUI -UTARGET_SOFTREND)
|
||||||
|
|
||||||
|
|
||||||
|
message("*******FIXME******** LARGE PAGES !!")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(ZBUILD)
|
||||||
|
set(DEBUG_CMAKE ON)
|
||||||
|
add_definitions(-D_Z_) # Get rid of some warnings and internal dev testing
|
||||||
|
|
||||||
|
if(NOT TARGET_PS4 AND NOT TARGET_NSW AND
|
||||||
|
NOT TARGET_OSX AND NOT TARGET_IOS )
|
||||||
|
set(USE_QT ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# configure options for osd/ui
|
||||||
|
# osd_default, osd_qt
|
||||||
|
# ui_default, ui_sdl, ui_qt
|
||||||
|
# USE_NATIVE , USE_SDL , USE_QT -- these (can) define multiple
|
||||||
|
|
||||||
|
option(USE_QT False "Use Qt5 for UI and support OS Deps.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#option TARGET_NO_WEBUI
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#option(BUILD_TESTS "Build tests" OFF) # todo: luserx0 this is your arena, you want tests add em
|
||||||
|
|
||||||
|
|
||||||
|
add_definitions(-DCMAKE_BUILD)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
add_definitions(-DHOST_OS=${HOST_OS})
|
||||||
|
add_definitions(-DHOST_CPU=${HOST_CPU})
|
||||||
|
|
||||||
|
add_definitions(-DFEAT_AREC=${FEAT_AREC})
|
||||||
|
add_definitions(-DFEAT_SHREC=${FEAT_SHREC})
|
||||||
|
add_definitions(-DFEAT_DSPREC=${FEAT_DSPREC})
|
||||||
|
|
||||||
|
add_definitions(-DBUILD_COMPILER=${BUILD_COMPILER})
|
||||||
|
|
||||||
|
add_definitions(-DTARGET_NO_WEBUI)
|
||||||
|
add_definitions(-DDEF_CONSOLE)
|
||||||
|
|
||||||
|
|
||||||
|
set(RE_CMAKE_CONFIGURED 1)
|
||||||
|
#add_definitions(-D=${})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### These were for internal testing, don't use ###
|
||||||
|
#
|
||||||
|
function(CpuIs CpuType Res)
|
||||||
|
set(${Res} OFF PARENT_SCOPE)
|
||||||
|
if (${HOST_CPU} EQUAL ${CpuType})
|
||||||
|
set(${Res} ON PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
macro(CpuIsX86 res)
|
||||||
|
CpuIs(CPU_X86 ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsX64 res)
|
||||||
|
CpuIs(CPU_X64 ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsARM res)
|
||||||
|
CpuIs(CPU_ARM ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsA64 res)
|
||||||
|
CpuIs(CPU_A64 ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsPPC res)
|
||||||
|
CpuIs(CPU_PPC ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsPPC64 res)
|
||||||
|
CpuIs(CPU_PPC64 ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsMIPS res)
|
||||||
|
CpuIs(CPU_MIPS ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(CpuIsMIPS64 res)
|
||||||
|
CpuIs(CPU_MIPS64 ${res})
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
## devkitA64.cmake - devkitpro A64 cross-compile
|
||||||
|
#
|
||||||
|
set(CMAKE_SYSTEM_NAME Linux) # this one is important // Add Platform/switch to use this name ...
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||||
|
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1) # this one not so much
|
||||||
|
|
||||||
|
|
||||||
|
set(DEVKITPRO $ENV{DEVKITPRO})
|
||||||
|
set(DEVKITA64 $ENV{DEVKITA64})
|
||||||
|
|
||||||
|
|
||||||
|
if ("" STREQUAL "${DEVKITPRO}")
|
||||||
|
set(DEVKITA64 "/opt/devkitpro")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if ("" STREQUAL "${DEVKITA64}")
|
||||||
|
set(DEVKITA64 ${DEVKITPRO}/devkitA64)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
## specify the cross compiler
|
||||||
|
#
|
||||||
|
set(CMAKE_C_COMPILER ${DEVKITA64}/bin/aarch64-none-elf-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER ${DEVKITA64}/bin/aarch64-none-elf-g++)
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${DEVKITA64}) # where is the target environment
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # search for programs in the build host directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # for libraries and headers in the target directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
include_directories(${DEVKITPRO}/libnx/include)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(TARGET_NSW ON)
|
|
@ -0,0 +1,130 @@
|
||||||
|
## ps4sdk.cmake - devkitpro A64 cross-compile
|
||||||
|
#
|
||||||
|
set(CMAKE_SYSTEM_NAME FreeBSD) # this one is important
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 9) # this one not so much
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(TARGET_PS4 ON)
|
||||||
|
set(TARGET_BSD ON)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### This shit is very WIP ###
|
||||||
|
#
|
||||||
|
## TODO: Check for
|
||||||
|
|
||||||
|
|
||||||
|
set(PS4SDK $ENV{PS4SDK})
|
||||||
|
set(SCESDK $ENV{SCESDK})
|
||||||
|
|
||||||
|
set(USE_SCE ON)
|
||||||
|
set(PS4_PKG ON)
|
||||||
|
|
||||||
|
if(PS4_PKG)
|
||||||
|
add_definitions(-DPS4_PKG)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ("" STREQUAL "${PS4SDK}")
|
||||||
|
if ("Windows" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}")
|
||||||
|
set(PS4SDK "C:/Dev/SDK/PS4")
|
||||||
|
else()
|
||||||
|
set(PS4SDK "/opt/ps4")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(TAUON_SDK ${PS4SDK}/tauon)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(USE_SCE)
|
||||||
|
#
|
||||||
|
set(PS4SDK ${PS4SDK}/SCE/PS4SDK)
|
||||||
|
|
||||||
|
set(PS4HOST ${PS4SDK}/host_tools)
|
||||||
|
set(PS4TARGET ${PS4SDK}/target)
|
||||||
|
|
||||||
|
set(toolPrefix "orbis-")
|
||||||
|
set(toolSuffix ".exe")
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER ${PS4HOST}/bin/${toolPrefix}clang${toolSuffix})
|
||||||
|
set(CMAKE_CXX_COMPILER ${PS4HOST}/bin/${toolPrefix}clang++${toolSuffix})
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH ${PS4TARGET}) # where is the target environment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set (PS4_inc_dirs
|
||||||
|
${TAUON_SDK}/include
|
||||||
|
${PS4TARGET}/include
|
||||||
|
${PS4TARGET}/include_common
|
||||||
|
)
|
||||||
|
|
||||||
|
# set (PS4_link_dirs
|
||||||
|
# "${PS4TARGET}/lib"
|
||||||
|
# "${PS4TARGET}/tauon/lib"
|
||||||
|
# )
|
||||||
|
|
||||||
|
|
||||||
|
#LDFLAGS += -L $(TAUON_SDK_DIR)/lib -L $(SCE_ORBIS_SDK_DIR)/target/lib
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s -Wl,--addressing=non-aslr,--strip-unused-data ")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L ${TAUON_SDK}/lib -L ${PS4TARGET}/lib")
|
||||||
|
|
||||||
|
message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
#
|
||||||
|
else()
|
||||||
|
#
|
||||||
|
set(triple "x86_64-scei-ps4")
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_TARGET ${triple})
|
||||||
|
set(CMAKE_CXX_COMPILER_TARGET ${triple})
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER clang)
|
||||||
|
set(CMAKE_CXX_COMPILER clang++)
|
||||||
|
|
||||||
|
|
||||||
|
set (PS4_inc_dirs
|
||||||
|
${TAUON_SDK}/include
|
||||||
|
|
||||||
|
${PS4SDK}/include
|
||||||
|
${PS4SDK}/tauon/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# set (PS4_link_dirs
|
||||||
|
# "${PS4SDK}/lib"
|
||||||
|
# "${PS4SDK}/tauon/lib"
|
||||||
|
# )
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s -Wl,--addressing=non-aslr,--strip-unused-data -L${TAUON_SDK}/lib")
|
||||||
|
#
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # search for programs in the build host directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) # for libraries and headers in the target directories
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
||||||
|
|
||||||
|
|
||||||
|
include_directories(${PS4_inc_dirs})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Add a helper to add libSce PREFIX and [_tau]*_stub[_weak]*.a SUFFIX
|
||||||
|
#
|
||||||
|
link_libraries(
|
||||||
|
kernel_tau_stub_weak SceSysmodule_tau_stub_weak SceSystemService_stub_weak SceSystemService_tau_stub_weak SceShellCoreUtil_tau_stub_weak ScePigletv2VSH_tau_stub_weak kernel_util
|
||||||
|
ScePad_stub_weak SceNet_stub_weak SceCommonDialog_stub_weak ScePosix_stub_weak
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -574,7 +574,7 @@
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<RootNamespace>reicast</RootNamespace>
|
<RootNamespace>reicast</RootNamespace>
|
||||||
<ProjectName>reicast</ProjectName>
|
<ProjectName>reicast</ProjectName>
|
||||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fast|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Fast|Win32'" Label="Configuration">
|
||||||
|
|
Loading…
Reference in New Issue