Skip to content

Commit

Permalink
feat: build system improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni committed Oct 18, 2024
1 parent 0c143aa commit 283aebe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.20)

project(domain VERSION 0 LANGUAGES CXX C)

Expand Down Expand Up @@ -415,7 +415,7 @@ set(kth_headers

add_library(${PROJECT_NAME} ${MODE} ${kth_sources} ${kth_headers})
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX CXX_STANDARD 20 CXX_STANDARD_REQUIRED TRUE)
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX CXX_STANDARD 23 CXX_STANDARD_REQUIRED TRUE)

if (ENABLE_POSITION_INDEPENDENT_CODE)
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
Expand Down
17 changes: 4 additions & 13 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

import os
from conan import ConanFile
from conan.tools.build.cppstd import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy #, apply_conandata_patches, export_conandata_patches, get, rm, rmdir
from kthbuild import option_on_off, march_conan_manip, pass_march_to_compiler
from conan.tools.cmake import CMake, CMakeDeps, cmake_layout
from kthbuild import option_on_off
from kthbuild import KnuthConanFileV2

required_conan_version = ">=2.0"
Expand All @@ -18,6 +15,7 @@ class KnuthDomainConan(KnuthConanFileV2):
url = "https://github.com/k-nuth/domain"
description = "Crypto Cross-Platform C++ Development Toolkit"
settings = "os", "compiler", "build_type", "arch"
package_type = "library"

options = {"shared": [True, False],
"fPIC": [True, False],
Expand Down Expand Up @@ -72,7 +70,7 @@ def requirements(self):
def validate(self):
KnuthConanFileV2.validate(self)
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, "20")
check_min_cppstd(self, "23")

def config_options(self):
KnuthConanFileV2.config_options(self)
Expand Down Expand Up @@ -115,16 +113,9 @@ def build(self):
cmake.test()
# cmake.test(target="tests")

# def imports(self):
# self.copy("*.h", "", "include")

def package(self):
cmake = CMake(self)
cmake.install()
# rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
# rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
# rmdir(self, os.path.join(self.package_folder, "res"))
# rmdir(self, os.path.join(self.package_folder, "share"))

def package_info(self):
self.cpp_info.includedirs = ['include']
Expand Down

0 comments on commit 283aebe

Please sign in to comment.