Skip to content

Commit

Permalink
conan2
Browse files Browse the repository at this point in the history
  • Loading branch information
mcb5637 committed Jun 7, 2024
1 parent e0b1f0c commit fa2eac0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-conan-branch-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
public_artifactory: true
os: ubuntu-22.04
compiler: clang-15
cmake-version: 3.22.6
conan-version: 2.0.13
cmake-version: 3.24.0
conan-version: 2.3.0
secrets:
CONAN_USER: ${{ secrets.CONAN_USER }}
CONAN_PW: ${{ secrets.CONAN_PW }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
public_artifactory: true
os: ubuntu-22.04
compiler: clang-15
cmake-version: 3.22.6
conan-version: 2.0.13
cmake-version: 3.24.0
conan-version: 2.3.0
secrets:
CONAN_USER: ${{ secrets.CONAN_USER }}
CONAN_PW: ${{ secrets.CONAN_PW }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ Sparql.g4

# ANTLR tool
gen/
SparqlLexer.tokens
SparqlLexer.tokens
/CMakeUserPresets.json
/conan_provider.cmake
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ project(sparql-parser-base VERSION 0.3.6)
include(cmake/boilerplate_init.cmake)
boilerplate_init()

OPTION(USE_CONAN "If available, use conan to retrieve dependencies." ON)
if (PROJECT_IS_TOP_LEVEL AND USE_CONAN)
include(cmake/conan_cmake.cmake)
if (PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
set(CONAN_HYPERTRIE_WITH_TEST_DEPS "True")
else()
set(CONAN_HYPERTRIE_WITH_TEST_DEPS "False")
endif()
set(CONAN_OPTIONS "with_test_deps=${CONAN_HYPERTRIE_WITH_TEST_DEPS}")
install_packages_via_conan("${CMAKE_SOURCE_DIR}/conanfile.py" "${CONAN_OPTIONS}")
endif ()

find_package(antlr4-runtime REQUIRED)

set(ANTLR4_TAG "4.13.1" CACHE STRING "Antlr4 version" FORCE)
Expand Down
10 changes: 5 additions & 5 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake
from conan.tools.cmake import cmake_layout, CMake
from conan.tools.files import load, rmdir, copy
from conan.tools.microsoft import is_msvc

Expand Down Expand Up @@ -55,18 +55,18 @@ def validate(self):
if self.settings.get_safe("compiler.cppstd"):
check_min_cppstd(self, "17")

def layout(self):
cmake_layout(self)

_cmake = None

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.configure(
variables=
{"USE_CONAN": False,
"ANTLR4_TAG": self.dependencies['antlr4-cppruntime'].ref.version}
variables={"ANTLR4_TAG": self.dependencies['antlr4-cppruntime'].ref.version}
)
self._cmake.configure()
return self._cmake

def build(self):
Expand Down

0 comments on commit fa2eac0

Please sign in to comment.