Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1.0)
project(MSTelemetry)
project(MSTelemetry LANGUAGES C CXX)

# Set installation prefix for macOS and Linux
if(UNIX AND NOT DEFINED CMAKE_INSTALL_PREFIX)
Expand All @@ -25,7 +25,7 @@ endif()

# Enable ARC for obj-c on Apple
if(APPLE)
message("-- BUILD_IOS: ${BUILD_IOS}")
message(STATUS "BUILD_IOS: ${BUILD_IOS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc")

# iOS build options
Expand Down Expand Up @@ -77,9 +77,9 @@ if(APPLE)
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
message("-- CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}")
message("-- ARCHITECTURE: ${CMAKE_SYSTEM_PROCESSOR}")
message("-- PLATFORM: ${IOS_PLATFORM}")
message(STATUS "CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}")
message(STATUS "ARCHITECTURE: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "PLATFORM: ${IOS_PLATFORM}")
else()
if(${MAC_ARCH} STREQUAL "x86_64")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
Expand All @@ -99,18 +99,18 @@ if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64 -arch arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -arch arm64")
endif()
message("-- MAC_ARCH: ${MAC_ARCH}")
message(STATUS "MAC_ARCH: ${MAC_ARCH}")
endif()
endif()

message("-- CMAKE_SYSTEM_INFO_FILE: ${CMAKE_SYSTEM_INFO_FILE}")
message("-- CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message("-- CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
message("-- CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
message("-- CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
message("-- CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message("-- TARGET_ARCH: ${TARGET_ARCH}")
message("-- CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "CMAKE_SYSTEM_INFO_FILE: ${CMAKE_SYSTEM_INFO_FILE}")
message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}")
message(STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
message(STATUS "TARGET_ARCH: ${TARGET_ARCH}")
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")

include(tools/ParseOsRelease.cmake)

Expand All @@ -120,21 +120,21 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# -Wno-unknown-warning-option is Clang-only, omitted here
set(WARN_FLAGS "-Wall -Werror -Wextra -Wno-unused-parameter -Wno-unused-but-set-variable")
else()
# Clang / AppleClang
set(WARN_FLAGS "-Wall -Werror -Wextra -Wno-unused-parameter -Wno-unknown-warning-option -Wno-unused-but-set-variable")
# No -pedantic -Wno-extra-semi -Wno-gnu-zero-variadic-macro-arguments
set(WARN_FLAGS "-Wall -Werror -Wextra -Wno-unused-parameter -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-nan-infinity-disabled")
endif()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Using GCC with -s and -Wl linker flags
set(REL_FLAGS "-s -Wl,--gc-sections -Os ${WARN_FLAGS} -ffunction-sections -fdata-sections -fmerge-all-constants -ffast-math -fno-finite-math-only")
set(REL_FLAGS "-s -Wl,--gc-sections -Os ${WARN_FLAGS} -ffunction-sections -fdata-sections -fmerge-all-constants -ffast-math")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(REL_FLAGS "${WARN_FLAGS}")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
# AppleClang does not support -ffunction-sections and -fdata-sections with the -fembed-bitcode and -fembed-bitcode-marker
set(REL_FLAGS "-Os ${WARN_FLAGS} -fmerge-all-constants -ffast-math -fno-finite-math-only")
set(REL_FLAGS "-Os ${WARN_FLAGS} -fmerge-all-constants -ffast-math")
else()
# Using clang - strip unsupported GCC options
set(REL_FLAGS "-Os ${WARN_FLAGS} -ffunction-sections -fmerge-all-constants -ffast-math -fno-finite-math-only")
set(REL_FLAGS "-Os ${WARN_FLAGS} -ffunction-sections -fmerge-all-constants -ffast-math")
endif()

## Uncomment this to reduce the volume of note warnings on RPi4 w/gcc-8 Ref. https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
Expand All @@ -147,12 +147,12 @@ set(DBG_FLAGS "-ggdb -gdwarf-2 -O0 ${WARN_FLAGS} -fno-builtin-malloc -fno-built

if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
#TODO: -fno-rtti
message("Building Release ...")
message(STATUS "Building Release ...")
set(CMAKE_C_FLAGS "$ENV{CFLAGS} ${CMAKE_C_FLAGS} -std=c11 ${REL_FLAGS}")
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS} -std=c++11 ${REL_FLAGS}")
else()
set(USE_TCMALLOC 1)
message("Building Debug ...")
message(STATUS "Building Debug ...")
include(tools/FindTcmalloc.cmake)
set(CMAKE_C_FLAGS "$ENV{CFLAGS} ${CMAKE_C_FLAGS} -std=c11 ${DBG_FLAGS}")
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS} -std=c++11 ${DBG_FLAGS}")
Expand Down Expand Up @@ -193,7 +193,7 @@ endif()

set(PAL_IMPLEMENTATION ${DEFAULT_PAL_IMPLEMENTATION})

message(STATUS "-- PAL implementation: ${PAL_IMPLEMENTATION}")
message(STATUS "PAL implementation: ${PAL_IMPLEMENTATION}")
string(TOUPPER ${PAL_IMPLEMENTATION} PAL_IMPLEMENTATION_UPPER)
add_definitions(-DMATSDK_PAL_${PAL_IMPLEMENTATION_UPPER}=1)

Expand Down Expand Up @@ -225,7 +225,7 @@ add_definitions(-DNOMINMAX)
set(SDK_VERSION_PREFIX "EVT")
add_definitions("-DMATSDK_VERSION_PREFIX=\"${SDK_VERSION_PREFIX}\"")

set(MATSDK_API_VERSION "3.4")
set(MATSDK_API_VERSION "3.10")
string(TIMESTAMP DAYNUMBER "%j")
string(REGEX REPLACE "^00" "" DAYNUMBER ${DAYNUMBER})
string(REGEX REPLACE "^0" "" DAYNUMBER ${DAYNUMBER})
Expand All @@ -241,7 +241,7 @@ else()
set(MATSDK_BUILD_VERSION ${MATSDK_API_VERSION}.${DAYNUMBER}.0)
endif()

message(STATUS "-- SDK version: ${SDK_VERSION_PREFIX}-${MATSDK_BUILD_VERSION}")
message(STATUS "SDK version: ${SDK_VERSION_PREFIX}-${MATSDK_BUILD_VERSION}")

################################################################################################
# HTTP stack section
Expand Down Expand Up @@ -289,9 +289,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()

if(BUILD_UNIT_TESTS OR BUILD_FUNC_TESTS)
message("Adding gtest")
message(STATUS "Adding gtest")
add_library(gtest STATIC IMPORTED GLOBAL)
message("Adding gmock")
message(STATUS "Adding gmock")
add_library(gmock STATIC IMPORTED GLOBAL)
endif()

Expand Down Expand Up @@ -323,7 +323,7 @@ if(BUILD_LIBRARY)
endif()

if(BUILD_UNIT_TESTS OR BUILD_FUNC_TESTS)
message("Building tests")
message(STATUS "Building tests")
enable_testing()
add_subdirectory(tests)
endif()
Expand Down
10 changes: 5 additions & 5 deletions Solutions/before.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<CustomIncludePath>$(SolutionDir)\..\third_party\krabsetw\krabs;$(CustomIncludePath)</CustomIncludePath>
</PropertyGroup>
<PropertyGroup Label="Globals">
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND '$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND '$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND '$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
<!-- Fallback to Visual Studio 2017 (v141) toolset by default -->
<!-- before.targets is imported before Microsoft.Cpp.Default.props, so DefaultPlatformToolset is not reliable here. -->
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '18.0'))">v145</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '17.0'))">v143</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '16.0'))">v142</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '15.0'))">v141</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v141</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' != ''">$(PlatformToolset)</PlatformToolset>
<!-- Customers may override WindowsTargetPlatformVersion before auto-detection of latest Win 10 SDK -->
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
Expand Down
44 changes: 24 additions & 20 deletions Solutions/build.MIP.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);CONFIG_CUSTOM_H="config-MIP.h";MATSDK_SHARED_LIB=1;</PreprocessorDefinitions>
</ClCompile>
<Link>
<DelayLoadDLLs Condition="'$(Configuration)'=='Debug'">ucrtbased.dll; %(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<PropertyGroup>
<DisableWinRT>true</DisableWinRT>
<PlatformToolset>v141</PlatformToolset>
<VCToolsVersion>14.1</VCToolsVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(RootNamespace)'=='ClientTelemetry'">
<TargetName>mip_ClientTelemetry</TargetName>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)build.spectr.props" />
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);CONFIG_CUSTOM_H="config-MIP.h";MATSDK_SHARED_LIB=1;</PreprocessorDefinitions>
</ClCompile>
<Link>
<DelayLoadDLLs Condition="'$(Configuration)'=='Debug'">ucrtbased.dll; %(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<PropertyGroup>
<DisableWinRT>true</DisableWinRT>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND '$(DefaultPlatformToolset)' != ''">$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '18.0'))">v145</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '17.0'))">v143</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '16.0'))">v142</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == '' AND $([MSBuild]::VersionGreaterThanOrEquals('$(VisualStudioVersion)', '15.0'))">v141</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(RootNamespace)'=='ClientTelemetry'">
<TargetName>mip_ClientTelemetry</TargetName>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)build.spectr.props" />
</Project>
1 change: 0 additions & 1 deletion examples/cpp/SampleCpp/SampleCpp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@
<ClInclude Include="DefaultApiKey.h" />
<ClInclude Include="LogManagerA.hpp" />
<ClInclude Include="LogManagerB.hpp" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="DebugCallback.cpp" />
Expand Down
3 changes: 0 additions & 3 deletions examples/cpp/SampleCpp/SampleCpp.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="LogManagerA.hpp">
<Filter>Source Files</Filter>
</ClInclude>
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/SampleCppMini/SampleCppMini.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,6 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="demo.c" />
Expand Down
5 changes: 0 additions & 5 deletions examples/cpp/SampleCppMini/SampleCppMini.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
Expand Down
Loading
Loading