Skip to content

Commit

Permalink
Cleaning CMakeLists and adding clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
grtheod committed Mar 31, 2020
1 parent fcaf157 commit 30eb3b6
Show file tree
Hide file tree
Showing 2 changed files with 157 additions and 52 deletions.
156 changes: 156 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
...

53 changes: 1 addition & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,74 +22,23 @@ SET(HEADERS
SET(HEADERS_DATA_STRUCTURES
)
# common source shared
SET(SRC_WINSUM
#WinSum/WinSumBase.cpp
#WinSum/WinSum_addlong.cpp
)
SET(SOURCES
${HEADERS}
#benchmarks/query.cpp
#${SRC_WINSUM}
)

# -- apply to all configurations
#SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -fcilkplus -Wall" )
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include utils.h -fdiagnostics-color=auto -D_GLIBCXX_USE_CXX11_ABI=0")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include utils.h -fdiagnostics-color=auto")

#SET(CMAKE_CXX_FLAGS_DEBUG
# "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17 -g -O0 -Wall -Wfatal-errors") #-DHAVE_NUMA
#SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -g -fcilkplus -Wall -O2" )
#SET(CMAKE_CXX_FLAGS_RELEASE "-std=c++17 -g -Wall -O3") #-DHAVE_NUMA
#SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -std=c++11 -g -fcilkplus -Wall")
#if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# add_definitions(-DCONFIG_KAGE_GLOBAL_DEBUG_LEVEL=30)
# # add_definitions(-D_GLIBCXX_DEBUG) # will fail compilation in folly
#endif ()
#if (CMAKE_BUILD_TYPE STREQUAL "Release")
# add_definitions(-DCONFIG_KAGE_GLOBAL_DEBUG_LEVEL=50)
# add_definitions(-DNDEBUG)
#endif ()
#if (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
# add_definitions(-DCONFIG_KAGE_GLOBAL_DEBUG_LEVEL=20)
#endif ()

# SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lboost_date_time" )
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
#SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" )
#SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread -L/home/xzl/tmp/boost_1_61_0/stage/lib -static" )


# xzl: tbb will be in the default lib path
#FIND_LIBRARY(tbb NAMES libtbb.so)
#FIND_LIBRARY(tbb NAMES libtbb.so PATHS tbb/lib/intel64/gcc4.7)
#FIND_LIBRARY(tbb_malloc NAMES libtbbmalloc.so PATHS tbb/lib/intel64/gcc4.7)
#TARGET_LINK_LIBRARIES(test.bin boost_date_time boost_system boost_thread numa ${tbb}))


# Boost Library
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.63.0 COMPONENTS filesystem regex program_options iostreams)


# VTune directory
set(VTUNE_DIR ${VTUNE_HOME}/vtune_amplifier)
#${VTUNE_HOME}/vtune_amplifier)#"/media/george/DATA/intel/vtune_amplifier")
include_directories(${VTUNE_DIR}/include)
#include_directories(/media/george/DATA/intel/vtune_amplifier/lib64)
#link_directories(/media/george/DATA/intel/vtune_amplifier/lib64)
#include_directories(/media/george/DATA/intel/vtune_amplifier/lib64/runtime)
#link_directories(/media/george/DATA/intel/vtune_amplifier/lib64/runtime)

# Locate GTest
#find_package(GTest REQUIRED)
#include_directories(${GTEST_INCLUDE_DIRS})
#target_link_libraries(runTests ${GTEST_LIBRARIES} pthread)

# Locate GBenchmark
#find_package(benchmark REQUIRED)
#include_directories(${benchmark_INCLUDE_DIRS})
#target_link_libraries(runTests ${benchmark_LIBRARIES} pthread)

#link_directories(/media/george/DATA/intel/vtune_amplifier/lib64/runtime)

0 comments on commit 30eb3b6

Please sign in to comment.