osquery-1/osquery/main/lib.cpp
Teddy Reed f3f605e26a Introduce a PLATFORM_MASK and isPlatform (#2334)
Along with the platform defines and platform string defines provided by
CMake to the build, add a PLATFORM_MASK define.

Use this define as a platform-type mask with the PlatformType enum.
2016-08-09 20:27:42 -07:00

37 lines
1.1 KiB
C++

/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <string>
#include <osquery/core.h>
// If CMake/gmake did not define a build version set the version to 1.0.
// clang-format off
#if !defined(OSQUERY_BUILD_VERSION)
#warning The build should define OSQUERY_BUILD_VERSION.
#define OSQUERY_BUILD_VERSION 1.0.0-unknown
#endif
#if !defined(OSQUERY_PLATFORM_MASK)
#error The build must define OSQUERY_PLATFORM_MASK.
#endif
// clang-format on
namespace osquery {
#ifdef DEBUG
const std::string kVersion = CONCAT(OSQUERY_BUILD_VERSION, -debug);
#else
const std::string kVersion = STR(OSQUERY_BUILD_VERSION);
#endif
const std::string kSDKVersion = OSQUERY_SDK_VERSION;
const std::string kSDKPlatform = OSQUERY_PLATFORM;
const PlatformType kPlatformType = static_cast<PlatformType>(OSQUERY_PLATFORM_MASK);
}