diff --git a/CMakeLists.txt b/CMakeLists.txt index 4eec040b..3177b882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,14 +33,14 @@ set(DBG_FLAGS "-ggdb -gdwarf-2 -O0 -Wall -Wextra -pedantic -fno-builtin-malloc if (CMAKE_BUILD_TYPE STREQUAL "Release") #TODO: -fno-rtti message("Building Release ...") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${REL_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${REL_FLAGS}") + 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 ...") include(tools/FindTcmalloc.cmake) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${DEB_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${DEB_FLAGS}") + 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}") endif() include(tools/Utils.cmake) diff --git a/build-cmake-clang.cmd b/build-cmake-clang.cmd index f58f0a13..bc8f476c 100644 --- a/build-cmake-clang.cmd +++ b/build-cmake-clang.cmd @@ -50,8 +50,8 @@ for %%a in ( m32 m64 ) do ( ) @mkdir %OUTDIR%\%%c\!ARCH! cd %OUTDIR%\%%c\!ARCH! - set CFLAGS=-%%a - set CXXFLAGS=-%%a + set "CFLAGS=-%%a" + set "CXXFLAGS=-%%a -Wc++11-compat-pedantic -Wno-c++98-compat -Wno-everything" cmake -G"Visual Studio 15 2017!ARCH_GEN!" ^ -T"%LLVM_VER%" ^ -DTARGET_ARCH=!ARCH! ^ diff --git a/tools/build-deps.cmd b/tools/build-deps.cmd index 00351cdd..a2acf7e7 100644 --- a/tools/build-deps.cmd +++ b/tools/build-deps.cmd @@ -9,7 +9,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Too set MAXCPUCOUNT=%NUMBER_OF_PROCESSORS% set platform= -set SOLUTION=%ROOT%\Solutions\MATSDK.sln +set SOLUTION=%ROOT%\Solutions\MSTelemetrySDK.sln REM Build gmock and gtest