1 # Build for the runtime interception helper library.
3 set(INTERCEPTION_SOURCES
9 # Only add this C file if we're building on a Mac. Other source files can be
10 # harmlessly compiled on any platform, but the C file is complained about due
11 # to pedantic rules about empty translation units.
13 list(APPEND INTERCEPTION_SOURCES mach_override/mach_override.c)
16 set(INTERCEPTION_CFLAGS "-fPIC -fno-exceptions -funwind-tables -fvisibility=hidden")
17 if (SUPPORTS_NO_VARIADIC_MACROS_FLAG)
18 set(INTERCEPTION_CFLAGS "${INTERCEPTION_CFLAGS} -Wno-variadic-macros")
21 set(INTERCEPTION_COMMON_DEFINITIONS
22 INTERCEPTION_HAS_EXCEPTIONS=1)
25 add_library(RTInterception.x86_64 OBJECT ${INTERCEPTION_SOURCES})
26 set_property(TARGET RTInterception.x86_64 PROPERTY COMPILE_FLAGS
27 "${INTERCEPTION_CFLAGS} ${TARGET_X86_64_CFLAGS}")
28 set_property(TARGET RTInterception.x86_64 APPEND PROPERTY COMPILE_DEFINITIONS
29 ${INTERCEPTION_COMMON_DEFINITIONS})
32 add_library(RTInterception.i386 OBJECT ${INTERCEPTION_SOURCES})
33 set_property(TARGET RTInterception.i386 PROPERTY COMPILE_FLAGS
34 "${INTERCEPTION_CFLAGS} ${TARGET_I386_CFLAGS}")
35 set_property(TARGET RTInterception.i386 APPEND PROPERTY COMPILE_DEFINITIONS
36 ${INTERCEPTION_COMMON_DEFINITIONS})