CMakeLists.txt 742 B

123456789101112131415161718192021
  1. cmake_minimum_required(VERSION 3.15)
  2. project(user_space_program C ASM)
  3. set(CMAKE_C_FLAGS "-nostdlib -nostdinc -m32 -static -W -Wall -mstack-protector-guard=global")
  4. set(CMAKE_ASM_FLAGS "-nostdlib -static -m32 -mstack-protector-guard=global")
  5. link_libraries(gblibc_32 crt0_32)
  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(priv-test.out priv-test.c)
  14. add_custom_target(user_space_programs
  15. DEPENDS hello-world.out interrupt-test.out stack-test.out init.out priv-test.out
  16. )