cmake_minimum_required(VERSION 3.10)

project(cache_attacks C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "-O0" CACHE STRING "C Compiler flags" FORCE)
set(CMAKE_CXX_FLAGS "-O0" CACHE STRING "C++ Compiler flags" FORCE)

# Add shared library
add_library(sharedlib SHARED sharedlib.c sharedlib.h)

# Add the sender executable
add_executable(send send.c lib.c lib.h)
target_link_libraries(send sharedlib)

# Add the receiver executable
add_executable(recv recv.c lib.c lib.h)
target_link_libraries(recv sharedlib)

# add the cache-test executable
add_executable(cache_test cache_test.c lib.c lib.h)
# link sharedlib if you want to test on the padded addr (less chance for noise)
# target_link_libraries(cache_test sharedlib)
