types { char, int, float, string } and can come back later to make it
one type to call.
GITIGNORE: Added tests and Makefile to cleanup fuzzyfinder but dont need
them pushed either as I have enough testing done.
33 lines
1021 B
CMake
33 lines
1021 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(libvec LANGUAGES C)
|
|
set(CMAKE_C_STANDARD 23)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
add_library(libvec STATIC
|
|
src/char.c
|
|
src/int.c
|
|
src/utils.c
|
|
src/float.c
|
|
# src/string.c
|
|
# Add your other types here as you implement them:
|
|
)
|
|
|
|
target_include_directories(libvec
|
|
# PRIVATE: Internal headers under src/lib are only visible
|
|
# to files being compiled into libvec (char.c, utils.c, libvec.c).
|
|
# PRIVATE
|
|
|
|
# PUBLIC: Consumers (and test_runner) are granted access ONLY to include/
|
|
PUBLIC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
# ${CMAKE_CURRENT_SOURCE_DIR}/src/lib # Turn back to private when ready
|
|
)
|
|
|
|
add_executable(libvec_bin src/main.c)
|
|
set_target_properties(libvec_bin PROPERTIES OUTPUT_NAME "libvec")
|
|
|
|
# Linking libvec privately gives test_runner access to include/libvec.h,
|
|
# but strictly hides src/lib/char/char.h and src/lib/utils/utils.h.
|
|
target_link_libraries(libvec_bin PRIVATE libvec)
|