Victor/core/basic structure for cmake to work (#37)

* moving files and updating cmake to make it compilable
This commit is contained in:
Victor Vazquez 2020-03-18 15:39:36 -07:00 committed by GitHub
parent b264e13701
commit 7971d525df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 21 deletions

View File

@ -9,31 +9,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
add_library (
azure-core
src/http/az_http_request
src/http/http_request
)
if(MSVC)
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "/WX")
endif()
target_compile_options(azure-core PRIVATE /Wall ${WARNINGS_AS_ERRORS_FLAG} /wd5031 /wd4668 /wd4820 /wd4255 /analyze)
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
target_compile_options(azure-core PRIVATE -Xclang -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG} -Wdocumentation -Wdocumentation-unknown-command -Wcast-qual)
else()
if(WARNINGS_AS_ERRORS)
set(WARNINGS_AS_ERRORS_FLAG "-Werror")
endif()
target_compile_options(azure-core PRIVATE -Wall -Wextra -pedantic ${WARNINGS_AS_ERRORS_FLAG})
endif()
# compiler warning flags
include(global_compile_options)
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)

View File

@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#pragma once
#include <internal/contract.hpp>
namespace azure
{
namespace core
{
namespace http
{
class http_request
{
private:
/* data */
public:
http_request();
~http_request();
};
http_request::http_request() {}
http_request::~http_request() {}
} // namespace http
} // namespace core
} // namespace azure

View File

@ -0,0 +1,15 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <http/http.hpp>
namespace azure
{
namespace core
{
namespace http
{
} // namespace http
} // namespace core
} // namespace azure