mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 19:40:18 +08:00
25 lines
703 B
CMake
25 lines
703 B
CMake
cmake_minimum_required(VERSION 3.3)
|
|
project(vcpkg CXX)
|
|
|
|
add_compile_options(-std=c++1z)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUXX OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
set(GCC 1)
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang")
|
|
set(CLANG 1)
|
|
else()
|
|
message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
|
|
endif()
|
|
|
|
file(GLOB_RECURSE VCPKGLIB_SOURCES src/vcpkg/*.cpp)
|
|
|
|
add_executable(vcpkg src/vcpkg.cpp ${VCPKGLIB_SOURCES})
|
|
target_compile_definitions(vcpkg PRIVATE -DDISABLE_METRICS=0)
|
|
target_include_directories(vcpkg PUBLIC include)
|
|
|
|
if(GCC)
|
|
target_link_libraries(vcpkg PUBLIC stdc++fs)
|
|
elseif(CLANG)
|
|
target_link_libraries(vcpkg PUBLIC c++experimental)
|
|
endif()
|