meson.build 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. include_dir = include_directories('include')
  2. str_include_dir = join_paths(meson.current_source_dir(), 'include')
  3. # Assemble the payloads
  4. launcher_payload_bin = asm_gen.process(
  5. 'src/launcher_p.asm',
  6. extra_args: [ '-i', str_include_dir ]
  7. )
  8. game_payload_bin = asm_gen.process(
  9. 'src/game_p.asm',
  10. extra_args: [ '-i', str_include_dir ]
  11. )
  12. # Embed them into .o files
  13. exe_res_files = custom_target(
  14. 'launcher_p.[oh]',
  15. output: [ 'launcher_p.o', 'launcher_p.h' ],
  16. input: [ launcher_payload_bin ],
  17. command: [ gen_res, '--header', '--object', './injector', '@OUTPUT0@', '@OUTPUT1@', '@INPUT@' ]
  18. )
  19. dll_res_files = custom_target(
  20. 'game_p.[oh]',
  21. output: [ 'game_p.o', 'game_p.h' ],
  22. input: [ game_payload_bin ],
  23. command: [ gen_res, '--header', '--object', './injector', '@OUTPUT0@', '@OUTPUT1@', '@INPUT@' ]
  24. )
  25. # Main injector exe
  26. executable(
  27. 'jadeite',
  28. 'src/exe.c',
  29. 'src/inject.c',
  30. exe_res_files,
  31. include_directories: include_dir,
  32. name_prefix: '',
  33. link_args: '-municode'
  34. )
  35. # Dll that will be injected into the launcher
  36. shared_library(
  37. 'launcher_payload',
  38. 'src/dll.c',
  39. 'src/inject.c',
  40. dll_res_files,
  41. include_directories: include_dir,
  42. name_prefix: '',
  43. link_args: '-municode'
  44. )