moving files and updating cmake to make it compilable (#35)
* moving files and updating cmake to make it compilable * Adding http namespace
This commit is contained in:
Родитель
5ee2b47171
Коммит
010038a342
|
@ -2,10 +2,13 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
cmake_minimum_required (VERSION 3.12)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")
|
||||
|
||||
# Compile Options
|
||||
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
|
||||
option(BUILD_CURL_TRANSPORT "Build internal http transport implementation with CURL for HTTP Pipeline" OFF)
|
||||
|
||||
# VCPKG Integration
|
||||
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
CACHE STRING "")
|
||||
|
@ -13,14 +16,17 @@ elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE
|
|||
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
CACHE STRING "")
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
|
||||
set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
# Project definition
|
||||
project(az LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
#enable_testing ()
|
||||
|
||||
include(eng/cmake/global_compile_options.txt)
|
||||
# compiler warning flags
|
||||
include(global_compile_options)
|
||||
|
||||
# sub-projects
|
||||
add_subdirectory(sdk/core/azure-core)
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
cmake_minimum_required (VERSION 3.12)
|
||||
|
||||
project (azure-core LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
add_library (
|
||||
azure-core
|
||||
src/az_span.c
|
||||
src/http/az_http_request
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
|
@ -32,35 +32,8 @@ else()
|
|||
target_compile_options(azure-core PRIVATE -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG})
|
||||
endif()
|
||||
|
||||
target_include_directories (azure-core PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:include/az>)
|
||||
|
||||
# create interface for internal headers
|
||||
#add_library(az_core_internal INTERFACE)
|
||||
#target_include_directories(az_core_internal INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal> $<INSTALL_INTERFACE:include/az_internal>)
|
||||
|
||||
#target_link_libraries(az_core PRIVATE az_core_internal)
|
||||
target_include_directories (azure-core PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc> $<INSTALL_INTERFACE:include/az_core>)
|
||||
target_include_directories (azure-core PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/internal> $<INSTALL_INTERFACE:include/az_core_internal>)
|
||||
|
||||
# make sure that users can consume the project as a library.
|
||||
add_library (azure::core ALIAS azure-core)
|
||||
|
||||
add_executable (
|
||||
azure-core_test
|
||||
test/main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(azure-core-test PRIVATE azure-core)
|
||||
target_include_directories (azure-core-test PRIVATE src)
|
||||
|
||||
if (UNIX)
|
||||
target_link_libraries(azure-core-test PRIVATE m)
|
||||
endif()
|
||||
|
||||
target_include_directories (azure-core-test PRIVATE test)
|
||||
|
||||
add_test(NAME azure-core-test COMMAND azure-core-test)
|
||||
|
||||
|
||||
if (MOCK_CURL)
|
||||
MESSAGE("Will mock all calls to http client with static responses")
|
||||
add_definitions(-DMOCK_CURL="MOCK")
|
||||
endif()
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include <contract.hpp>
|
||||
|
||||
namespace azure
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
namespace http
|
||||
{
|
||||
class az_http_request
|
||||
{
|
||||
|
||||
private:
|
||||
/* data */
|
||||
public:
|
||||
az_http_request();
|
||||
~az_http_request();
|
||||
};
|
||||
|
||||
az_http_request::az_http_request() {}
|
||||
|
||||
az_http_request::~az_http_request() {}
|
||||
|
||||
} // namespace http
|
||||
} // namespace core
|
||||
} // namespace azure
|
Загрузка…
Ссылка в новой задаче