-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
29 lines (20 loc) · 748 Bytes
/
CMakeLists.txt
File metadata and controls
29 lines (20 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
cmake_minimum_required(VERSION 3.13)
project(c_buffer C ASM)
add_library(c_buffer INTERFACE)
target_sources(c_buffer INTERFACE
src/c_buffer.c
)
target_include_directories(c_buffer INTERFACE
src
)
# Option to build standalone executable for testing
option(C_BUFFER_TEST "Build standalone executable for c_buffer" OFF)
if(C_BUFFER_TEST)
set(CMAKE_C_COMPILER gcc)
# Add standalone executable for testing c_buffer
add_executable(test_c_buffer test/test_c_buffer.c)
# Link the c_buffer library to the standalone executable
target_link_libraries(test_c_buffer PRIVATE c_buffer)
# Optionally, add any specific compiler options for testing
target_compile_options(test_c_buffer PRIVATE -Wall -Wextra -pedantic)
endif()