neovim/cmake.deps/cmake/LibvtermCMakeLists.txt
dundargoc b155608bff
build: set CMAKE_C_STANDARD to 99 for all dependencies
Older gcc versions (4.x) require passing --std=c99 compiler flag to
prevent warnings from being emitted. Instead of setting it for each
dependency, it's easier to just pass the CMAKE_C_STANDARD flag to all
dependencies. This also prevents the scenario of us forgetting to set it
if we add new dependencies.
2023-03-24 10:22:15 +01:00

31 lines
874 B
CMake

cmake_minimum_required(VERSION 3.10)
project(libvterm C)
include(GNUInstallDirs)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR})
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
add_library(vterm ${VTERM_SOURCES})
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES include/vterm.h include/vterm_keycodes.h
DESTINATION include)
if(NOT WIN32)
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
foreach(EXE_C ${BIN_SOURCES})
get_filename_component(target_name ${EXE_C} NAME_WE)
add_executable(${target_name} ${EXE_C})
target_link_libraries(${target_name} vterm)
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
endif()
# vim: set ft=cmake: