CMakeLists.txt 815 B

1234567891011121314151617181920212223
  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. set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "")
  7. set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
  8. add_executable(hello-world.out hello-world.s)
  9. add_executable(interrupt-test.out interrupt-test.s)
  10. add_executable(stack-test.out stack-test.s)
  11. add_executable(init.out init.c)
  12. add_executable(sh.out sh.c)
  13. add_executable(priv-test.out priv-test.c)
  14. add_executable(lazybox.out lazybox.c)
  15. add_custom_target(user_space_programs
  16. DEPENDS hello-world.out interrupt-test.out stack-test.out init.out sh.out priv-test.out
  17. DEPENDS lazybox.out
  18. )