This repository has been archived on 2026-04-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bhlib/unit/CMakeLists.txt
Mikhail Romanko 6ede63e18f Add Asan profile, fix multiple bugs.
Added Asan profile to help catch and fix various bugs (and indeed, there
were few of them).

Additionally, fixed bhunit macro to process arguments only once.
2025-01-29 09:19:34 +03:00

29 lines
626 B
CMake
Executable File

cmake_minimum_required(VERSION 3.10)
# Project and C standard configuration
project(bhunit LANGUAGES C)
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_STANDARD_REQUIRED ON)
# Disable extensions
set(CMAKE_C_EXTENSIONS OFF)
# Library code
set(BHUNIT_SOURCE
src/unit.c
)
set(BHUNIT_HEADER
include/bh/unit.h
)
# Library
add_library(bhunit STATIC ${BHUNIT_SOURCE} ${BHUNIT_HEADER})
target_include_directories(bhunit PUBLIC include)
# Enable all compiler warnings
if(MSVC)
target_compile_options(bhunit PRIVATE /W4 /WX)
else()
target_compile_options(bhunit PRIVATE -Wall -Wextra -Wpedantic -Werror -fstrict-aliasing)
endif()