[sfsexp] Add new port (#9420)

* Add sfsexp, S-expressions library

* Use CMakeLists.txt directly instead of patching it

* Use sub-folder for sfsexp header files

* Manually set the header files and make sure the resulting include/ folder is the same as with the autotools installation

* Add runtime parameter for the DLL

* Export all symbols in the DLLAA

* Use PUBLIC_HEADER property install of install(FILES...)

* Remove boilerplate comments from portfile

* Only create static library on windows

* Throw error on UWP

* Disable some windows UWP warnings

* Use VCPKG_TARGET_IS_WINDOWS and put it on top of file

* Deleted extra blank lines

* Missed one blank line

* Use ${PORT} variable instead of the specific "sfsexp" string.

This should make it easier to change the name of the port later on.

* Use vcpkg_from_github to fetch the release.

* Remove extra empty lines
This commit is contained in:
Thomas Krause 2020-01-27 23:19:27 +01:00 committed by Victor Romero
parent 6ab471d09e
commit ebda0b9fc2
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.13)
project(sexp)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
endif()
file(GLOB sources src/*.c src/*.h)
include_directories(src/)
add_library(sexp ${sources})
set_target_properties(sexp PROPERTIES PUBLIC_HEADER "src/cstring.h;src/faststack.h;src/sexp.h;src/sexp_errors.h;src/sexp_memory.h;src/sexp_ops.h;src/sexp_vis.h")
install(TARGETS sexp
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
PUBLIC_HEADER DESTINATION include
)

4
ports/sfsexp/CONTROL Normal file
View File

@ -0,0 +1,4 @@
Source: sfsexp
Version: 1.3
Homepage: https://github.com/mjsottile/sfsexp
Description: Small Fast S-Expression Library

View File

@ -0,0 +1,23 @@
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mjsottile/sfsexp
REF ad589f9e6e0eca20345320e9c82a3aecc0a5c8aa #v1.3
SHA512 cdd469e23de48a5d6cd633b7b97b394cbfcba330ac2c3ae549811d856f2eec0c8558f99313e56a9f1cc9d72d4f17077584b6cf15c87814b91fe44ddd76895a8c
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)