Skip to content

Commit 1e9b864

Browse files
cleishmclaude
andcommitted
Fix ESP-IDF script mode compatibility
Move ESP_PLATFORM check before project() to avoid script mode errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 88df6c1 commit 1e9b864

36 files changed

Lines changed: 4573 additions & 7 deletions

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
cmake_minimum_required(VERSION 3.14)
22

3+
# ESP-IDF component support (must be before project() for script mode compatibility)
4+
if(ESP_PLATFORM)
5+
idf_component_register(INCLUDE_DIRS "include")
6+
return()
7+
endif()
8+
39
project(thermo
410
VERSION 1.1.0
511
DESCRIPTION "Type-safe temperature handling library modeled after std::chrono"
612
HOMEPAGE_URL "https://github.com/cleishm/thermo-cpp"
713
LANGUAGES CXX
814
)
915

10-
# ESP-IDF component support
11-
if(ESP_PLATFORM)
12-
idf_component_register(INCLUDE_DIRS "include")
13-
return()
14-
endif()
15-
1616
option(THERMO_BUILD_TESTS "Build tests" ${thermo_IS_TOP_LEVEL})
1717

1818
set(CMAKE_CXX_EXTENSIONS OFF)

dist/frequency_1.1.0.tgz

218 KB
Binary file not shown.

dist/frequency_1.1.0/.clang-format

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
# C++ Code Style Configuration for clang-format
3+
4+
# Base style
5+
BasedOnStyle: LLVM
6+
7+
# Indentation
8+
IndentWidth: 4
9+
UseTab: Never
10+
NamespaceIndentation: None
11+
AccessModifierOffset: -4
12+
13+
# Line length
14+
ColumnLimit: 120
15+
16+
# Braces (K&R style)
17+
BreakBeforeBraces: Attach
18+
InsertBraces: true
19+
20+
# Pointers and references (left-aligned with type)
21+
PointerAlignment: Left
22+
ReferenceAlignment: Left
23+
DerivePointerAlignment: false
24+
25+
# Templates
26+
SpaceAfterTemplateKeyword: false
27+
28+
# Function parameters and arguments
29+
# Use BlockIndent for minimal diffs - avoids vertical alignment that changes unrelated lines
30+
AlignAfterOpenBracket: BlockIndent
31+
BinPackParameters: false
32+
BinPackArguments: false
33+
AllowAllParametersOfDeclarationOnNextLine: false
34+
35+
# Constructor initializers
36+
BreakConstructorInitializers: BeforeComma
37+
ConstructorInitializerIndentWidth: 4
38+
PackConstructorInitializers: Never
39+
40+
# Short functions (allow inline getters)
41+
AllowShortFunctionsOnASingleLine: Inline
42+
AllowShortIfStatementsOnASingleLine: Never
43+
AllowShortLoopsOnASingleLine: false
44+
45+
# Include sorting
46+
SortIncludes: CaseSensitive
47+
IncludeBlocks: Regroup
48+
IncludeCategories:
49+
# Main header (matched by file name)
50+
- Regex: '^".*"$'
51+
Priority: 1
52+
# Standard library
53+
- Regex: '^<.*>'
54+
Priority: 2
55+
56+
# Spaces
57+
SpaceBeforeParens: ControlStatements
58+
SpaceInEmptyParentheses: false
59+
SpacesInContainerLiterals: false
60+
61+
# Alignment (minimize to avoid unrelated line changes in diffs)
62+
AlignConsecutiveAssignments: None
63+
AlignConsecutiveDeclarations: None
64+
AlignOperands: DontAlign
65+
66+
# Other formatting
67+
AlwaysBreakTemplateDeclarations: Yes
68+
KeepEmptyLinesAtTheStartOfBlocks: false
69+
MaxEmptyLinesToKeep: 1
70+
71+
# C++23 (using Latest for clang-format compatibility)
72+
Standard: Latest

dist/frequency_1.1.0/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Build directories
2+
build/
3+
cmake-build-*/
4+
out/
5+
6+
# Documentation
7+
docs/html/
8+
docs/xml/
9+
10+
# IDE
11+
.idea/
12+
.vscode/
13+
*.swp
14+
*.swo
15+
*~
16+
17+
# OS
18+
.DS_Store
19+
Thumbs.db
20+
21+
# Compiled
22+
*.o
23+
*.obj
24+
*.a
25+
*.lib
26+
*.so
27+
*.dylib
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project(thermo
4+
VERSION 1.1.0
5+
DESCRIPTION "Type-safe temperature handling library modeled after std::chrono"
6+
HOMEPAGE_URL "https://github.com/cleishm/thermo-cpp"
7+
LANGUAGES CXX
8+
)
9+
10+
# ESP-IDF component support
11+
if(ESP_PLATFORM)
12+
idf_component_register(INCLUDE_DIRS "include")
13+
return()
14+
endif()
15+
16+
option(THERMO_BUILD_TESTS "Build tests" ${thermo_IS_TOP_LEVEL})
17+
18+
set(CMAKE_CXX_EXTENSIONS OFF)
19+
20+
# Main library target (header-only)
21+
add_library(thermo INTERFACE)
22+
add_library(thermo::thermo ALIAS thermo)
23+
24+
target_include_directories(thermo INTERFACE
25+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
26+
$<INSTALL_INTERFACE:include>
27+
)
28+
29+
target_compile_features(thermo INTERFACE cxx_std_23)
30+
31+
# Tests
32+
if(THERMO_BUILD_TESTS)
33+
enable_testing()
34+
add_subdirectory(tests)
35+
endif()
36+
37+
# Documentation
38+
option(THERMO_BUILD_DOCS "Build documentation" OFF)
39+
40+
if(THERMO_BUILD_DOCS)
41+
find_package(Doxygen)
42+
if(DOXYGEN_FOUND)
43+
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs)
44+
add_custom_target(docs
45+
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIRECTORY}
46+
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile
47+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs
48+
COMMENT "Generating API documentation with Doxygen"
49+
VERBATIM
50+
)
51+
message(STATUS "Doxygen found: documentation can be built with 'make docs'")
52+
else()
53+
message(WARNING "Doxygen not found: documentation cannot be built")
54+
endif()
55+
endif()
56+
57+
# Installation
58+
include(GNUInstallDirs)
59+
include(CMakePackageConfigHelpers)
60+
61+
install(TARGETS thermo
62+
EXPORT thermoTargets
63+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
64+
)
65+
66+
install(DIRECTORY include/
67+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
68+
)
69+
70+
install(EXPORT thermoTargets
71+
FILE thermoTargets.cmake
72+
NAMESPACE thermo::
73+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/thermo
74+
)
75+
76+
configure_package_config_file(
77+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/thermoConfig.cmake.in
78+
${CMAKE_CURRENT_BINARY_DIR}/thermoConfig.cmake
79+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/thermo
80+
)
81+
82+
write_basic_package_version_file(
83+
${CMAKE_CURRENT_BINARY_DIR}/thermoConfigVersion.cmake
84+
VERSION ${PROJECT_VERSION}
85+
COMPATIBILITY SameMajorVersion
86+
)
87+
88+
install(FILES
89+
${CMAKE_CURRENT_BINARY_DIR}/thermoConfig.cmake
90+
${CMAKE_CURRENT_BINARY_DIR}/thermoConfigVersion.cmake
91+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/thermo
92+
)

dist/frequency_1.1.0/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Chris Leishman
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)