diff options
| author | Mikhail Romanko <me@blankhex.com> | 2024-04-13 14:52:29 +0300 |
|---|---|---|
| committer | Mikhail Romanko <me@blankhex.com> | 2024-04-13 14:52:29 +0300 |
| commit | ac5df0ebe9a6ac67b9be4cc319f5cd0625b50178 (patch) | |
| tree | 5532f9fd219691476fb3be127f228f3a07325e4b /CMakeLists.txt | |
| download | bhlib-old-ac5df0ebe9a6ac67b9be4cc319f5cd0625b50178.tar.gz | |
Initial commit
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..51d4cd1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.10) + +# Project and C standard configuration +project(bhlib LANGUAGES C) +set(CMAKE_C_STANDARD 90) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# Check for IPO/LTO +include(CheckIPOSupported) +check_ipo_supported(RESULT supported) + +if(supported) + message(STATUS "IPO/LTO enabled") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +endif() + +# Enable testing +include(CTest) +enable_testing() + +# Set library code +set(BHLIB_SOURCE + src/hashmap.c + src/queue.c +) + +set(BHLIB_HEADER + include/bh/hashmap.h + include/bh/queue.h +) + +# Library +add_library(bhlib STATIC ${BHLIB_SOURCE} ${BHLIB_HEADER}) +target_include_directories(bhlib PUBLIC include) + +# Runtime definition +add_executable(main + main.c +) + +target_link_libraries(main bhlib) + +# Tests +add_subdirectory(unit) +add_subdirectory(tests) |
