diff --git a/.github/workflows/_on-pr.yml b/.github/workflows/_on-pr.yml index a89bc19e..b8171dbf 100644 --- a/.github/workflows/_on-pr.yml +++ b/.github/workflows/_on-pr.yml @@ -10,6 +10,7 @@ on: - opened - synchronize - reopened + - ready_for_review concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.gitignore b/.gitignore index bebb989d..bf1e94c9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,7 @@ Thumbs.db .idea/dictionaries .idea/shelf .idea/copilot* +.idea/modules.xml +.idea/*.iml .vs/* CMakeUserPresets.json diff --git a/.idea/misc.xml b/.idea/misc.xml index 325891b7..96443667 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,12 @@ + + + + + @@ -9,6 +16,7 @@ - - - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index fd12b1f4..a2268001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,7 +246,6 @@ message(STATUS "Using Boost ${Boost_VERSION} from Conan") find_package(miniupnpc REQUIRED) find_package(ZLIB REQUIRED) -find_package(ethash REQUIRED) find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) include_directories(src "${CMAKE_BINARY_DIR}/version") diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..d288d24e --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,98 @@ +{ + "version": 10, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "$comment": "Lethean presets", + "include": [ + "ConanPresets.json" + + ], + "configurePresets": [ + { + "name": "default", + "displayName": "Default Config", + "description": "Default build using Ninja generator", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/default", + "cacheVariables": { + "TESTNET": "ON" + } + }, + { + "name": "windows-default", + "displayName": "Windows x64 Debug", + "description": "Sets Ninja generator, compilers, x64 architecture, build and install directory, debug build type", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "architecture": { + "value": "x64", + "strategy": "external" + }, + "cacheVariables": { + "TESTNET": "ON", + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/${presetName}" + }, + "vendor": { + "microsoft.com/VisualStudioSettings/CMake/1.0": { + "hostOS": [ "Windows" ] + } + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "output": {"outputOnFailure": true}, + "execution": {"noTestsAction": "error", "stopOnFailure": true} + } + ], + "packagePresets": [ + { + "name": "default", + "configurePreset": "default", + "generators": [ + "TGZ", + "ZIP" + ] + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + }, + { + "type": "package", + "name": "default" + } + ] + } + ] +} \ No newline at end of file diff --git a/ConanPresets.json b/ConanPresets.json new file mode 100644 index 00000000..7951a8dd --- /dev/null +++ b/ConanPresets.json @@ -0,0 +1,8 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index 1a33df70..adbd145c 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ release: docs build @rm -rf $(CURDIR)/build/packages/_CPack_Packages build: configure - cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES) + cmake --build --preset conan-release --parallel=$(CPU_CORES) debug: conan-profile-detect @echo "Building profile: debug" @@ -92,7 +92,7 @@ build-deps: conan-profile-detect configure: build-deps @echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)" - cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION) + cmake --preset conan-release -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION) docs: configure @echo "Building Documentation" diff --git a/conanfile.py b/conanfile.py index a8f6fbdc..8e998418 100644 --- a/conanfile.py +++ b/conanfile.py @@ -11,11 +11,13 @@ class BlockchainConan(ConanFile): options = { "static": [True, False], - "testnet": [True, False] + "testnet": [True, False], + "ci": [True, False] } default_options = { "static": False, "testnet": False, + "ci": False, "boost/*:without_test": True } @@ -29,7 +31,15 @@ class BlockchainConan(ConanFile): def generate(self): tc = CMakeToolchain(self) - tc.user_presets_path = False + + # When conan-default / conan-release becomes an issue the blow adds OS, ARCH and Compiler to the preset name + # if self.options.__contains__("CI"): + # os_val = str(self.settings.os).lower() + # arch_val = str(self.settings.arch).lower() + # compiler_val = str(self.settings.compiler).lower() + # tc.presets_prefix = f"{os_val}-{arch_val}-{compiler_val}" + + tc.user_presets_path = "ConanPresets.json" tc.variables["STATIC"] = self.options.static tc.variables["TESTNET"] = self.options.testnet # tc.preprocessor_definitions["TESTNET"] = None @@ -40,8 +50,10 @@ class BlockchainConan(ConanFile): deps.generate() def layout(self): + self.folders.generators = os.path.join("build", str(self.settings.build_type).lower(), "generators") self.folders.build = os.path.join("build", str(self.settings.build_type).lower()) + # self.folders.build_folder_vars = ["settings.os", "settings.arch", "settings.compiler", "settings.build_type"] def build(self): cmake = CMake(self)