-
Notifications
You must be signed in to change notification settings - Fork 267
Added Build System Integration #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 13 commits
6562dad
322b60b
cbd8fa2
7274b1d
6e76d3e
c5c585e
9942c3d
e4d0fe3
80caab6
7ed5c83
86d5ca5
ada7dcf
f9a945e
202c8e5
65d4da4
dde90f0
59bb005
2d43604
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # Common settings | ||
| BasedOnStyle: WebKit | ||
| TabWidth: 4 | ||
| IndentWidth: 4 | ||
| UseTab: Always | ||
| ColumnLimit: 100 | ||
|
|
||
| --- | ||
| Language: Cpp | ||
|
|
||
|
|
||
| AccessModifierOffset: -4 | ||
| AlignAfterOpenBracket: "DontAlign" | ||
| AlignArrayOfStructures: "Right" | ||
| AlignConsecutiveAssignments: "Consecutive" | ||
| AlignConsecutiveBitFields: "Consecutive" | ||
| AlignConsecutiveDeclarations: false | ||
| AlignConsecutiveMacros: "Consecutive" | ||
| AlignEscapedNewlines: "Right" | ||
| AlignOperands: "Align" | ||
| AlignTrailingComments: true | ||
| AllowAllParametersOfDeclarationOnNextLine: true | ||
| AllowShortBlocksOnASingleLine: "Empty" | ||
| AllowShortCaseLabelsOnASingleLine: false | ||
| AllowShortEnumsOnASingleLine: false | ||
| AllowShortFunctionsOnASingleLine: Empty | ||
| AllowShortIfStatementsOnASingleLine: "AllIfsAndElse" | ||
| AllowShortLambdasOnASingleLine: "All" | ||
| AllowShortLoopsOnASingleLine: true | ||
| AlwaysBreakAfterReturnType: None | ||
| AlwaysBreakBeforeMultilineStrings: false | ||
| AlwaysBreakTemplateDeclarations: "Yes" | ||
| BinPackArguments: false | ||
| BinPackParameters: false | ||
| BitFieldColonSpacing: "Both" | ||
|
|
||
| # Configure each individual brace in BraceWrapping | ||
| BreakBeforeBraces: Custom | ||
| # Control of individual brace wrapping cases | ||
| BraceWrapping: { | ||
| AfterCaseLabel: 'true' | ||
| AfterClass: 'true' | ||
| AfterControlStatement: 'Always' | ||
| AfterEnum : 'true' | ||
| AfterFunction : 'true' | ||
| AfterNamespace : 'true' | ||
| AfterStruct : 'true' | ||
| AfterUnion : 'true' | ||
| AfterExternBlock: 'true' | ||
| BeforeCatch : 'false' | ||
| BeforeElse : 'false' | ||
| BeforeLambdaBody : 'true' | ||
| BeforeWhile : 'false' | ||
| IndentBraces : 'false' | ||
| SplitEmptyFunction : 'false' | ||
| SplitEmptyRecord : 'false' | ||
| SplitEmptyNamespace : 'false' | ||
| } | ||
|
|
||
| BreakAfterJavaFieldAnnotations: true | ||
| BreakBeforeBinaryOperators: "None" | ||
| BreakBeforeConceptDeclarations : true | ||
| BreakBeforeTernaryOperators: true | ||
| BreakConstructorInitializers: "AfterColon" | ||
| BreakInheritanceList: 'AfterComma' | ||
| BreakStringLiterals: true | ||
| CommentPragmas: '^ IWYU pragma:' | ||
| CompactNamespaces: false | ||
| ConstructorInitializerIndentWidth: 4 | ||
| ContinuationIndentWidth: 4 | ||
| Cpp11BracedListStyle: false | ||
| DeriveLineEnding: true | ||
| DerivePointerAlignment: false | ||
| EmptyLineAfterAccessModifier: 'Always' | ||
| EmptyLineBeforeAccessModifier: 'Always' | ||
| FixNamespaceComments: false | ||
| ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, RANGES_FOR ] | ||
| IfMacros: ['IF'] | ||
| IncludeBlocks : 'Regroup' | ||
| IndentAccessModifiers : false | ||
| IndentCaseBlocks : false | ||
| IndentCaseLabels: false | ||
| IndentExternBlock : "AfterExternBlock" | ||
| IndentGotoLabels: true | ||
| IndentPPDirectives : None | ||
| IndentWrappedFunctionNames: false | ||
| KeepEmptyLinesAtTheStartOfBlocks : false | ||
| LambdaBodyIndentation : 'Signature' | ||
| NamespaceIndentation: 'All' | ||
| PackConstructorInitializers : 'NextLine' | ||
|
|
||
| PenaltyBreakBeforeFirstCallParameter: 19 | ||
| PenaltyBreakComment: 300 | ||
| PenaltyBreakFirstLessLess: 120 | ||
| PenaltyBreakString: 1000 | ||
| PenaltyExcessCharacter: 1000000 | ||
| PenaltyReturnTypeOnItsOwnLine: 60 | ||
|
|
||
| ReferenceAlignment : 'Left' | ||
| ReflowComments : true | ||
| RemoveBracesLLVM : false | ||
| SeparateDefinitionBlocks : 'Leave' | ||
| SortIncludes: 'CaseInsensitive' | ||
| SortUsingDeclarations : true | ||
| SpaceAfterCStyleCast: false | ||
| SpaceAfterLogicalNot : false | ||
| SpaceAfterTemplateKeyword : false | ||
| SpaceBeforeAssignmentOperators : true | ||
| SpaceBeforeCaseColon : true | ||
| SpaceBeforeCtorInitializerColon : true | ||
| SpaceBeforeInheritanceColon : true | ||
| SpaceBeforeParens : Never | ||
| SpaceBeforeRangeBasedForLoopColon: false | ||
| SpaceBeforeSquareBrackets : false | ||
| SpaceInEmptyBlock : false | ||
| SpaceInEmptyParentheses : false | ||
| SpacesBeforeTrailingComments: 1 | ||
| SpacesInAngles : Never | ||
| SpacesInCStyleCastParentheses : false | ||
| SpacesInConditionalStatement : false | ||
| SpacesInContainerLiterals : true | ||
| SpacesInParentheses: false | ||
| SpacesInSquareBrackets : false | ||
| Standard : Latest | ||
| PointerAlignment: Left | ||
| KeepEmptyLinesAtTheStartOfBlocks: true | ||
| MacroBlockBegin: '' | ||
| MacroBlockEnd: '' | ||
| MaxEmptyLinesToKeep: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| --- | ||
|
|
||
| Checks: > | ||
| -*, | ||
| bugprone-*, | ||
| google-*, | ||
| misc-*, | ||
| modernize-*, | ||
| performance-*, | ||
| portability-*, | ||
| readability-*, | ||
| -google-readability-namespace-comments, | ||
| -google-runtime-int, | ||
| -google-runtime-references, | ||
| -misc-non-private-member-variables-in-classes, | ||
| -readability-named-parameter, | ||
| -readability-braces-around-statements, | ||
| -readability-magic-numbers | ||
|
|
||
| WarningsAsErrors: "*" | ||
| FormatStyle: file | ||
|
|
||
| CheckOptions: | ||
| - { key: readability-identifier-naming.NamespaceCase, value: lower_case } | ||
| - { key: readability-identifier-naming.ClassCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.StructCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.FunctionCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
| - { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } | ||
| - { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } | ||
| - { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE } | ||
| - { key: readability-identifier-naming.EnumConstantCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.EnumConstantPrefix, value: k } | ||
| - { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.ConstexprVariablePrefix, value: k } | ||
| - { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.GlobalConstantPrefix, value: k } | ||
| - { key: readability-identifier-naming.MemberConstantCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.MemberConstantPrefix, value: k } | ||
| - { key: readability-identifier-naming.StaticConstantCase, value: CamelCase } | ||
| - { key: readability-identifier-naming.StaticConstantPrefix, value: k } | ||
| - { key: cert-dcl16-c.NewSuffixes, value: 'L;LL;LU;LLU' } | ||
| - { key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField, value: '0' } | ||
| - { key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors, value: '1' } | ||
| - { key: google-readability-braces-around-statements.ShortStatementLines, value: '1'} | ||
| - { key: google-readability-function-size.StatementThreshold, value: '800'} | ||
| - { key: google-readability-namespace-comments.ShortNamespaceLines, value: '10'} | ||
| - { key: google-readability-namespace-comments.SpacesBeforeComments, value: '2'} | ||
| - { key: modernize-loop-convert.MaxCopySize, value: '16'} | ||
| - { key: modernize-loop-convert.MinConfidence, value: reasonable} | ||
| - { key: modernize-loop-convert.NamingStyle, value: CamelCase} | ||
| - { key: modernize-use-nullptr.NullMacros, value: 'NULL'} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * text=auto |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| cmake_minimum_required(VERSION 3.2) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CMake 3.2 predates even C++17, so this minimum is bogus.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am sorry I had no idea that was the case. Thanks For Letting me know. |
||
| project(cppfront) | ||
|
|
||
| set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is super unfriendly to FetchContent users and totally unnecessary.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am using MSVC cmd line. And the cmd line tool has a tendency to make to obfuscate the build dir imo thats why I added that. |
||
| set(CMAKE_REGRESSION_TESTS_DIRECTORY ${CMAKE_SOURCE_DIR}/regression-tests) | ||
| set(CMAKE_PASSTHROUGH_TESTS_DIRECTORY ${CMAKE_SOURCE_DIR}/passthrough-tests) | ||
| set(RUN_CPPFRONT_TESTS ON) | ||
|
|
||
| message(${CMAKE_REGRESSION_TESTS_DIRECTORY}) | ||
|
|
||
| # Until CMake 3.20.3, if you ask for C++20, using set(CMAKE_CXX_STANDARD 20), you'll get -std:c++latest. | ||
| # Since CMake 3.20.4, set(CMAKE_CXX_STANDARD 20) gets you -std:c++20, | ||
| # so you need set(CMAKE_CXX_STANDARD 23) to get -std:c++latest -- | ||
| # assuming that your MSVC compiler version is 16.11 Preview 1 or later (see cmake commit 3aaf1d91bf353). | ||
| # issue with the standard library of MSVC | ||
| # https://stackoverflow.com/questions/64889383/how-to-enable-stdclatest-in-cmake | ||
| set(CMAKE_CXX_STANDARD 23) | ||
|
|
||
| set(SRC_FILES | ||
| "source/cppfront.cpp" | ||
| ) | ||
|
|
||
| add_executable(${PROJECT_NAME} ${SRC_FILES}) | ||
| target_include_directories(${PROJECT_NAME} PUBLIC "include") | ||
|
|
||
| # Tests are yet to be added | ||
| # not exactly sure on how to do it yet | ||
| # as it is author computer dependent | ||
|
|
||
| # Currently this procject only works on windows | ||
| # so right now it's fair to assume a standard relative path? | ||
| # cppfront/build/bin/Debug -> cppfront/build/bin/${CMAKE_BUILD_TYPE} | ||
| # cppfront/build/bin/Release -> cppfront/build/bin/${CMAKE_BUILD_TYPE} | ||
| # ! Regression Tests are being called but the copy of the files are not happening | ||
| # not exactly sure why. | ||
| # if(WIN32) | ||
| # add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | ||
| # COMMAND cmd /c ${CMAKE_REGRESSION_TESTS_DIRECTORY}/run-tests.bat) | ||
| # endif() | ||
| # Bad approach | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
|
|
||
| ## Contributing to cppfront | ||
| # Contributing to cppfront | ||
|
|
||
| cppfront is a personal experimental project of Herb Sutter. | ||
|
|
||
| At this time, the license is limited to non-commercial use and no distributed forks/derivatives please. | ||
|
|
||
|
|
||
| ## Contributor License Agreement | ||
|
|
||
| By contributing content to cppfront (i.e., submitting a pull request for inclusion in this repository): | ||
|
|
||
| - You warrant that your material is original, or you have the right to contribute it. | ||
| - With respect to the material that you own, you grant a worldwide, non-exclusive, irrevocable, transferable, and royalty-free license to your contributed material to Herb Sutter to display, reproduce, perform, distribute, and create derivative works of that material for commercial or non-commercial use. | ||
| - With respect to any other material you contribute, such material must be under a worldwide, non-exclusive, irrevocable, transferable, and royalty-free license sufficient to allow Herb Sutter to display, reproduce, perform, distribute, and create derivative works of that material for commercial or non-commercial use. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| workspace "cppfront" | ||
| configurations { "Debug", "Release" } | ||
|
|
||
| outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}" | ||
|
|
||
| project "cppfront" | ||
| kind "ConsoleApp" | ||
| language "C++" -- "C", "C++", "C#" | ||
| cppdialect "C++latest" | ||
| targetdir ("bin/" .. outputdir .. "/%{prj.name}") | ||
| objdir ("bin-int/" .. outputdir .. "/%{prj.name}") | ||
| files { "source/*.cpp", "source/*.h", "include/*.h", "*.*", "passthrough-tests/*.*", "regression-tests/**" } | ||
|
|
||
| filter "configurations:Debug" | ||
| runtime "Debug" | ||
| symbols "on" | ||
| defines { "DEBUG" } | ||
|
|
||
| filter "configurations:Release" | ||
| runtime "Release" | ||
| optimize "on" -- "on", "off", "Debug", "Size", "Speed", "Full" | ||
| defines { "NDEBUG" } | ||
|
|
||
| filter "configurations:*32" | ||
| architecture "x86" | ||
|
|
||
| filter "configurations:*64" | ||
| architecture "x86_64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like adding editor specific folders to the .gitignore is a bad rabbit hole, you end up adding them for every IDE. This belongs in a user level .gitignore instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you are right. I'll change it then.