Skip to content
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

Upgrade to Conan 2 #92

Merged
merged 18 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions .github/workflows/build.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we skipping test step by removing build.yml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, you're right. I've restored the deleted workflow and cleaned it up a bit.

This file was deleted.

33 changes: 17 additions & 16 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-latest]
build_type: [Debug, Release]
compiler_version: [9]
compiler_libcxx: [libstdc++11]

steps:
- uses: actions/checkout@v2
- name: Install prerequisites
run: |
sudo apt-get install -y --no-install-recommends g++-8
sudo pip3 install --upgrade setuptools pip
sudo pip3 install conan
- name: Install compiler
run: sudo apt-get install -y --no-install-recommends g++-${{ matrix.compiler_version }}
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
run: |
conan profile detect
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Conan create
run: |
REFNAME="${GITHUB_REF#refs/*/}"
Expand All @@ -42,9 +43,9 @@ jobs:
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create -s build_type=${{ matrix.build_type }} -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.compiler_libcxx }} -b missing . osp/${CHANNEL}
conan create -s build_type=${{ matrix.build_type }} -s compiler.version=${{ matrix.compiler_version }} -s compiler.libcxx=${{ matrix.compiler_libcxx }} -b missing . --user=osp --channel=${CHANNEL}
- name: Conan upload
run: conan upload --all --confirm --remote osp 'proxyfmu*'
run: conan upload --confirm --remote osp 'proxyfmu*'


conan-on-windows:
Expand All @@ -58,12 +59,12 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Install prerequisites
run: |
pip3 install --upgrade setuptools pip
pip3 install conan
- name: Install Conan
uses: turtlebrowser/get-conan@main
- name: Configure Conan
run: conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
run: |
conan profile detect
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Conan create
shell: bash
run: |
Expand All @@ -75,6 +76,6 @@ jobs:
SHORT_REFNAME="${REFNAME:0:40}"
CHANNEL="testing-${SHORT_REFNAME//\//_}"
fi
conan create -s build_type=${{ matrix.build_type }} -b missing . osp/${CHANNEL}
conan create -s build_type=${{ matrix.build_type }} -b missing . --user=osp --channel=${CHANNEL}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the build process for conan2 has been changed, it would be good to have an updated README.md that explains how to build the source locally for development and release purposes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current README simply refers users to the CI workflow setup for instructions. This is good in the sense that the instructions will always be up-to-date and known to work, but it is unfortunate in the sense that it requires users to have at least some understanding of the GitHub workflow definition files.

Do I understand you correctly that you wish me to add the instructions to the README? (If not, I still have to update the link to the workflow file, since I changed its name.)

- name: Conan upload
run: conan upload --all --confirm --remote osp 'proxyfmu*'
run: conan upload --confirm --remote osp 'proxyfmu*'
29 changes: 2 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(generatedSourcesDir "${CMAKE_BINARY_DIR}/generated")

set(Boost_USE_STATIC_LIBS ON)

if (MSVC)
add_definitions("-D_WIN32_WINNT=0x600" "-D_CRT_SECURE_NO_WARNINGS")
add_compile_options("/wd4996" "/wd4251" "/wd4244" "/wd4267")
Expand Down Expand Up @@ -57,27 +55,6 @@ set(PROXYFMU_EXPORT_TARGET "${PROJECT_NAME}-targets")
# Dependencies
# ==============================================================================

if (CONAN_EXPORTED) # in conan local cache
# standard conan installation, deps will be defined in conanfile.py
# and not necessary to call conan again, conan is already running
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
else ()

include(cmake/conan.cmake)
conan_check(REQUIRED)

conan_cmake_autodetect(settings)

conan_add_remote(NAME osp URL https://osp.jfrog.io/artifactory/api/conan/conan-local)
conan_cmake_run(
CONANFILE conanfile.py
BUILD missing
SETTINGS ${settings}
BASIC_SETUP)

endif ()

set(BOOST_COMPONENTS filesystem)
if (PROXYFMU_BUILD_TESTS)
Include(FetchContent)
Expand All @@ -93,8 +70,8 @@ endif ()

find_package(Boost 1.71 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
find_package(CLI11 REQUIRED)
find_package(THRIFT REQUIRED)
find_package(FMILIB REQUIRED)
find_package(Thrift REQUIRED)
find_package(FMILIB MODULE REQUIRED)


# ==============================================================================
Expand Down Expand Up @@ -147,9 +124,7 @@ install(FILES "${versionFile}" DESTINATION "${PROXYFMU_CMAKE_INSTALL_DIR}")

# Install custom find modules
install(FILES
"${CMAKE_SOURCE_DIR}/cmake/FindCLI11.cmake"
"${CMAKE_SOURCE_DIR}/cmake/FindFMILIB.cmake"
"${CMAKE_SOURCE_DIR}/cmake/FindTHRIFT.cmake"
DESTINATION
"${PROXYFMU_CMAKE_INSTALL_DIR}"
)
19 changes: 0 additions & 19 deletions cmake/FindCLI11.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions cmake/FindTHRIFT.cmake

This file was deleted.

Loading
Loading