CMakeLists.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #
  2. # TI-NES CMake
  3. #
  4. # Created by Manoel TRAPIER.
  5. # Copyright (c) 2003-2016 986-Studio. All rights reserved.
  6. #
  7. # $LastChangedDate$
  8. # $Author$
  9. # $HeadURL$
  10. # $Revision$
  11. ##########################
  12. # Configurations variables
  13. ##########################
  14. set(PPU_ISPAL OFF CACHE BOOL "When switch to ON the PPU is in PAL mode, else it will act as a NTSC one.")
  15. set(Q6502_DEBUGGER OFF CACHE BOOL "Activate the Quick6502 debugger?")
  16. set(USE_SOUND OFF CACHE BOOL "Activate the sound?")
  17. set(DETECT_BUS_CONFLICT OFF CACHE BOOL "Activate the bus conflit detector? (Could slow down the emulator a lot.)")
  18. set(USE_EFENCE OFF CACHE BOOL "Use electricfence memory debugger?")
  19. set(USE_PROFILING OFF CACHE BOOL "Use profiling tools? (Will slow down a lot.)")
  20. set(USE_ALLEGRO ON CACHE BOOL "Use Allegro backend")
  21. ##########################
  22. # Link & Compile flags
  23. ##########################
  24. set (CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Werror ${PLATFORM_FLAGS}")
  25. set (CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Werror ${PLATFORM_FLAGS}")
  26. add_definitions (-DNO_DECIMAL)
  27. if (PPU_ISPAL)
  28. add_definitions (-DISPAL)
  29. else (PPU_ISPAL)
  30. add_definitions (-DISNTSC)
  31. endif (PPU_ISPAL)
  32. if (Q6502_DEBUGGER)
  33. add_definitions (-DDEBUG)
  34. endif (Q6502_DEBUGGER)
  35. if (USE_SOUND)
  36. add_definitions (-DUSE_SOUND)
  37. endif (USE_SOUND)
  38. if (DETECT_BUS_CONFLICT)
  39. add_definitions (-DDETECT_BUS_CONFLICT)
  40. endif (DETECT_BUS_CONFLICT)
  41. if (USE_PROFILING)
  42. if (CMAKE_BUILD_TYPE MATCHES Rel)
  43. SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Debug info is forced" FORCE)
  44. else(CMAKE_BUILD_TYPE MATCHES Rel)
  45. SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Debug info is forced" FORCE)
  46. endif(CMAKE_BUILD_TYPE MATCHES Rel)
  47. set(CMAKE_C_FLAGS -pg)
  48. endif (USE_PROFILING)
  49. include_directories(include)
  50. add_subdirectory(apu)
  51. add_subdirectory(corecpu)
  52. add_subdirectory(mappersmanager)
  53. add_subdirectory(memorymanager)
  54. add_subdirectory(pluginsmanager)
  55. add_subdirectory(ppu)
  56. if (TARGET_TI68k)
  57. add_subdirectory(os/ti68k)
  58. elseif (WIN32)
  59. add_subdirectory(os/win32)
  60. else (TARGET_TI68k)
  61. add_subdirectory(os/unix)
  62. endif (TARGET_TI68k)
  63. find_library(PTHREADLIB pthread)
  64. add_executable(tines main.c paddle.c NESCarts.c)
  65. target_compile_options(tines PRIVATE -pthread)
  66. target_link_libraries(tines apu corecpu mappermanager memorymanager pluginsmanager ppu oslib) #${PTHREADLIB}