2020-08-22 22:30:12 -04:00
|
|
|
# We define our own compilation flags here.
|
2020-10-03 18:36:02 -04:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2020-08-26 20:02:44 -04:00
|
|
|
|
2020-08-22 22:30:12 -04:00
|
|
|
enable_language(ASM_NASM)
|
2020-08-28 20:26:27 -04:00
|
|
|
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} asm)
|
2020-10-09 00:39:12 -04:00
|
|
|
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <INCLUDES> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
|
2020-08-28 20:26:27 -04:00
|
|
|
set_source_files_properties(kernel/asm_funcs.asm PROPERTIES COMPILE_FLAGS "-g")
|
2020-08-22 22:30:12 -04:00
|
|
|
set(RUNTIME_SOURCE
|
|
|
|
runtime.cpp
|
2022-02-07 23:53:36 -05:00
|
|
|
discord.cpp
|
2020-08-22 22:30:12 -04:00
|
|
|
system/SystemThread.cpp
|
|
|
|
system/IOP_Kernel.cpp
|
|
|
|
system/iop_thread.cpp
|
|
|
|
system/Deci2Server.cpp
|
2021-08-14 16:00:50 -04:00
|
|
|
system/newpad.cpp
|
2020-08-22 22:30:12 -04:00
|
|
|
sce/libcdvd_ee.cpp
|
|
|
|
sce/libscf.cpp
|
2021-02-21 11:02:28 -05:00
|
|
|
sce/libdma.cpp
|
2021-02-22 09:36:30 -05:00
|
|
|
sce/libpad.cpp
|
2021-02-21 11:02:28 -05:00
|
|
|
sce/libgraph.cpp
|
2020-08-22 22:30:12 -04:00
|
|
|
sce/deci2.cpp
|
|
|
|
sce/sif_ee.cpp
|
2021-10-01 23:12:34 -04:00
|
|
|
sce/sif_ee_memcard.cpp
|
2020-08-22 22:30:12 -04:00
|
|
|
sce/iop.cpp
|
|
|
|
sce/stubs.cpp
|
2020-08-28 20:26:27 -04:00
|
|
|
kernel/asm_funcs.asm
|
2020-08-22 22:30:12 -04:00
|
|
|
kernel/fileio.cpp
|
|
|
|
kernel/kboot.cpp
|
|
|
|
kernel/kdgo.cpp
|
|
|
|
kernel/kdsnetm.cpp
|
|
|
|
kernel/klink.cpp
|
|
|
|
kernel/klisten.cpp
|
|
|
|
kernel/kmachine.cpp
|
|
|
|
kernel/kmalloc.cpp
|
|
|
|
kernel/kmemcard.cpp
|
|
|
|
kernel/kprint.cpp
|
|
|
|
kernel/kscheme.cpp
|
|
|
|
kernel/ksocket.cpp
|
|
|
|
kernel/ksound.cpp
|
2021-09-11 20:52:35 -04:00
|
|
|
mips2c/mips2c_table.cpp
|
2022-01-28 21:32:03 -05:00
|
|
|
mips2c/functions/bones.cpp
|
2022-01-15 16:52:47 -05:00
|
|
|
mips2c/functions/collide_cache.cpp
|
|
|
|
mips2c/functions/collide_edge_grab.cpp
|
2021-12-28 16:43:13 -05:00
|
|
|
mips2c/functions/collide_func.cpp
|
2022-01-09 17:45:19 -05:00
|
|
|
mips2c/functions/collide_mesh.cpp
|
2022-01-10 19:28:17 -05:00
|
|
|
mips2c/functions/collide_probe.cpp
|
2021-09-11 20:52:35 -04:00
|
|
|
mips2c/functions/draw_string.cpp
|
2022-02-24 22:33:10 -05:00
|
|
|
mips2c/functions/generic_effect.cpp
|
2022-04-29 23:44:53 -04:00
|
|
|
mips2c/functions/generic_effect2.cpp
|
2022-02-24 22:33:10 -05:00
|
|
|
mips2c/functions/generic_merc.cpp
|
2022-04-29 23:44:53 -04:00
|
|
|
mips2c/functions/generic_tie.cpp
|
2022-01-28 21:32:03 -05:00
|
|
|
mips2c/functions/joint.cpp
|
2022-02-03 22:45:41 -05:00
|
|
|
mips2c/functions/merc_blend_shape.cpp
|
2022-03-07 20:28:53 -05:00
|
|
|
mips2c/functions/ocean.cpp
|
2022-03-11 22:27:11 -05:00
|
|
|
mips2c/functions/ocean_vu0.cpp
|
2022-02-24 22:33:10 -05:00
|
|
|
mips2c/functions/ripple.cpp
|
2022-03-22 21:42:37 -04:00
|
|
|
mips2c/functions/shadow.cpp
|
2021-10-10 20:07:03 -04:00
|
|
|
mips2c/functions/sky_tng.cpp
|
2021-09-26 11:41:58 -04:00
|
|
|
mips2c/functions/sparticle.cpp
|
|
|
|
mips2c/functions/sparticle_launcher.cpp
|
2021-09-11 20:52:35 -04:00
|
|
|
mips2c/functions/test_func.cpp
|
2021-10-10 20:07:03 -04:00
|
|
|
mips2c/functions/texture.cpp
|
2021-11-13 20:44:17 -05:00
|
|
|
mips2c/functions/tfrag.cpp
|
2022-04-29 23:44:53 -04:00
|
|
|
mips2c/functions/tie_methods.cpp
|
2021-11-13 20:44:17 -05:00
|
|
|
mips2c/functions/time_of_day.cpp
|
2020-08-22 22:30:12 -04:00
|
|
|
overlord/dma.cpp
|
|
|
|
overlord/fake_iso.cpp
|
|
|
|
overlord/iso.cpp
|
|
|
|
overlord/iso_api.cpp
|
|
|
|
overlord/iso_cd.cpp
|
|
|
|
overlord/iso_queue.cpp
|
|
|
|
overlord/isocommon.cpp
|
|
|
|
overlord/overlord.cpp
|
|
|
|
overlord/ramdisk.cpp
|
|
|
|
overlord/sbank.cpp
|
|
|
|
overlord/soundcommon.cpp
|
|
|
|
overlord/srpc.cpp
|
|
|
|
overlord/ssound.cpp
|
2021-03-09 23:51:28 -05:00
|
|
|
overlord/stream.cpp
|
|
|
|
graphics/gfx.cpp
|
2021-05-01 00:32:19 -04:00
|
|
|
graphics/display.cpp
|
2021-08-04 21:30:08 -04:00
|
|
|
graphics/sceGraphicsInterface.cpp
|
2022-03-06 19:56:43 -05:00
|
|
|
graphics/opengl_renderer/background/background_common.cpp
|
2022-03-29 21:38:48 -04:00
|
|
|
graphics/opengl_renderer/background/Shrub.cpp
|
2022-03-06 19:56:43 -05:00
|
|
|
graphics/opengl_renderer/background/Tfrag3.cpp
|
|
|
|
graphics/opengl_renderer/background/TFragment.cpp
|
|
|
|
graphics/opengl_renderer/background/Tie3.cpp
|
|
|
|
graphics/opengl_renderer/foreground/Generic2.cpp
|
|
|
|
graphics/opengl_renderer/foreground/Generic2_DMA.cpp
|
|
|
|
graphics/opengl_renderer/foreground/Generic2_Build.cpp
|
|
|
|
graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp
|
2022-03-17 21:59:10 -04:00
|
|
|
graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp
|
2022-03-14 19:47:29 -04:00
|
|
|
graphics/opengl_renderer/ocean/OceanMid.cpp
|
|
|
|
graphics/opengl_renderer/ocean/OceanMid_PS2.cpp
|
2022-03-11 22:27:11 -05:00
|
|
|
graphics/opengl_renderer/ocean/OceanMidAndFar.cpp
|
2022-03-15 23:12:40 -04:00
|
|
|
graphics/opengl_renderer/ocean/OceanNear.cpp
|
|
|
|
graphics/opengl_renderer/ocean/OceanNear_PS2.cpp
|
2022-03-11 22:27:11 -05:00
|
|
|
graphics/opengl_renderer/ocean/OceanTexture.cpp
|
|
|
|
graphics/opengl_renderer/ocean/OceanTexture_PC.cpp
|
2021-08-07 18:57:13 -04:00
|
|
|
graphics/opengl_renderer/BucketRenderer.cpp
|
2022-04-25 21:53:23 -04:00
|
|
|
graphics/opengl_renderer/CollideMeshRenderer.cpp
|
2021-09-26 11:41:58 -04:00
|
|
|
graphics/opengl_renderer/debug_gui.cpp
|
2021-08-07 18:57:13 -04:00
|
|
|
graphics/opengl_renderer/DirectRenderer.cpp
|
2022-02-27 17:23:12 -05:00
|
|
|
graphics/opengl_renderer/DirectRenderer2.cpp
|
2022-02-15 19:37:51 -05:00
|
|
|
graphics/opengl_renderer/EyeRenderer.cpp
|
2021-11-13 20:44:17 -05:00
|
|
|
graphics/opengl_renderer/dma_helpers.cpp
|
2021-12-04 12:33:18 -05:00
|
|
|
graphics/opengl_renderer/Loader.cpp
|
2022-02-03 22:45:41 -05:00
|
|
|
graphics/opengl_renderer/MercProgram.cpp
|
|
|
|
graphics/opengl_renderer/MercRenderer.cpp
|
2022-03-04 18:22:01 -05:00
|
|
|
graphics/opengl_renderer/opengl_utils.cpp
|
2021-08-06 22:30:02 -04:00
|
|
|
graphics/opengl_renderer/OpenGLRenderer.cpp
|
2021-10-10 20:07:03 -04:00
|
|
|
graphics/opengl_renderer/Profiler.cpp
|
2021-08-06 22:30:02 -04:00
|
|
|
graphics/opengl_renderer/Shader.cpp
|
2022-03-26 19:56:54 -04:00
|
|
|
graphics/opengl_renderer/Shadow_PS2.cpp
|
2022-03-22 21:42:37 -04:00
|
|
|
graphics/opengl_renderer/ShadowRenderer.cpp
|
2021-12-30 19:38:18 -05:00
|
|
|
graphics/opengl_renderer/SkyBlendCPU.cpp
|
|
|
|
graphics/opengl_renderer/SkyBlendGPU.cpp
|
2021-10-10 20:07:03 -04:00
|
|
|
graphics/opengl_renderer/SkyRenderer.cpp
|
2022-01-21 21:11:57 -05:00
|
|
|
graphics/opengl_renderer/Sprite3.cpp
|
2021-09-26 11:41:58 -04:00
|
|
|
graphics/opengl_renderer/SpriteRenderer.cpp
|
|
|
|
graphics/opengl_renderer/TextureUploadHandler.cpp
|
2022-05-02 21:26:17 -04:00
|
|
|
graphics/texture/jak1_tpage_dir.cpp
|
2021-08-08 13:12:44 -04:00
|
|
|
graphics/texture/TextureConverter.cpp
|
|
|
|
graphics/texture/TexturePool.cpp
|
2021-08-09 19:16:39 -04:00
|
|
|
graphics/pipelines/opengl.cpp
|
2021-05-01 00:32:19 -04:00
|
|
|
system/vm/dmac.cpp
|
|
|
|
system/vm/vm.cpp)
|
2020-08-22 22:30:12 -04:00
|
|
|
|
2022-03-31 19:29:48 -04:00
|
|
|
find_package(Git)
|
|
|
|
|
|
|
|
function(write_svnrev_h)
|
2022-04-29 23:44:53 -04:00
|
|
|
set(GIT_SHORT_SHA "")
|
|
|
|
if (GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
|
|
|
EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
|
|
|
OUTPUT_VARIABLE GIT_SHORT_SHA
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
2022-03-31 19:29:48 -04:00
|
|
|
else()
|
2022-04-29 23:44:53 -04:00
|
|
|
set(GIT_SHORT_SHA "unk. rev.")
|
|
|
|
endif()
|
|
|
|
if(NOT GIT_SHORT_SHA)
|
|
|
|
set(GIT_SHORT_SHA "unk. rev.")
|
2022-03-31 19:29:48 -04:00
|
|
|
else()
|
|
|
|
string(SUBSTRING ${GIT_SHORT_SHA} 0 6 GIT_SHORT_SHA)
|
2022-04-29 23:44:53 -04:00
|
|
|
endif()
|
2022-03-31 19:29:48 -04:00
|
|
|
|
|
|
|
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/kernel/svnrev.h "#define GIT_SHORT_SHA \"rev. ${GIT_SHORT_SHA}\"\n")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
write_svnrev_h()
|
2020-09-24 17:19:23 -04:00
|
|
|
|
2022-05-19 16:54:36 -04:00
|
|
|
add_subdirectory(sound)
|
|
|
|
|
2021-01-06 12:16:39 -05:00
|
|
|
# we build the runtime as a static library.
|
2021-03-11 12:54:16 -05:00
|
|
|
add_library(runtime STATIC ${RUNTIME_SOURCE} "../third-party/glad/src/glad.c")
|
2020-08-22 22:30:12 -04:00
|
|
|
|
2022-05-19 16:54:36 -04:00
|
|
|
target_link_libraries(runtime common fmt glfw imgui discord-rpc sound)
|
2021-02-03 21:29:46 -05:00
|
|
|
if(WIN32)
|
2021-01-06 12:16:39 -05:00
|
|
|
target_link_libraries(runtime mman)
|
2021-02-03 21:29:46 -05:00
|
|
|
else()
|
2021-03-11 12:54:16 -05:00
|
|
|
target_link_libraries(runtime pthread dl)
|
2021-02-03 21:29:46 -05:00
|
|
|
endif()
|
2020-09-24 17:19:23 -04:00
|
|
|
|
2021-01-06 12:16:39 -05:00
|
|
|
add_executable(gk main.cpp)
|
|
|
|
target_link_libraries(gk runtime)
|