Skip to content

Commit

Permalink
Merge pull request #38 from cwahn/develop
Browse files Browse the repository at this point in the history
Develop for v0.1.0-beta.2 release
  • Loading branch information
cwahn authored Mar 5, 2024
2 parents 28b5918 + e1a5046 commit bd08df4
Show file tree
Hide file tree
Showing 19 changed files with 1,568 additions and 1,512 deletions.
97 changes: 0 additions & 97 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,100 +1,3 @@
# Language: Cpp
# BasedOnStyle: LLVM

# AccessModifierOffset: -4
# AlignAfterOpenBracket: AlwaysBreak
# AlignConsecutiveAssignments: false
# AlignConsecutiveDeclarations: false
# AlignEscapedNewlines: Left
# AlignOperands: false
# AlignTrailingComments: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: None
# AllowShortIfStatementsOnASingleLine: false
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: true
# AlwaysBreakTemplateDeclarations: true
# BinPackArguments: false
# BinPackParameters: false
# BreakBeforeBinaryOperators: All
# BreakBeforeBraces: Attach
# BraceWrapping:
# AfterClass: true
# AfterControlStatement: true
# AfterEnum: true
# AfterFunction: true
# AfterNamespace: true
# AfterStruct: true
# AfterUnion: true
# AfterExternBlock: true
# BeforeCatch: true
# BeforeElse: true
# IndentBraces: false
# BreakBeforeTernaryOperators: true
# BreakConstructorInitializersBeforeComma: false
# ColumnLimit: 100
# CommentPragmas: "^ IWYU pragma:"
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DerivePointerAlignment: false
# ExperimentalAutoDetectBinPacking: false
# FixNamespaceComments: true
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IncludeBlocks: Preserve
# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# - Regex: '^(<|"(gtest|isl|json)/)'
# Priority: 3
# - Regex: ".*"
# Priority: 1
# IndentCaseLabels: true
# IndentWidth: 4
# IndentWrappedFunctionNames: false
# KeepEmptyLinesAtTheStartOfBlocks: true
# MacroBlockBegin: ""
# MacroBlockEnd: ""
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: Inner
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 80
# PenaltyBreakString: 1000
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 10
# PointerAlignment: Left
# ReflowComments: true
# SortIncludes: false
# SpaceAfterCStyleCast: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# Standard: Cpp11
# TabWidth: 4
# UseTab: Never

AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent # New in v14. For earlier clang-format versions, use AlwaysBreak instead.
AlignConsecutiveMacros: false
Expand Down
24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ project(
LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED On)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-backtrace-limit=0")
Expand All @@ -33,6 +34,7 @@ if(MSVC)
endif()
endif()

# AddressSanitizer
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)

if(ENABLE_ASAN)
Expand All @@ -41,9 +43,29 @@ if(ENABLE_ASAN)
add_link_options(-fsanitize=address)
endif()

# Function to enable template compilation time measurement for a specific target
function(efp_enable_compilation_time target_name)
message(STATUS "Enabling template compilation time measurement for target: ${target_name}")

# Check if the compiler is Clang or GCC and add the respective flags to the target
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# Clang-specific flags to report template instantiation times for the target
set_property(TARGET ${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS " -ftime-trace")
message(STATUS "Added Clang-specific flags for template instantiation times to ${target_name}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# GCC-specific flags to report template instantiation times for the target
set_property(TARGET ${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS " -ftemplate-depth=1024 -ftime-report")
message(STATUS "Added GCC-specific flags for template instantiation times to ${target_name}")
endif()
endfunction()

# ! temp
# Set verbose makefile output
set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose output" FORCE)

add_library(efp INTERFACE)
target_include_directories(efp INTERFACE "./include")

target_compile_features(efp INTERFACE cxx_std_11)

# Check if this CMakeLists.txt is the top-most CMake project
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ target_link_libraries(io_demo
add_executable(format_demo format_demo.cpp)
target_link_libraries(format_demo
PRIVATE
efp)
efp)
2 changes: 1 addition & 1 deletion include/efp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "./efp/scientific.hpp"
#include "./efp/sort.hpp"
#include "./efp/c_utility.hpp"

#include "./efp/io.hpp"
#include "./efp/string.hpp"
#include "./efp/format.hpp"
#include "./efp/concurrency.hpp"

#endif
Loading

0 comments on commit bd08df4

Please sign in to comment.