Skip to content

Commit

Permalink
Merge pull request #37 from aras-p/optimize-large-builds
Browse files Browse the repository at this point in the history
Optimizations for large builds
  • Loading branch information
aras-p committed Mar 2, 2020
2 parents 77c97ac + 258c624 commit 5b2550e
Show file tree
Hide file tree
Showing 38 changed files with 21,672 additions and 3,012 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ on:

jobs:
windows:
runs-on: windows-2016
runs-on: windows-2019
timeout-minutes: 5
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Windows VS2017
- name: Windows VS2019
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && msbuild.exe projects/vs2017/ClangBuildAnalyzer.sln /p:Configuration=Debug /p:CL_MPCount=2
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && msbuild.exe projects/vs2017/ClangBuildAnalyzer.sln /p:Configuration=Release /p:CL_MPCount=2
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && msbuild.exe projects/vs2019/ClangBuildAnalyzer.sln /p:Configuration=Debug /p:CL_MPCount=2
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && msbuild.exe projects/vs2019/ClangBuildAnalyzer.sln /p:Configuration=Release /p:CL_MPCount=2
build\ClangBuildAnalyzer.exe --test tests
shell: cmd
- uses: actions/upload-artifact@v1
Expand All @@ -26,6 +27,7 @@ jobs:

mac:
runs-on: macOS-latest
timeout-minutes: 5
strategy:
fail-fast: false
steps:
Expand All @@ -42,12 +44,22 @@ jobs:

linux:
runs-on: ubuntu-16.04
timeout-minutes: 5
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v1
- name: Ubuntu 16
- name: Ubuntu16 Gcc7
env:
CC: gcc-7
CXX: g++-7
run: |
mkdir buildCmake
cd buildCmake
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j 2
cd ..
buildCmake/ClangBuildAnalyzer --test tests
make -f projects/make/Makefile -j 2
build/ClangBuildAnalyzer --test tests
- uses: actions/upload-artifact@v1
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
build/
projects/vs2017/.vs
.vs
project.xcworkspace
*.vcxproj.user
xcuserdata
xcschemes
_AnalysisOutput.txt
_TraceOutput.json
_TraceOutput.bin

10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ add_executable(ClangBuildAnalyzer)
target_sources(ClangBuildAnalyzer PRIVATE
# C sources
"src/external/inih/ini.c"
# C++ sources
"src/Allocator.cpp"
"src/external/xxHash/xxhash.c"
# C++ sources
"src/Analysis.cpp"
"src/Arena.cpp"
"src/BuildEvents.cpp"
"src/Colors.cpp"
"src/main.cpp"
"src/Utils.cpp"
"src/external/enkiTS/TaskScheduler.cpp"
"src/external/inih/cpp/INIReader.cpp"
"src/external/llvm-Demangle/lib/Demangle.cpp"
"src/external/llvm-Demangle/lib/ItaniumDemangle.cpp"
"src/external/llvm-Demangle/lib/MicrosoftDemangle.cpp"
"src/external/llvm-Demangle/lib/MicrosoftDemangleNodes.cpp"
"src/external/simdjson/simdjson.cpp"
)
target_compile_features(ClangBuildAnalyzer PRIVATE cxx_std_14)
target_compile_features(ClangBuildAnalyzer PRIVATE cxx_std_17)
target_link_libraries(ClangBuildAnalyzer -lpthread)
15 changes: 9 additions & 6 deletions projects/make/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
INCLUDES=
CFLAGS:=$(INCLUDES) -O2 $(CFLAGS)
CXXFLAGS:=$(INCLUDES) -O2 -std=c++14 $(CXXFLAGS)
CFLAGS:=$(INCLUDES) -O2 -DNDEBUG=1 $(CFLAGS)
CXXFLAGS:=$(INCLUDES) -O2 -DNDEBUG=1 -std=c++17 $(CXXFLAGS)

C_SRCS= \
src/external/inih/ini.c
src/external/inih/ini.c \
src/external/xxHash/xxhash.c

CPP_SRCS= \
src/Allocator.cpp \
src/Analysis.cpp \
src/Arena.cpp \
src/BuildEvents.cpp \
src/Colors.cpp \
src/main.cpp \
src/Utils.cpp \
src/external/enkiTS/TaskScheduler.cpp \
src/external/inih/cpp/INIReader.cpp \
src/external/llvm-Demangle/lib/Demangle.cpp \
src/external/llvm-Demangle/lib/ItaniumDemangle.cpp \
src/external/llvm-Demangle/lib/MicrosoftDemangle.cpp \
src/external/llvm-Demangle/lib/MicrosoftDemangleNodes.cpp
src/external/llvm-Demangle/lib/MicrosoftDemangleNodes.cpp \
src/external/simdjson/simdjson.cpp

C_OBJS=$(C_SRCS:%.c=build/%.o)
CPP_OBJS=$(CPP_SRCS:%.cpp=build/%.o)
Expand All @@ -27,7 +30,7 @@ clean:
rm -f build/ClangBuildAnalyzer $(C_OBJS) $(CPP_OBJS)

build/ClangBuildAnalyzer: $(C_OBJS) $(CPP_OBJS)
$(CXX) -o $@ $(C_OBJS) $(CPP_OBJS) $(LDFLAGS)
$(CXX) -o $@ $(C_OBJS) $(CPP_OBJS) $(LDFLAGS) -lpthread

