mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
[cctz][abseil] Initial commit of cctz, improvement of abseil to build synch and time.
This commit is contained in:
parent
58fd38c820
commit
ab48a71c9a
@ -1,21 +1,29 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(abseil CXX)
|
||||
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN)
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
else()
|
||||
option(INSTALL_HEADERS "Install header files" OFF)
|
||||
endif()
|
||||
|
||||
function(add_sublibrary LIB)
|
||||
file(GLOB_RECURSE SOURCES "absl/${LIB}/*.cc")
|
||||
list(FILTER SOURCES EXCLUDE REGEX "_test")
|
||||
list(FILTER SOURCES EXCLUDE REGEX "_test(_.+)?.cc$|_nonprod.cc$")
|
||||
file(GLOB HEADERS "absl/${LIB}/*.h")
|
||||
file(GLOB INTERNAL_HEADERS "absl/${LIB}/internal/*.h")
|
||||
|
||||
if(SOURCES)
|
||||
add_library(${LIB} ${SOURCES})
|
||||
if("STATIC" IN_LIST ARGN)
|
||||
add_library(${LIB} STATIC ${SOURCES})
|
||||
else()
|
||||
add_library(${LIB} ${SOURCES})
|
||||
endif()
|
||||
set_target_properties(${LIB} PROPERTIES OUTPUT_NAME "absl_${LIB}")
|
||||
target_include_directories(${LIB} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<INSTALL_INTERFACE:include>)
|
||||
else()
|
||||
@ -49,14 +57,17 @@ function(target_link_public_libraries A)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_sublibrary(base)
|
||||
add_sublibrary(meta)
|
||||
add_sublibrary(algorithm)
|
||||
add_sublibrary(base)
|
||||
add_sublibrary(container)
|
||||
add_sublibrary(memory)
|
||||
add_sublibrary(strings)
|
||||
add_sublibrary(debugging)
|
||||
add_sublibrary(memory)
|
||||
add_sublibrary(meta)
|
||||
add_sublibrary(numeric)
|
||||
add_sublibrary(strings)
|
||||
add_sublibrary(synchronization STATIC)
|
||||
# Time must be static because there are global variables intended for export
|
||||
add_sublibrary(time STATIC)
|
||||
add_sublibrary(types)
|
||||
add_sublibrary(utility)
|
||||
|
||||
@ -68,6 +79,11 @@ target_link_public_libraries(numeric base)
|
||||
target_link_public_libraries(strings base memory meta numeric)
|
||||
target_link_public_libraries(types base utility meta algorithm strings)
|
||||
target_link_public_libraries(utility base meta)
|
||||
target_link_public_libraries(time base numeric)
|
||||
target_link_public_libraries(synchronization base time)
|
||||
|
||||
find_package(unofficial-cctz REQUIRED)
|
||||
targeT_link_libraries(time PUBLIC unofficial::cctz)
|
||||
|
||||
install(
|
||||
EXPORT unofficial-abseil-targets
|
||||
|
@ -1,6 +1,7 @@
|
||||
Source: abseil
|
||||
Version: 2017-09-28
|
||||
Version: 2017-10-14
|
||||
Description: an open-source collection designed to augment the C++ standard library.
|
||||
Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.
|
||||
In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.
|
||||
Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole.
|
||||
Build-Depends: cctz
|
||||
|
@ -10,8 +10,8 @@ message("To use from cmake:\n find_package(unofficial-abseil REQUIRED)\n link_
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO abseil/abseil-cpp
|
||||
REF cdf20caa491f59c0a35a8d8fbec0d948e4bc7e4c
|
||||
SHA512 04889e7804b644821d0bf5d1b13f15a072e748bf0465442c64528e014c71f415544e9146c9518f9fe7bb14a295b18f293c3f7b672f6a51dba9909f3b74667fae
|
||||
REF 1a9ba5e2e5a14413704f0c913fac53359576d3b6
|
||||
SHA512 756e494c30324c937ca655d91afdee9acb923c7ee837a7c685441305bea2d54a75b3b21be7355abe416660984ba51ace9d234d70168fb029c601b7442397e8ff
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
@ -25,7 +25,6 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
36
ports/cctz/CMakeLists.txt
Normal file
36
ports/cctz/CMakeLists.txt
Normal file
@ -0,0 +1,36 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(cctz CXX)
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
else()
|
||||
option(INSTALL_HEADERS "Install header files" OFF)
|
||||
endif()
|
||||
|
||||
file(GLOB SOURCES src/*.cc)
|
||||
list(FILTER SOURCES EXCLUDE REGEX "_test.cc$|benchmarks|_tool.cc$")
|
||||
|
||||
file(GLOB HEADERS include/cctz/*.h)
|
||||
|
||||
add_library(cctz ${SOURCES})
|
||||
target_include_directories(cctz PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
if(INSTALL_HEADERS)
|
||||
install(FILES ${HEADERS} DESTINATION "include/cctz")
|
||||
endif()
|
||||
|
||||
install(TARGETS cctz EXPORT unofficial-cctz-targets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT unofficial-cctz-targets
|
||||
FILE unofficial-cctz-config.cmake
|
||||
NAMESPACE unofficial::
|
||||
DESTINATION share/unofficial-cctz
|
||||
)
|
3
ports/cctz/CONTROL
Normal file
3
ports/cctz/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: cctz
|
||||
Version: v2.1
|
||||
Description: two libraries that cooperate with <chrono> to give C++ programmers all the necessary tools for computing with dates, times, and time zones in a simple and correct manner.
|
24
ports/cctz/portfile.cmake
Normal file
24
ports/cctz/portfile.cmake
Normal file
@ -0,0 +1,24 @@
|
||||
include(vcpkg_common_functions)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/cctz
|
||||
REF v2.1
|
||||
SHA512 b6531ce64fdd8581944457cdeff7f9ff9c00958af51ddb262c74e08fcc076466c59c7bef1ce7edccc9512a7f4cb204e04581d287c4a9a684057fe39421c3fbc6
|
||||
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()
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-cctz)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cctz ${CURRENT_PACKAGES_DIR}/share/unofficial-cctz)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cctz RENAME copyright)
|
Loading…
x
Reference in New Issue
Block a user