CMakeLists.txt 853 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 3.15)
  2. project(user_space_program C ASM)
  3. set(CMAKE_C_FLAGS "-nostdlib -nostdinc -static -m32 -W -Wall -Wextra -Werror -mstack-protector-guard=global")
  4. set(CMAKE_ASM_FLAGS "-nostdlib -m32 -static -mstack-protector-guard=global -g0")
  5. link_libraries(gblibc crt0)
  6. add_link_options("LINKER:-melf_i386")
  7. set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
  8. set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
  9. add_executable(hello-world.out hello-world.s)
  10. add_executable(interrupt-test.out interrupt-test.s)
  11. add_executable(stack-test.out stack-test.s)
  12. add_executable(init.out init.c)
  13. add_executable(sh.out sh.c)
  14. add_executable(priv-test.out priv-test.c)
  15. add_executable(lazybox.out lazybox.c)
  16. add_custom_target(user_space_programs
  17. DEPENDS hello-world.out interrupt-test.out stack-test.out init.out sh.out priv-test.out
  18. DEPENDS lazybox.out
  19. )