build/%.o: %.c
mkdir -p $(dir $@)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,38 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\Allocator.cpp" />
<ClCompile Include="..\..\src\Analysis.cpp" />
<ClCompile Include="..\..\src\Arena.cpp" />
<ClCompile Include="..\..\src\BuildEvents.cpp" />
<ClCompile Include="..\..\src\Colors.cpp" />
<ClCompile Include="..\..\src\external\enkiTS\TaskScheduler.cpp" />
<ClCompile Include="..\..\src\external\inih\cpp\INIReader.cpp" />
<ClCompile Include="..\..\src\external\inih\ini.c" />
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\Demangle.cpp" />
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\ItaniumDemangle.cpp" />
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\MicrosoftDemangle.cpp" />
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\MicrosoftDemangle.cpp">
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4244</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4244</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\MicrosoftDemangleNodes.cpp" />
<ClCompile Include="..\..\src\external\simdjson\simdjson.cpp">
<SDLCheck Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</SDLCheck>
<SDLCheck Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</SDLCheck>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4244;4267;4805;4305</DisableSpecificWarnings>
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4244;4267;4805;4305</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="..\..\src\external\xxHash\xxhash.c" />
<ClCompile Include="..\..\src\main.cpp" />
<ClCompile Include="..\..\src\Utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\Analysis.h" />
<ClInclude Include="..\..\src\Arena.h" />
<ClInclude Include="..\..\src\BuildEvents.h" />
<ClInclude Include="..\..\src\Colors.h" />
<ClInclude Include="..\..\src\external\cute_files.h" />
<ClInclude Include="..\..\src\external\enkiTS\LockLessMultiReadPipe.h" />
<ClInclude Include="..\..\src\external\enkiTS\TaskScheduler.h" />
<ClInclude Include="..\..\src\external\inih\cpp\INIReader.h" />
<ClInclude Include="..\..\src\external\inih\ini.h" />
<ClInclude Include="..\..\src\external\llvm-Demangle\include\Demangle.h" />
Expand All @@ -38,8 +52,10 @@
<ClInclude Include="..\..\src\external\llvm-Demangle\include\MicrosoftDemangleNodes.h" />
<ClInclude Include="..\..\src\external\llvm-Demangle\include\StringView.h" />
<ClInclude Include="..\..\src\external\llvm-Demangle\include\Utility.h" />
<ClInclude Include="..\..\src\external\sajson.h" />
<ClInclude Include="..\..\src\external\simdjson\simdjson.h" />
<ClInclude Include="..\..\src\external\sokol_time.h" />
<ClInclude Include="..\..\src\external\xxHash\xxh3.h" />
<ClInclude Include="..\..\src\external\xxHash\xxhash.h" />
<ClInclude Include="..\..\src\Utils.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
Expand All @@ -52,13 +68,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -90,9 +106,11 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -106,9 +124,11 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<LanguageStandard>stdcpplatest</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\src\Allocator.cpp" />
<ClCompile Include="..\..\src\Analysis.cpp" />
<ClCompile Include="..\..\src\BuildEvents.cpp" />
<ClCompile Include="..\..\src\Colors.cpp" />
Expand All @@ -25,6 +24,16 @@
<ClCompile Include="..\..\src\external\llvm-Demangle\lib\MicrosoftDemangleNodes.cpp">
<Filter>external\llvm-Demangle</Filter>
</ClCompile>
<ClCompile Include="..\..\src\external\xxHash\xxhash.c">
<Filter>external\xxHash</Filter>
</ClCompile>
<ClCompile Include="..\..\src\external\simdjson\simdjson.cpp">
<Filter>external\simdjson</Filter>
</ClCompile>
<ClCompile Include="..\..\src\external\enkiTS\TaskScheduler.cpp">
<Filter>external\enkiTS</Filter>
</ClCompile>
<ClCompile Include="..\..\src\Arena.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\Analysis.h" />
Expand All @@ -34,9 +43,6 @@
<ClInclude Include="..\..\src\external\cute_files.h">
<Filter>external</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\sajson.h">
<Filter>external</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\sokol_time.h">
<Filter>external</Filter>
</ClInclude>
Expand Down Expand Up @@ -67,6 +73,22 @@
<ClInclude Include="..\..\src\external\llvm-Demangle\include\Utility.h">
<Filter>external\llvm-Demangle</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\xxHash\xxh3.h">
<Filter>external\xxHash</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\xxHash\xxhash.h">
<Filter>external\xxHash</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\simdjson\simdjson.h">
<Filter>external\simdjson</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\enkiTS\LockLessMultiReadPipe.h">
<Filter>external\enkiTS</Filter>
</ClInclude>
<ClInclude Include="..\..\src\external\enkiTS\TaskScheduler.h">
<Filter>external\enkiTS</Filter>
</ClInclude>
<ClInclude Include="..\..\src\Arena.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="external">
Expand All @@ -78,5 +100,14 @@
<Filter Include="external\llvm-Demangle">
<UniqueIdentifier>{cddd9c12-630b-4077-8e2f-4a7fa782e204}</UniqueIdentifier>
</Filter>
<Filter Include="external\xxHash">
<UniqueIdentifier>{c3b8fee3-ed0a-4ea4-b747-8dde58fdbffa}</UniqueIdentifier>
</Filter>
<Filter Include="external\simdjson">
<UniqueIdentifier>{52f79781-bd11-45d0-ab4d-c214a25a08e9}</UniqueIdentifier>
</Filter>
<Filter Include="external\enkiTS">
<UniqueIdentifier>{16a4320a-ef87-49da-8035-b6b048c5ee45}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
Loading

0 comments on commit 5b2550e

Please sign in to comment.