-
Notifications
You must be signed in to change notification settings - Fork 2
Migrate back to CMake build system #46
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
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
abf4438
Start writing new config
HyperWinX e95f0e4
spdlog fixes
HyperWinX 8bcc7b9
Working CMake
HyperWinX fe26b66
Update includes
HyperWinX 7d33aec
Update workflow
HyperWinX 9ed1a4e
Fix dockerfile
HyperWinX 91349af
Fix workflow
HyperWinX e6d5b05
Update dockerfile
HyperWinX 998cfe8
Update dockerfile
HyperWinX af6d513
Fix workflow
HyperWinX e1f6d86
Fix workflow
HyperWinX 4e70e06
Fix workflow
HyperWinX 8af5b6e
Lets test this shit
HyperWinX fdfffd6
HOW
HyperWinX b8aa9b3
DAMN
HyperWinX 791b310
Prepare for packaging, fix CMake
HyperWinX 871c96c
DO IT
HyperWinX e8aee36
Update workflow
HyperWinX b62c593
Update CMake
HyperWinX fb91501
Fix workflow
HyperWinX 8101b31
Fix workflow
HyperWinX 389072b
Disable repackaging
HyperWinX d686fc9
Update workflow
HyperWinX 08b6bd2
Include unzip
HyperWinX 94ffff6
Fix workflow
HyperWinX e55807b
Fix workflow
HyperWinX 2d5e111
Fix workflow
HyperWinX 78930aa
Fix workflow
HyperWinX 02d7796
Fix workflow
HyperWinX 9166f7c
Fix workflow
HyperWinX 6e66ac1
Update workflow
HyperWinX 5610af0
Fix workflow
HyperWinX 35421cf
Add pip
HyperWinX 75e72e1
Add pip
HyperWinX a8a66f7
Add libasan
HyperWinX 1017791
Add libubsan
HyperWinX 5687957
Update workflow
HyperWinX 84bafae
Fix workflow
HyperWinX 22ea4f4
Fix workflow
HyperWinX cad4b81
Fix workflow
HyperWinX 3d2c849
Fix workflow
HyperWinX 6dbc131
Fix workflow
HyperWinX 02ede64
Fix workflow
HyperWinX 6cc50ee
Fix workflow
HyperWinX 8b1a38c
Fix workflow
HyperWinX 8499397
Revert "Fix workflow"
HyperWinX 38e27a9
Update dependencies
HyperWinX 3272cd3
Fix workflow
HyperWinX f2ed4d1
Disable fedora
HyperWinX 6e230ac
Fix workflow
HyperWinX 822abb9
Fix workflow
HyperWinX 8257387
Fix workflow
HyperWinX c94e196
Apply formatting
HyperWinX File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM debian:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates curl git \ | ||
| build-essential unzip clang-format \ | ||
| clang lld ninja-build sudo \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM fedora:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN dnf update -y && dnf -y install \ | ||
| ca-certificates curl git \ | ||
| make g++ unzip libasan libubsan \ | ||
| clang lld ninja-build sudo \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/cache/dnf/* | ||
|
|
||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM ubuntu:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates curl git \ | ||
| build-essential unzip clang-format \ | ||
| clang lld ninja-build sudo \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM debian:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates curl git \ | ||
| build-essential unzip clang-format \ | ||
| gcc lld ninja-build sudo \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM fedora:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN dnf update -y && dnf -y install \ | ||
| ca-certificates curl git \ | ||
| make g++ unzip libasan libubsan \ | ||
| gcc lld ninja-build sudo clang-format \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/cache/dnf/* | ||
|
|
||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| FROM ubuntu:latest | ||
|
|
||
| ARG USER=ci | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates curl git \ | ||
| build-essential unzip clang-format \ | ||
| gcc lld ninja-build sudo \ | ||
| python3 python3-pip cmake \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN pip install conan --break-system-packages | ||
|
|
||
| RUN useradd -m ${USER} \ | ||
| && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
|
||
| WORKDIR /home/${USER}/workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| cmake_minimum_required(VERSION 3.28) | ||
| project(HyperCPU VERSION 0.5.0 LANGUAGES CXX) | ||
|
|
||
| include(CheckIPOSupported) | ||
| include(CPack) | ||
|
|
||
| set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) | ||
| set(EXPORT_COMPILE_COMMANDS TRUE) | ||
| set(CMAKE_CXX_STANDARD 20) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CPACK_GENERATOR "TGZ") | ||
| set(CPACK_PACKAGE_FILE_NAME "hypercpu-${CMAKE_BUILD_TYPE}") | ||
|
|
||
| find_package(GTest REQUIRED) | ||
| find_package(argparse REQUIRED) | ||
| find_package(eternal REQUIRED) | ||
| find_package(spdlog REQUIRED) | ||
| find_package(fmt REQUIRED) | ||
| find_package(re2 REQUIRED) | ||
| add_subdirectory(foreign/HPool) | ||
| include_directories(foreign/HPool) | ||
|
|
||
| check_ipo_supported(RESULT SUPPORTED OUTPUT ERR) | ||
|
|
||
| string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE) | ||
|
|
||
| # TODO: Enable UBSan and fix all errors | ||
| if ("${CMAKE_BUILD_TYPE}" STREQUAL "debug") | ||
| message(STATUS "Enabled debug flags") | ||
| elseif("${CMAKE_BUILD_TYPE}" STREQUAL "release") | ||
| message(STATUS "Enabled release flags") | ||
|
|
||
| if (SUPPORTED) | ||
| set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
| endif () | ||
| endif() | ||
|
|
||
| add_subdirectory(src) | ||
| add_subdirectory(tests) | ||
|
|
||
| # Find formatters | ||
| find_program(CLANG_FORMAT NAMES clang-format REQUIRED) | ||
|
|
||
| # Collect source files (customize as needed) | ||
| file(GLOB_RECURSE CPP_SOURCES CONFIGURE_DEPENDS | ||
| src/**.cpp src/**.hpp tests/**.cpp tests/**.hpp | ||
| ) | ||
|
|
||
| # Create formatting target | ||
| add_custom_target(format | ||
| COMMAND ${CLANG_FORMAT} -i ${CPP_SOURCES} | ||
| WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
| COMMENT "Formatting code with clang-format and cmake-format" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| from conan import ConanFile | ||
| from conan.tools.cmake import cmake_layout | ||
|
|
||
|
|
||
| class HyperCPU(ConanFile): | ||
| name = "HyperCPU" | ||
| version = "0.5.0" | ||
| settings = ["os", "compiler", "build_type", "arch"] | ||
| author = "HyperCPU Project" | ||
| requires = [ | ||
| "gtest/1.14.0", | ||
| "spdlog/1.15.0", | ||
| "argparse/3.2", | ||
| "eternal/1.0.1", | ||
| "fmt/11.0.2", | ||
| "re2/20250722" | ||
| ] | ||
| generators = ["CMakeToolchain", "CMakeDeps"] | ||
|
|
||
| def layout(self) -> None: | ||
| cmake_layout(self) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Code injection Medium