[CMAKE]: Make simple rule for building ASM files.
[reactos.git] / lib / rtl / CMakeLists.txt
1
2 include_directories(.)
3
4 add_definitions(-D_NTOSKRNL_)
5 add_definitions(-DNO_RTL_INLINES)
6 add_definitions(-D_NTSYSTEM_)
7 add_definitions(-D_NTDLLBUILD_)
8
9 file(GLOB_RECURSE ARCH_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/${ARCH}/*.S)
10
11 get_directory_property(defines COMPILE_DEFINITIONS)
12
13 foreach(arg ${defines})
14 set(result_defs "${result_defs} -D${arg}")
15 endforeach(arg ${defines})
16
17 set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> ${result_defs} -D__ASM__ <FLAGS> -c <SOURCE>")
18
19 file(GLOB SOURCE "*.c")
20
21 list(REMOVE_ITEM SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/avlsupp.c
22 ${CMAKE_CURRENT_SOURCE_DIR}/mem.c
23 ${CMAKE_CURRENT_SOURCE_DIR}/memgen.c
24 )
25
26 add_library(rtl ${ARCH_SOURCE} ${SOURCE})
27 add_dependencies(rtl psdk)
28