Game Boy assembler.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

66 lines
1.3 KiB

  1. cmake_minimum_required(VERSION 3.13)
  2. project(gbas CXX)
  3. find_package(Boost COMPONENTS unit_test_framework)
  4. set(GBAS_SRCS
  5. src/tokenizer.cpp
  6. src/parser.cpp
  7. src/assembler.cpp
  8. src/elf.cpp
  9. src/elf_writer.cpp
  10. src/elf_reader.cpp
  11. )
  12. set(TEST_SRCS
  13. test/char_utils_test.cpp
  14. test/tokenizer_test.cpp
  15. test/parser_test.cpp
  16. test/assembler_test.cpp
  17. test/elf_test.cpp
  18. )
  19. add_executable(gbas
  20. ${GBAS_SRCS}
  21. src/main.cpp
  22. )
  23. add_executable(gbas_test
  24. ${GBAS_SRCS}
  25. ${TEST_SRCS}
  26. )
  27. set_target_properties(gbas
  28. PROPERTIES
  29. CXX_STANDARD 17
  30. )
  31. set_target_properties(gbas_test
  32. PROPERTIES
  33. CXX_STANDARD 17
  34. )
  35. target_include_directories(gbas PRIVATE include)
  36. target_include_directories(gbas_test PRIVATE include test)
  37. add_subdirectory(lib/expected)
  38. target_link_libraries(gbas expected)
  39. target_link_libraries(gbas_test expected)
  40. target_link_libraries(gbas_test Boost::unit_test_framework)
  41. if (UNIX)
  42. target_compile_options(gbas PRIVATE -ggdb -Wextra -Wall -O3)
  43. target_compile_options(gbas_test PRIVATE
  44. -ggdb -Wextra -Wall -Og
  45. -fsanitize=address -fsanitize=undefined
  46. )
  47. target_link_options(gbas_test PRIVATE
  48. -fsanitize=address -fsanitize=undefined
  49. )
  50. else (UNIX)
  51. message(FATAL_ERROR "Unsupported platform")
  52. endif (UNIX)