From fef83c8aa7fd6dc2064cbf490b34e86189fcfb7b Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 20 Dec 2023 22:05:55 -0600 Subject: [PATCH 01/31] Can't use ${CMAKE_BUILD_TYPE} in conditional expression with multi-config --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4e86181..588e0482 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,13 +22,6 @@ set_property(DIRECTORY PROPERTY CMAKE_CONFIGURE_DEPENDS conanfile.py) -# Don't use RelWithDebInfo Conan packages -if (${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo") - set(conan_build_type "Release") -else() - set(conan_build_type ${CMAKE_BUILD_TYPE}) -endif() - conan_cmake_autodetect(settings BUILD_TYPE ${conan_build_type}) From 9ab9d6b2d0d27e6d5e315b93bc9e96c09f3ef425 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 20 Dec 2023 22:06:46 -0600 Subject: [PATCH 02/31] Bump minimum required to CMake 3.24 --- CMakeLists.txt | 2 +- external/CMakeLists.txt | 2 +- external/aws-sdk-cpp.cmake | 2 +- external/date.cmake | 2 +- external/hsluv-c.cmake | 2 +- external/imgui.cmake | 2 +- external/maplibre-native-qt.cmake | 2 +- external/stb.cmake | 2 +- external/textflowcpp.cmake | 2 +- external/units.cmake | 2 +- scwx-qt/CMakeLists.txt | 2 +- scwx-qt/scwx-qt.cmake | 2 +- test/CMakeLists.txt | 2 +- test/test.cmake | 2 +- wxdata/CMakeLists.txt | 2 +- wxdata/wxdata.cmake | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 588e0482..f85ef287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME supercell-wx) project(${PROJECT_NAME} VERSION 0.4.6 diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 5ef39ddc..2137ae62 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-external) set_property(DIRECTORY diff --git a/external/aws-sdk-cpp.cmake b/external/aws-sdk-cpp.cmake index 1ba641db..3952f0f8 100644 --- a/external/aws-sdk-cpp.cmake +++ b/external/aws-sdk-cpp.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-aws-sdk-cpp) set(AWS_SDK_WARNINGS_ARE_ERRORS OFF) diff --git a/external/date.cmake b/external/date.cmake index a804f68c..7fce7ffc 100644 --- a/external/date.cmake +++ b/external/date.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-date) set(USE_SYSTEM_TZ_DB ON) diff --git a/external/hsluv-c.cmake b/external/hsluv-c.cmake index 0129d39d..eec8f0f2 100644 --- a/external/hsluv-c.cmake +++ b/external/hsluv-c.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-hsluv-c) set(HSLUV_C_TESTS OFF) diff --git a/external/imgui.cmake b/external/imgui.cmake index 443817ef..c16049fb 100644 --- a/external/imgui.cmake +++ b/external/imgui.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-imgui) find_package(QT NAMES Qt6 diff --git a/external/maplibre-native-qt.cmake b/external/maplibre-native-qt.cmake index 49c37bc1..736c6049 100644 --- a/external/maplibre-native-qt.cmake +++ b/external/maplibre-native-qt.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-mln) set(gtest_disable_pthreads ON) diff --git a/external/stb.cmake b/external/stb.cmake index c26bedaf..570af425 100644 --- a/external/stb.cmake +++ b/external/stb.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-stb) set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE) diff --git a/external/textflowcpp.cmake b/external/textflowcpp.cmake index 1e36da18..31020665 100644 --- a/external/textflowcpp.cmake +++ b/external/textflowcpp.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-textflowcpp) set(TEXTFLOWCPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/textflowcpp PARENT_SCOPE) diff --git a/external/units.cmake b/external/units.cmake index d037ae54..cc70ac1c 100644 --- a/external/units.cmake +++ b/external/units.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set(PROJECT_NAME scwx-units) add_subdirectory(units) diff --git a/scwx-qt/CMakeLists.txt b/scwx-qt/CMakeLists.txt index f4e636e7..e47bc3fb 100644 --- a/scwx-qt/CMakeLists.txt +++ b/scwx-qt/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.24) set_property(DIRECTORY APPEND diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake index 1f4f4449..da5bae9e 100644 --- a/scwx-qt/scwx-qt.cmake +++ b/scwx-qt/scwx-qt.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.24) project(scwx-qt LANGUAGES CXX) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d1db7851..b5428d86 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set_property(DIRECTORY APPEND diff --git a/test/test.cmake b/test/test.cmake index 5ce56cfb..3ec6ef19 100644 --- a/test/test.cmake +++ b/test/test.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) project(scwx-test CXX) include(GoogleTest) diff --git a/wxdata/CMakeLists.txt b/wxdata/CMakeLists.txt index 845ab381..c5d91595 100644 --- a/wxdata/CMakeLists.txt +++ b/wxdata/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) set_property(DIRECTORY APPEND diff --git a/wxdata/wxdata.cmake b/wxdata/wxdata.cmake index 434fc415..ddd998f1 100644 --- a/wxdata/wxdata.cmake +++ b/wxdata/wxdata.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.24) project(scwx-data) From 75a8f7f351a6fd9a99ed46b3eaaa2e63804fd821 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 21 Dec 2023 10:41:42 -0600 Subject: [PATCH 03/31] Initial updates for Conan 2.x --- .github/workflows/ci.yml | 12 ++++++++---- CMakeLists.txt | 14 -------------- conanfile.py | 24 ++++++++++++------------ external/cmake-conan | 2 +- setup-debug.bat | 3 ++- setup-debug.sh | 1 + setup-multi.bat | 11 +++++++++++ setup-release.bat | 3 ++- setup-release.sh | 1 + tools/setup-common.bat | 2 +- tools/setup-common.sh | 2 +- 11 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 setup-multi.bat diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e59bc90..968adb52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,9 +34,10 @@ jobs: qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_tools: '' conan_arch: x86_64 - conan_compiler: Visual Studio - conan_compiler_version: 17 - conan_compiler_runtime: --settings compiler.runtime=MD + conan_compiler: msvc + conan_compiler_version: 193 + conan_compiler_cppstd: 20 + conan_compiler_runtime: --settings compiler.runtime=dynamic conan_compiler_libcxx: '' conan_package_manager: '' artifact_suffix: windows-x64 @@ -54,6 +55,7 @@ jobs: conan_arch: x86_64 conan_compiler: gcc conan_compiler_version: 11 + conan_compiler_cppstd: 20 conan_compiler_libcxx: --settings compiler.libcxx=libstdc++ conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True @@ -73,6 +75,7 @@ jobs: conan_arch: x86_64 conan_compiler: clang conan_compiler_version: 17 + conan_compiler_cppstd: 20 conan_compiler_libcxx: --settings compiler.libcxx=libstdc++11 conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True @@ -128,7 +131,7 @@ jobs: - name: Install Conan Packages shell: pwsh run: | - pip install "conan<2.0" + pip install conan conan profile new default --detect conan install ./source/ ` --remote conancenter ` @@ -137,6 +140,7 @@ jobs: --settings build_type=${{ matrix.build_type }} ` --settings compiler="${{ matrix.conan_compiler }}" ` --settings compiler.version=${{ matrix.conan_compiler_version }} ` + --settings compiler.cppstd=${{ matrix.conan_compiler_cppstd }} ` ${{ matrix.conan_compiler_libcxx }} ` ${{ matrix.conan_compiler_runtime }} ` ${{ matrix.conan_package_manager }} diff --git a/CMakeLists.txt b/CMakeLists.txt index f85ef287..29e7ae9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,25 +15,11 @@ enable_testing() set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) -include(${PROJECT_SOURCE_DIR}/external/cmake-conan/conan.cmake) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS conanfile.py) -conan_cmake_autodetect(settings - BUILD_TYPE ${conan_build_type}) - -conan_cmake_install(PATH_OR_REFERENCE ${PROJECT_SOURCE_DIR} - BUILD missing - REMOTE conancenter - SETTINGS ${settings}) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -include(${CMAKE_BINARY_DIR}/conan_paths.cmake) -conan_basic_setup(TARGETS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_ALL_NO_LIB") set(SCWX_DIR ${PROJECT_SOURCE_DIR}) diff --git a/conanfile.py b/conanfile.py index 888f09c7..fe90a124 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,4 +1,5 @@ -from conans import ConanFile +from conan import ConanFile +from conan.tools.files import copy class SupercellWxConan(ConanFile): settings = ("os", "compiler", "build_type", "arch") @@ -19,19 +20,18 @@ class SupercellWxConan(ConanFile): "sqlite3/3.46.1", "vulkan-loader/1.3.243.0", "zlib/1.3.1") - generators = ("cmake", - "cmake_find_package", - "cmake_paths") - default_options = {"geos:shared" : True, - "libiconv:shared" : True, - "openssl:no_module": True, - "openssl:shared" : True} + generators = ("CMakeDeps") + default_options = {"geos/*:shared" : True, + "libiconv/*:shared" : True, + "openssl/*:no_module": True, + "openssl/*:shared" : True} def requirements(self): if self.settings.os == "Linux": self.requires("onetbb/2021.12.0") - def imports(self): - self.copy("*.dll", dst="bin", src="bin") - self.copy("*.dylib", dst="bin", src="lib") - self.copy("license*", dst="licenses", src=".", folder=True, ignore_case=True) + def generate(self): + for dep in self.dependencies.values(): + if dep.cpp_info.libdirs: + copy(self, "*.dll", dep.cpp_info.libdirs[0], self.build_folder) + copy(self, "*.dylib", dep.cpp_info.libdirs[0], self.build_folder) diff --git a/external/cmake-conan b/external/cmake-conan index b240c809..c53fbf58 160000 --- a/external/cmake-conan +++ b/external/cmake-conan @@ -1 +1 @@ -Subproject commit b240c809b5ea097077fc8222cad71d2329288e48 +Subproject commit c53fbf58e4afe7cb93cb32e730d6647fc47a5dce diff --git a/setup-debug.bat b/setup-debug.bat index 14e4f870..1ff36fb2 100644 --- a/setup-debug.bat +++ b/setup-debug.bat @@ -9,5 +9,6 @@ mkdir %build_dir% cmake -B %build_dir% -S . ^ -DCMAKE_BUILD_TYPE=%build_type% ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ - -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% + -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake pause diff --git a/setup-debug.sh b/setup-debug.sh index 4f9e72ea..ceeff368 100755 --- a/setup-debug.sh +++ b/setup-debug.sh @@ -13,4 +13,5 @@ cmake -B ${build_dir} -S . \ -DCMAKE_CONFIGURATION_TYPES=${build_type} \ -DCMAKE_INSTALL_PREFIX=${build_dir}/${build_type}/supercell-wx \ -DCMAKE_PREFIX_PATH=/opt/Qt/${qt_version}/${qt_arch} \ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${script_dir}/external/cmake-conan/conan_provider.cmake \ -G Ninja diff --git a/setup-multi.bat b/setup-multi.bat new file mode 100644 index 00000000..778b1328 --- /dev/null +++ b/setup-multi.bat @@ -0,0 +1,11 @@ +call tools\setup-common.bat + +set build_dir=build-debug +set build_type=Debug +set qt_version=6.7.1 + +mkdir %build_dir% +cmake -B %build_dir% -S . ^ + -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/msvc2019_64 ^ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake +pause diff --git a/setup-release.bat b/setup-release.bat index cfcbd3c9..332acdfa 100644 --- a/setup-release.bat +++ b/setup-release.bat @@ -9,5 +9,6 @@ mkdir %build_dir% cmake -B %build_dir% -S . ^ -DCMAKE_BUILD_TYPE=%build_type% ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ - -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% + -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake pause diff --git a/setup-release.sh b/setup-release.sh index 63f52ef6..be0fe858 100755 --- a/setup-release.sh +++ b/setup-release.sh @@ -13,4 +13,5 @@ cmake -B ${build_dir} -S . \ -DCMAKE_CONFIGURATION_TYPES=${build_type} \ -DCMAKE_INSTALL_PREFIX=${build_dir}/${build_type}/supercell-wx \ -DCMAKE_PREFIX_PATH=/opt/Qt/${qt_version}/${qt_arch} \ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${script_dir}/external/cmake-conan/conan_provider.cmake \ -G Ninja diff --git a/tools/setup-common.bat b/tools/setup-common.bat index 8362be70..b3cbb147 100644 --- a/tools/setup-common.bat +++ b/tools/setup-common.bat @@ -1,4 +1,4 @@ -pip install --upgrade "conan<2.0" +pip install --upgrade conan pip install --upgrade geopandas pip install --upgrade GitPython conan profile new default --detect diff --git a/tools/setup-common.sh b/tools/setup-common.sh index d2c61d5a..58d29d1d 100755 --- a/tools/setup-common.sh +++ b/tools/setup-common.sh @@ -1,5 +1,5 @@ #!/bin/bash -pip install --upgrade --user "conan<2.0" +pip install --upgrade --user conan pip install --upgrade --user geopandas pip install --upgrade --user GitPython conan profile new default --detect From 84bbfe441341045ab836a10286b0e0be07207354 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 21 Dec 2023 18:07:05 -0600 Subject: [PATCH 04/31] Fixes for Conan 2.x on Linux --- tools/setup-common.bat | 2 +- tools/setup-common.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/setup-common.bat b/tools/setup-common.bat index b3cbb147..a5696f89 100644 --- a/tools/setup-common.bat +++ b/tools/setup-common.bat @@ -1,4 +1,4 @@ pip install --upgrade conan pip install --upgrade geopandas pip install --upgrade GitPython -conan profile new default --detect +conan profile detect diff --git a/tools/setup-common.sh b/tools/setup-common.sh index 58d29d1d..d00ebc0a 100755 --- a/tools/setup-common.sh +++ b/tools/setup-common.sh @@ -2,4 +2,4 @@ pip install --upgrade --user conan pip install --upgrade --user geopandas pip install --upgrade --user GitPython -conan profile new default --detect +conan profile detect From 07cac3a03f4b98dbcc26e82ddca7beae24b98523 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 22 Dec 2023 00:44:48 -0600 Subject: [PATCH 05/31] Additional project fixes for Conan 2.0 on Linux --- CMakeLists.txt | 4 ++++ conanfile.py | 10 ++++++++++ tools/scwx_config.cmake | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tools/scwx_config.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 29e7ae9e..f3e5d690 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) set(CMAKE_POLICY_DEFAULT_CMP0079 NEW) set(CMAKE_POLICY_DEFAULT_CMP0148 OLD) # aws-sdk-cpp uses FindPythonInterp +include(tools/scwx_config.cmake) + +scwx_output_dirs_setup() + enable_testing() set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) diff --git a/conanfile.py b/conanfile.py index fe90a124..842e93e0 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.tools.cmake import CMake from conan.tools.files import copy class SupercellWxConan(ConanFile): @@ -35,3 +36,12 @@ class SupercellWxConan(ConanFile): if dep.cpp_info.libdirs: copy(self, "*.dll", dep.cpp_info.libdirs[0], self.build_folder) copy(self, "*.dylib", dep.cpp_info.libdirs[0], self.build_folder) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() diff --git a/tools/scwx_config.cmake b/tools/scwx_config.cmake new file mode 100644 index 00000000..0919b22e --- /dev/null +++ b/tools/scwx_config.cmake @@ -0,0 +1,19 @@ +macro(scwx_output_dirs_setup) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug/bin) + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/lib) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug/lib) + + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/Release/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_CURRENT_BINARY_DIR}/MinSizeRel/lib) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/Debug/lib) +endmacro() From 6f70499105b0ef499ea604649aceb760986d1ecf Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 22 Dec 2023 13:53:27 -0600 Subject: [PATCH 06/31] Additional Conan 2.x, multi-config and CI updates --- .github/workflows/ci.yml | 9 +++++---- .gitignore | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 968adb52..3169d735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: shell: pwsh run: | pip install conan - conan profile new default --detect + conan profile detect conan install ./source/ ` --remote conancenter ` --build missing ` @@ -161,6 +161,7 @@ jobs: shell: bash run: | cd build/ + cd Release/ cd bin/ objcopy --only-keep-debug supercell-wx supercell-wx.debug objcopy --strip-debug --strip-unneeded supercell-wx @@ -205,7 +206,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: supercell-wx-debug-${{ matrix.artifact_suffix }} - path: ${{ github.workspace }}/build/bin/*.pdb + path: ${{ github.workspace }}/build/Release/bin/*.pdb - name: Upload Artifacts (Linux) if: ${{ startsWith(matrix.os, 'ubuntu') }} @@ -220,8 +221,8 @@ jobs: with: name: supercell-wx-debug-${{ matrix.artifact_suffix }} path: | - ${{ github.workspace }}/build/bin/*.debug - ${{ github.workspace }}/build/lib/*.debug + ${{ github.workspace }}/build/Release/bin/*.debug + ${{ github.workspace }}/build/Release/lib/*.debug - name: Build Installer (Windows) if: matrix.os == 'windows-2022' diff --git a/.gitignore b/.gitignore index 9e6da487..7002668a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ CMakeLists.txt.user CMakeCache.txt CMakeFiles CMakeScripts +CMakeUserPresets.json Testing cmake_install.cmake install_manifest.txt From 5d91bbf32f510e9866a0c4fc6d4c926a5e53943f Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 13 Jun 2024 22:13:36 -0500 Subject: [PATCH 07/31] Update cmake-conan to latest develop2 (8036ecf) --- external/cmake-conan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/cmake-conan b/external/cmake-conan index c53fbf58..8036ecfd 160000 --- a/external/cmake-conan +++ b/external/cmake-conan @@ -1 +1 @@ -Subproject commit c53fbf58e4afe7cb93cb32e730d6647fc47a5dce +Subproject commit 8036ecfdcf8a8d28d19b60e83bc40ed1d1e06d1f From 3ec58659f53641d28452076fc3ec2656f69d9b3f Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 14 Jun 2024 00:43:09 -0500 Subject: [PATCH 08/31] Require libpng explicitly --- conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conanfile.py b/conanfile.py index 842e93e0..2becff15 100644 --- a/conanfile.py +++ b/conanfile.py @@ -14,6 +14,7 @@ class SupercellWxConan(ConanFile): "glm/cci.20230113", "gtest/1.15.0", "libcurl/8.10.1", + "libpng/1.6.44", "libxml2/2.12.7", "openssl/3.3.2", "re2/20240702", From 5fb27151b3d9f70a18031e757ff040662385420f Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 14 Jun 2024 01:22:29 -0500 Subject: [PATCH 09/31] DLLs should be copied from bindirs, not libdirs --- conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 2becff15..3e5719c0 100644 --- a/conanfile.py +++ b/conanfile.py @@ -34,8 +34,9 @@ class SupercellWxConan(ConanFile): def generate(self): for dep in self.dependencies.values(): + if dep.cpp_info.bindirs: + copy(self, "*.dll", dep.cpp_info.bindirs[0], self.build_folder) if dep.cpp_info.libdirs: - copy(self, "*.dll", dep.cpp_info.libdirs[0], self.build_folder) copy(self, "*.dylib", dep.cpp_info.libdirs[0], self.build_folder) def build(self): From ff60b3c891f4ebb5fc0a87e6d49068e0cc98867d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 14 Jun 2024 19:10:18 -0500 Subject: [PATCH 10/31] MSVC compiler version for Visual Studio 2022 17.10 should be 194 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3169d735..87b73c08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: qt_tools: '' conan_arch: x86_64 conan_compiler: msvc - conan_compiler_version: 193 + conan_compiler_version: 194 conan_compiler_cppstd: 20 conan_compiler_runtime: --settings compiler.runtime=dynamic conan_compiler_libcxx: '' From 41f8434d35458d3abc79eedeed40f8f022fb7d6e Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 15 Jun 2024 01:11:56 -0500 Subject: [PATCH 11/31] Add CMake top level includes to CI build --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87b73c08..6a4bb39e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,7 @@ jobs: cmake ../source/ ` -G Ninja ` -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" ` + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="${{ github.workspace }}/source/external/cmake-conan/conan_provider.cmake" ` -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" ninja supercell-wx wxtest From b7d4cdd51c4e7b37b6bc99f88e6557277ba77b79 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 28 Nov 2024 08:22:23 -0600 Subject: [PATCH 12/31] Updating cmake-conan to latest develop2 (c22bbf0) --- external/cmake-conan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/cmake-conan b/external/cmake-conan index 8036ecfd..c22bbf0a 160000 --- a/external/cmake-conan +++ b/external/cmake-conan @@ -1 +1 @@ -Subproject commit 8036ecfdcf8a8d28d19b60e83bc40ed1d1e06d1f +Subproject commit c22bbf0af0b73d5f0def24a9cdf4ce503ae79e5d From df1fc2fe543f6b810c4dc107902e701c2f4d8398 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 28 Nov 2024 09:10:03 -0600 Subject: [PATCH 13/31] freetype dependency needs overridden due to fontconfig import --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 3e5719c0..d8dcb583 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,7 +7,6 @@ class SupercellWxConan(ConanFile): requires = ("boost/1.86.0", "cpr/1.11.0", "fontconfig/2.15.0", - "freetype/2.13.3", "geographiclib/2.4", "geos/3.13.0", "glew/2.2.0", @@ -29,6 +28,7 @@ class SupercellWxConan(ConanFile): "openssl/*:shared" : True} def requirements(self): + self.requires("freetype/2.13.3", override=True) if self.settings.os == "Linux": self.requires("onetbb/2021.12.0") From d726da5d73cab433550ed8362a7248cf2f7b1082 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 09:17:04 -0600 Subject: [PATCH 14/31] Use conan profiles in CI --- .github/workflows/ci.yml | 20 +++++++++++--------- tools/conan/profiles/scwx-linux_clang-17 | 8 ++++++++ tools/conan/profiles/scwx-linux_gcc-11 | 8 ++++++++ tools/conan/profiles/scwx-linux_gcc-12 | 8 ++++++++ tools/conan/profiles/scwx-linux_gcc-13 | 8 ++++++++ tools/conan/profiles/scwx-linux_gcc-14 | 8 ++++++++ tools/conan/profiles/scwx-win64_msvc2022 | 8 ++++++++ 7 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 tools/conan/profiles/scwx-linux_clang-17 create mode 100644 tools/conan/profiles/scwx-linux_gcc-11 create mode 100644 tools/conan/profiles/scwx-linux_gcc-12 create mode 100644 tools/conan/profiles/scwx-linux_gcc-13 create mode 100644 tools/conan/profiles/scwx-linux_gcc-14 create mode 100644 tools/conan/profiles/scwx-win64_msvc2022 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a4bb39e..846d76da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: conan_compiler_runtime: --settings compiler.runtime=dynamic conan_compiler_libcxx: '' conan_package_manager: '' + conan_profile: scwx-win64_msvc2022 artifact_suffix: windows-x64 - name: linux64_gcc os: ubuntu-22.04 @@ -59,6 +60,7 @@ jobs: conan_compiler_libcxx: --settings compiler.libcxx=libstdc++ conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True + conan_profile: scwx-linux_gcc-11 artifact_suffix: linux-x64 compiler_packages: '' - name: linux64_clang @@ -79,6 +81,7 @@ jobs: conan_compiler_libcxx: --settings compiler.libcxx=libstdc++11 conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True + conan_profile: scwx-linux_clang-17 artifact_suffix: linux-clang-x64 compiler_packages: clang-17 name: ${{ matrix.name }} @@ -132,17 +135,14 @@ jobs: shell: pwsh run: | pip install conan - conan profile detect + conan profile detect -e + conan config install ` + ./source/tools/conan/profiles/${{ matrix.conan_profile }} ` + -tf profiles conan install ./source/ ` --remote conancenter ` --build missing ` - --settings arch=${{ matrix.conan_arch }} ` - --settings build_type=${{ matrix.build_type }} ` - --settings compiler="${{ matrix.conan_compiler }}" ` - --settings compiler.version=${{ matrix.conan_compiler_version }} ` - --settings compiler.cppstd=${{ matrix.conan_compiler_cppstd }} ` - ${{ matrix.conan_compiler_libcxx }} ` - ${{ matrix.conan_compiler_runtime }} ` + --profile:all ${{ matrix.conan_profile }} ${{ matrix.conan_package_manager }} - name: Build Supercell Wx @@ -154,7 +154,9 @@ jobs: -G Ninja ` -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" ` -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="${{ github.workspace }}/source/external/cmake-conan/conan_provider.cmake" ` - -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" ` + -DCONAN_HOST_PROFILE="${{ matrix.conan_profile }}" ` + -DCONAN_BUILD_PROFILE="${{ matrix.conan_profile }}" ninja supercell-wx wxtest - name: Separate Debug Symbols (Linux) diff --git a/tools/conan/profiles/scwx-linux_clang-17 b/tools/conan/profiles/scwx-linux_clang-17 new file mode 100644 index 00000000..1ee9f30a --- /dev/null +++ b/tools/conan/profiles/scwx-linux_clang-17 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=clang +compiler.cppstd=20 +compiler.libcxx=libstdc++11 +compiler.version=17 +os=Linux \ No newline at end of file diff --git a/tools/conan/profiles/scwx-linux_gcc-11 b/tools/conan/profiles/scwx-linux_gcc-11 new file mode 100644 index 00000000..cc41b528 --- /dev/null +++ b/tools/conan/profiles/scwx-linux_gcc-11 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=gcc +compiler.cppstd=20 +compiler.libcxx=libstdc++11 +compiler.version=11 +os=Linux \ No newline at end of file diff --git a/tools/conan/profiles/scwx-linux_gcc-12 b/tools/conan/profiles/scwx-linux_gcc-12 new file mode 100644 index 00000000..a7db9371 --- /dev/null +++ b/tools/conan/profiles/scwx-linux_gcc-12 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=gcc +compiler.cppstd=20 +compiler.libcxx=libstdc++11 +compiler.version=12 +os=Linux \ No newline at end of file diff --git a/tools/conan/profiles/scwx-linux_gcc-13 b/tools/conan/profiles/scwx-linux_gcc-13 new file mode 100644 index 00000000..ef3ef064 --- /dev/null +++ b/tools/conan/profiles/scwx-linux_gcc-13 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=gcc +compiler.cppstd=20 +compiler.libcxx=libstdc++11 +compiler.version=13 +os=Linux \ No newline at end of file diff --git a/tools/conan/profiles/scwx-linux_gcc-14 b/tools/conan/profiles/scwx-linux_gcc-14 new file mode 100644 index 00000000..94220e3e --- /dev/null +++ b/tools/conan/profiles/scwx-linux_gcc-14 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=gcc +compiler.cppstd=20 +compiler.libcxx=libstdc++11 +compiler.version=14 +os=Linux \ No newline at end of file diff --git a/tools/conan/profiles/scwx-win64_msvc2022 b/tools/conan/profiles/scwx-win64_msvc2022 new file mode 100644 index 00000000..0c4513d8 --- /dev/null +++ b/tools/conan/profiles/scwx-win64_msvc2022 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=msvc +compiler.cppstd=20 +compiler.runtime=dynamic +compiler.version=194 +os=Windows \ No newline at end of file From 01f790020e7967294f6e16789545182eb8093ae5 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 12:11:52 -0600 Subject: [PATCH 15/31] Configure OpenSSL crypto library for aws-sdk-cpp --- external/aws-sdk-cpp.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/external/aws-sdk-cpp.cmake b/external/aws-sdk-cpp.cmake index 3952f0f8..9be0c88c 100644 --- a/external/aws-sdk-cpp.cmake +++ b/external/aws-sdk-cpp.cmake @@ -21,6 +21,14 @@ set(MINIMIZE_SIZE OFF CACHE BOOL "If enabled, the SDK will be built via # Save off ${CMAKE_CXX_FLAGS} before modifying compiler settings set(CMAKE_CXX_FLAGS_PREV "${CMAKE_CXX_FLAGS}") +# Configure OpenSSL crypto library +find_package(OpenSSL) +set(crypto_INCLUDE_DIR ${OpenSSL_INCLUDE_DIR}) +set(crypto_ROOT $<$:${openssl_PACKAGE_FOLDER_RELEASE}> + $<$:${openssl_PACKAGE_FOLDER_DEBUG}>) +set(crypto_SHARED_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.so libcrypto.dylib +set(crypto_STATIC_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.a + # Fix CMake errors for internal variables not set include(aws-sdk-cpp/cmake/compiler_settings.cmake) set_msvc_warnings() From e61ac8814de3a693e4f85ed5232026d8aacba166 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 12:12:48 -0600 Subject: [PATCH 16/31] CI conan install fixes --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 846d76da..b2b5537e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,16 +139,18 @@ jobs: conan config install ` ./source/tools/conan/profiles/${{ matrix.conan_profile }} ` -tf profiles - conan install ./source/ ` + mkdir -p build + cd build + conan install ../source/ ` --remote conancenter ` --build missing ` - --profile:all ${{ matrix.conan_profile }} + --profile:all ${{ matrix.conan_profile }} ` ${{ matrix.conan_package_manager }} - name: Build Supercell Wx shell: pwsh run: | - mkdir build + mkdir -p build cd build cmake ../source/ ` -G Ninja ` From eb47443bbac45d6ad98bf1894f894b7bb4c63e0a Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 20:17:59 -0600 Subject: [PATCH 17/31] Don't use a generator expression to determine ${crypto_ROOT} for AWS SDK --- external/aws-sdk-cpp.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/external/aws-sdk-cpp.cmake b/external/aws-sdk-cpp.cmake index 9be0c88c..e8332c4a 100644 --- a/external/aws-sdk-cpp.cmake +++ b/external/aws-sdk-cpp.cmake @@ -24,8 +24,16 @@ set(CMAKE_CXX_FLAGS_PREV "${CMAKE_CXX_FLAGS}") # Configure OpenSSL crypto library find_package(OpenSSL) set(crypto_INCLUDE_DIR ${OpenSSL_INCLUDE_DIR}) -set(crypto_ROOT $<$:${openssl_PACKAGE_FOLDER_RELEASE}> - $<$:${openssl_PACKAGE_FOLDER_DEBUG}>) + +# FIXME: +# Cannot use a generator expression here, since this is needed at config time. +# But, this breaks multi-config. Need to find a better solution. +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(crypto_ROOT ${openssl_PACKAGE_FOLDER_DEBUG}) +else() + set(crypto_ROOT ${openssl_PACKAGE_FOLDER_RELEASE}) +endif() + set(crypto_SHARED_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.so libcrypto.dylib set(crypto_STATIC_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.a From 88807a05a17103ad303e007e4261587c82eeca69 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 20:18:45 -0600 Subject: [PATCH 18/31] freetype needs specified in main requires section, otherwise includes are missing --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index d8dcb583..24cbeb13 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,6 +7,7 @@ class SupercellWxConan(ConanFile): requires = ("boost/1.86.0", "cpr/1.11.0", "fontconfig/2.15.0", + "freetype/2.13.2", "geographiclib/2.4", "geos/3.13.0", "glew/2.2.0", @@ -28,7 +29,6 @@ class SupercellWxConan(ConanFile): "openssl/*:shared" : True} def requirements(self): - self.requires("freetype/2.13.3", override=True) if self.settings.os == "Linux": self.requires("onetbb/2021.12.0") From c74a56206c2cf45a1fe9ab4022776c14ca8f6a7a Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 21:06:53 -0600 Subject: [PATCH 19/31] Add conan profiles to setup scripts --- setup-debug.bat | 7 ++++++- setup-debug.sh | 5 +++++ setup-release.bat | 7 ++++++- setup-release.sh | 5 +++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/setup-debug.bat b/setup-debug.bat index 1ff36fb2..74100c83 100644 --- a/setup-debug.bat +++ b/setup-debug.bat @@ -2,13 +2,18 @@ call tools\setup-common.bat set build_dir=build-debug set build_type=Debug +set conan_profile=scwx-win64_msvc2022 set qt_version=6.8.0 set qt_arch=msvc2022_64 +conan install tools/conan/profiles/%conan_profile% -tf profiles + mkdir %build_dir% cmake -B %build_dir% -S . ^ -DCMAKE_BUILD_TYPE=%build_type% ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ - -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake ^ + -DCONAN_HOST_PROFILE=${conan_profile} ^ + -DCONAN_BUILD_PROFILE=${conan_profile} pause diff --git a/setup-debug.sh b/setup-debug.sh index ceeff368..b832db88 100755 --- a/setup-debug.sh +++ b/setup-debug.sh @@ -3,10 +3,13 @@ build_dir=${1:-build-debug} build_type=Debug +conan_profile=${2:-scwx-linux_gcc-11} qt_version=6.8.0 qt_arch=gcc_64 script_dir="$(dirname "$(readlink -f "$0")")" +conan install tools/conan/profiles/${conan_profile} -tf profiles + mkdir -p ${build_dir} cmake -B ${build_dir} -S . \ -DCMAKE_BUILD_TYPE=${build_type} \ @@ -14,4 +17,6 @@ cmake -B ${build_dir} -S . \ -DCMAKE_INSTALL_PREFIX=${build_dir}/${build_type}/supercell-wx \ -DCMAKE_PREFIX_PATH=/opt/Qt/${qt_version}/${qt_arch} \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${script_dir}/external/cmake-conan/conan_provider.cmake \ + -DCONAN_HOST_PROFILE=${conan_profile} \ + -DCONAN_BUILD_PROFILE=${conan_profile} \ -G Ninja diff --git a/setup-release.bat b/setup-release.bat index 332acdfa..c897302e 100644 --- a/setup-release.bat +++ b/setup-release.bat @@ -2,13 +2,18 @@ call tools\setup-common.bat set build_dir=build-release set build_type=Release +set conan_profile=scwx-win64_msvc2022 set qt_version=6.8.0 set qt_arch=msvc2022_64 +conan install tools/conan/profiles/%conan_profile% -tf profiles + mkdir %build_dir% cmake -B %build_dir% -S . ^ -DCMAKE_BUILD_TYPE=%build_type% ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ - -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake ^ + -DCONAN_HOST_PROFILE=${conan_profile} ^ + -DCONAN_BUILD_PROFILE=${conan_profile} pause diff --git a/setup-release.sh b/setup-release.sh index be0fe858..75b05f66 100755 --- a/setup-release.sh +++ b/setup-release.sh @@ -3,10 +3,13 @@ build_dir=${1:-build-release} build_type=Release +conan_profile=${2:-scwx-linux_gcc-11} qt_version=6.8.0 qt_arch=gcc_64 script_dir="$(dirname "$(readlink -f "$0")")" +conan install tools/conan/profiles/${conan_profile} -tf profiles + mkdir -p ${build_dir} cmake -B ${build_dir} -S . \ -DCMAKE_BUILD_TYPE=${build_type} \ @@ -14,4 +17,6 @@ cmake -B ${build_dir} -S . \ -DCMAKE_INSTALL_PREFIX=${build_dir}/${build_type}/supercell-wx \ -DCMAKE_PREFIX_PATH=/opt/Qt/${qt_version}/${qt_arch} \ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${script_dir}/external/cmake-conan/conan_provider.cmake \ + -DCONAN_HOST_PROFILE=${conan_profile} \ + -DCONAN_BUILD_PROFILE=${conan_profile} \ -G Ninja From 6b3149fbceb1758dee312fcccd70de1532e8b63d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 21:08:05 -0600 Subject: [PATCH 20/31] Fix mkdir usage and output directory in ci.yml --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2b5537e..fc3de9c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,18 +139,19 @@ jobs: conan config install ` ./source/tools/conan/profiles/${{ matrix.conan_profile }} ` -tf profiles - mkdir -p build + mkdir build cd build + mkdir conan conan install ../source/ ` --remote conancenter ` --build missing ` --profile:all ${{ matrix.conan_profile }} ` + --output-folder ./conan/ ` ${{ matrix.conan_package_manager }} - name: Build Supercell Wx shell: pwsh run: | - mkdir -p build cd build cmake ../source/ ` -G Ninja ` From 036acf3c85e89a3b1d6543deef6937c386613e7a Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 21:46:15 -0600 Subject: [PATCH 21/31] Update aws-sdk-cpp to 1.11.457 --- external/aws-sdk-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/aws-sdk-cpp b/external/aws-sdk-cpp index d5eb42fe..c95e71a9 160000 --- a/external/aws-sdk-cpp +++ b/external/aws-sdk-cpp @@ -1 +1 @@ -Subproject commit d5eb42fe7c632868d4535b454ee2e5ba0e349b7f +Subproject commit c95e71a9d23bba0c2f6c6a7bc37ae63b7351e8b7 From 27b2d79a65ca90eb1cae4ad1efccc78db83dcf93 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 22:00:00 -0600 Subject: [PATCH 22/31] Collect artifacts for CI debug --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc3de9c5..bc83f451 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,3 +288,20 @@ jobs: with: name: supercell-wx-test-logs-${{ matrix.name }} path: ${{ github.workspace }}/build/Testing/ + + - name: CI Build Directory Listing + if: ${{ !cancelled() && startsWith(matrix.os, 'ubuntu') }} + shell: bash + run: | + ls -alRF ./build/ + + - name: Upload CI Build Debug + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: supercell-wx-ci-debug-logs-${{ matrix.name }} + path: | + ${{ github.workspace }}/build/.ninja_log + ${{ github.workspace }}/build/build.ninja + ${{ github.workspace }}/build/CMakeCache.txt + ${{ github.workspace }}/build/compile_commands.json From 6e13ed2c85b0aedb527cb1e3d585127415b47373 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Fri, 29 Nov 2024 22:57:33 -0600 Subject: [PATCH 23/31] Specify to AWS SDK which crypto library to use --- external/aws-sdk-cpp.cmake | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/external/aws-sdk-cpp.cmake b/external/aws-sdk-cpp.cmake index e8332c4a..f88df9ca 100644 --- a/external/aws-sdk-cpp.cmake +++ b/external/aws-sdk-cpp.cmake @@ -23,19 +23,7 @@ set(CMAKE_CXX_FLAGS_PREV "${CMAKE_CXX_FLAGS}") # Configure OpenSSL crypto library find_package(OpenSSL) -set(crypto_INCLUDE_DIR ${OpenSSL_INCLUDE_DIR}) - -# FIXME: -# Cannot use a generator expression here, since this is needed at config time. -# But, this breaks multi-config. Need to find a better solution. -if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") - set(crypto_ROOT ${openssl_PACKAGE_FOLDER_DEBUG}) -else() - set(crypto_ROOT ${openssl_PACKAGE_FOLDER_RELEASE}) -endif() - -set(crypto_SHARED_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.so libcrypto.dylib -set(crypto_STATIC_LIBRARY_ROOT ${crypto_ROOT}) # libcrypto.a +add_library(crypto ALIAS OpenSSL::Crypto) # Fix CMake errors for internal variables not set include(aws-sdk-cpp/cmake/compiler_settings.cmake) From d6a0a17d3fdbb54d56aa7c8a426789c8c5a5a618 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 01:27:57 -0600 Subject: [PATCH 24/31] Setup script fixes --- setup-debug.bat | 12 +++++++++--- setup-debug.sh | 8 +++++++- setup-multi.bat | 20 +++++++++++++++----- setup-release.bat | 12 +++++++++--- setup-release.sh | 8 +++++++- tools/setup-common.bat | 2 +- tools/setup-common.sh | 2 +- 7 files changed, 49 insertions(+), 15 deletions(-) diff --git a/setup-debug.bat b/setup-debug.bat index 74100c83..f082a0cc 100644 --- a/setup-debug.bat +++ b/setup-debug.bat @@ -6,7 +6,13 @@ set conan_profile=scwx-win64_msvc2022 set qt_version=6.8.0 set qt_arch=msvc2022_64 -conan install tools/conan/profiles/%conan_profile% -tf profiles +conan config install tools/conan/profiles/%conan_profile% -tf profiles +conan install . ^ + --remote conancenter ^ + --build missing ^ + --profile:all %conan_profile% ^ + --settings:all build_type=%build_type% ^ + --output-folder %build_dir%/conan mkdir %build_dir% cmake -B %build_dir% -S . ^ @@ -14,6 +20,6 @@ cmake -B %build_dir% -S . ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake ^ - -DCONAN_HOST_PROFILE=${conan_profile} ^ - -DCONAN_BUILD_PROFILE=${conan_profile} + -DCONAN_HOST_PROFILE=%conan_profile% ^ + -DCONAN_BUILD_PROFILE=%conan_profile% pause diff --git a/setup-debug.sh b/setup-debug.sh index b832db88..0abb4696 100755 --- a/setup-debug.sh +++ b/setup-debug.sh @@ -8,7 +8,13 @@ qt_version=6.8.0 qt_arch=gcc_64 script_dir="$(dirname "$(readlink -f "$0")")" -conan install tools/conan/profiles/${conan_profile} -tf profiles +conan config install tools/conan/profiles/${conan_profile} -tf profiles +conan install . \ + --remote conancenter \ + --build missing \ + --profile:all ${conan_profile} \ + --settings:all build_type=${build_type} \ + --output-folder ${build_dir}/conan mkdir -p ${build_dir} cmake -B ${build_dir} -S . \ diff --git a/setup-multi.bat b/setup-multi.bat index 778b1328..9c555594 100644 --- a/setup-multi.bat +++ b/setup-multi.bat @@ -1,11 +1,21 @@ call tools\setup-common.bat -set build_dir=build-debug -set build_type=Debug -set qt_version=6.7.1 +set build_dir=build +set conan_profile=scwx-win64_msvc2022 +set qt_version=6.8.0 +set qt_arch=msvc2022_64 + +conan config install tools/conan/profiles/%conan_profile% -tf profiles +conan install . ^ + --remote conancenter ^ + --build missing ^ + --profile:all %conan_profile% ^ + --output-folder %build_dir%/conan mkdir %build_dir% cmake -B %build_dir% -S . ^ - -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/msvc2019_64 ^ - -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake + -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake ^ + -DCONAN_HOST_PROFILE=%conan_profile% ^ + -DCONAN_BUILD_PROFILE=%conan_profile% pause diff --git a/setup-release.bat b/setup-release.bat index c897302e..404ebdcd 100644 --- a/setup-release.bat +++ b/setup-release.bat @@ -6,7 +6,13 @@ set conan_profile=scwx-win64_msvc2022 set qt_version=6.8.0 set qt_arch=msvc2022_64 -conan install tools/conan/profiles/%conan_profile% -tf profiles +conan config install tools/conan/profiles/%conan_profile% -tf profiles +conan install . ^ + --remote conancenter ^ + --build missing ^ + --profile:all %conan_profile% ^ + --settings:all build_type=%build_type% ^ + --output-folder %build_dir%/conan mkdir %build_dir% cmake -B %build_dir% -S . ^ @@ -14,6 +20,6 @@ cmake -B %build_dir% -S . ^ -DCMAKE_CONFIGURATION_TYPES=%build_type% ^ -DCMAKE_PREFIX_PATH=C:/Qt/%qt_version%/%qt_arch% ^ -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=external/cmake-conan/conan_provider.cmake ^ - -DCONAN_HOST_PROFILE=${conan_profile} ^ - -DCONAN_BUILD_PROFILE=${conan_profile} + -DCONAN_HOST_PROFILE=%conan_profile% ^ + -DCONAN_BUILD_PROFILE=%conan_profile% pause diff --git a/setup-release.sh b/setup-release.sh index 75b05f66..9b4f2779 100755 --- a/setup-release.sh +++ b/setup-release.sh @@ -8,7 +8,13 @@ qt_version=6.8.0 qt_arch=gcc_64 script_dir="$(dirname "$(readlink -f "$0")")" -conan install tools/conan/profiles/${conan_profile} -tf profiles +conan config install tools/conan/profiles/${conan_profile} -tf profiles +conan install . \ + --remote conancenter \ + --build missing \ + --profile:all ${conan_profile} \ + --settings:all build_type=${build_type} \ + --output-folder ${build_dir}/conan mkdir -p ${build_dir} cmake -B ${build_dir} -S . \ diff --git a/tools/setup-common.bat b/tools/setup-common.bat index a5696f89..bada34ed 100644 --- a/tools/setup-common.bat +++ b/tools/setup-common.bat @@ -1,4 +1,4 @@ pip install --upgrade conan pip install --upgrade geopandas pip install --upgrade GitPython -conan profile detect +conan profile detect -e diff --git a/tools/setup-common.sh b/tools/setup-common.sh index d00ebc0a..2533d6ec 100755 --- a/tools/setup-common.sh +++ b/tools/setup-common.sh @@ -2,4 +2,4 @@ pip install --upgrade --user conan pip install --upgrade --user geopandas pip install --upgrade --user GitPython -conan profile detect +conan profile detect -e From d45801bd505b30e18b3d0086984b3c57980c5bf2 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 01:29:28 -0600 Subject: [PATCH 25/31] Revert test artifacts from CI build --- .github/workflows/ci.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc83f451..fc3de9c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -288,20 +288,3 @@ jobs: with: name: supercell-wx-test-logs-${{ matrix.name }} path: ${{ github.workspace }}/build/Testing/ - - - name: CI Build Directory Listing - if: ${{ !cancelled() && startsWith(matrix.os, 'ubuntu') }} - shell: bash - run: | - ls -alRF ./build/ - - - name: Upload CI Build Debug - if: ${{ !cancelled() }} - uses: actions/upload-artifact@v4 - with: - name: supercell-wx-ci-debug-logs-${{ matrix.name }} - path: | - ${{ github.workspace }}/build/.ninja_log - ${{ github.workspace }}/build/build.ninja - ${{ github.workspace }}/build/CMakeCache.txt - ${{ github.workspace }}/build/compile_commands.json From f1e9296299e7f09185d0e4ce78ebb47326f5c077 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 01:32:11 -0600 Subject: [PATCH 26/31] Remove unused conan CI matrix variables, now defined in profile --- .github/workflows/ci.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc3de9c5..060be896 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,12 +33,6 @@ jobs: qt_arch_dir: msvc2022_64 qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_tools: '' - conan_arch: x86_64 - conan_compiler: msvc - conan_compiler_version: 194 - conan_compiler_cppstd: 20 - conan_compiler_runtime: --settings compiler.runtime=dynamic - conan_compiler_libcxx: '' conan_package_manager: '' conan_profile: scwx-win64_msvc2022 artifact_suffix: windows-x64 @@ -53,12 +47,6 @@ jobs: qt_arch_dir: gcc_64 qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_tools: '' - conan_arch: x86_64 - conan_compiler: gcc - conan_compiler_version: 11 - conan_compiler_cppstd: 20 - conan_compiler_libcxx: --settings compiler.libcxx=libstdc++ - conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True conan_profile: scwx-linux_gcc-11 artifact_suffix: linux-x64 @@ -74,12 +62,6 @@ jobs: qt_arch_dir: gcc_64 qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_tools: '' - conan_arch: x86_64 - conan_compiler: clang - conan_compiler_version: 17 - conan_compiler_cppstd: 20 - conan_compiler_libcxx: --settings compiler.libcxx=libstdc++11 - conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True conan_profile: scwx-linux_clang-17 artifact_suffix: linux-clang-x64 From 0f9b595ce79b13f39d9636b94fa494f5ec8c2ac1 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 01:37:42 -0600 Subject: [PATCH 27/31] Override build type in CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3340670e..90c31612 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,6 +128,7 @@ jobs: --remote conancenter ` --build missing ` --profile:all ${{ matrix.conan_profile }} ` + --settings:all build_type=${{ matrix.build_type }} ` --output-folder ./conan/ ` ${{ matrix.conan_package_manager }} From f12f209a0d5d25e2956a1c3208a00f7a498ec86f Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 01:38:33 -0600 Subject: [PATCH 28/31] Update clang-tidy-review for conan 2 --- .github/workflows/clang-tidy-review.yml | 29 +++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 0182e383..1f26bd58 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -24,12 +24,8 @@ jobs: qt_arch_aqt: linux_gcc_64 qt_modules: qtimageformats qtmultimedia qtpositioning qtserialport qt_tools: '' - conan_arch: x86_64 - conan_compiler: clang - conan_compiler_version: 17 - conan_compiler_libcxx: --settings compiler.libcxx=libstdc++11 - conan_compiler_runtime: '' conan_package_manager: --conf tools.system.package_manager:mode=install --conf tools.system.package_manager:sudo=True + conan_profile: scwx-linux_clang-17 compiler_packages: clang-17 clang-tidy-17 name: ${{ matrix.name }} runs-on: ${{ matrix.os }} @@ -78,28 +74,33 @@ jobs: - name: Install Conan Packages shell: pwsh run: | - pip install "conan<2.0" - conan profile new default --detect + pip install conan + conan profile detect -e + conan config install ` + ./source/tools/conan/profiles/${{ matrix.conan_profile }} ` + -tf profiles + mkdir build + cd build + mkdir conan conan install ./source/ ` --remote conancenter ` --build missing ` - --settings arch=${{ matrix.conan_arch }} ` - --settings build_type=${{ matrix.build_type }} ` - --settings compiler="${{ matrix.conan_compiler }}" ` - --settings compiler.version=${{ matrix.conan_compiler_version }} ` - ${{ matrix.conan_compiler_libcxx }} ` - ${{ matrix.conan_compiler_runtime }} ` + --profile:all ${{ matrix.conan_profile }} ` + --settings:all build_type=${{ matrix.build_type }} ` + --output-folder ./conan/ ` ${{ matrix.conan_package_manager }} - name: Autogenerate shell: pwsh run: | - mkdir build cd build cmake ../source/ ` -G Ninja ` -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" ` + -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="${{ github.workspace }}/source/external/cmake-conan/conan_provider.cmake" ` -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/supercell-wx" ` + -DCONAN_HOST_PROFILE="${{ matrix.conan_profile }}" ` + -DCONAN_BUILD_PROFILE="${{ matrix.conan_profile }}" ` -DCMAKE_EXPORT_COMPILE_COMMANDS=on ninja scwx-qt_generate_counties_db ` scwx-qt_generate_versions ` From 9e7075c7e5f0c58d5b28d4eeeec915e038e591e9 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 09:20:32 -0600 Subject: [PATCH 29/31] Fix build folder for dependency deployment --- conanfile.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 24cbeb13..12a0d058 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,6 +1,7 @@ from conan import ConanFile from conan.tools.cmake import CMake from conan.tools.files import copy +import os class SupercellWxConan(ConanFile): settings = ("os", "compiler", "build_type", "arch") @@ -33,11 +34,16 @@ class SupercellWxConan(ConanFile): self.requires("onetbb/2021.12.0") def generate(self): + build_folder = os.path.join(self.build_folder, + "..", + str(self.settings.build_type), + self.cpp_info.bindirs[0]) + for dep in self.dependencies.values(): if dep.cpp_info.bindirs: - copy(self, "*.dll", dep.cpp_info.bindirs[0], self.build_folder) + copy(self, "*.dll", dep.cpp_info.bindirs[0], build_folder) if dep.cpp_info.libdirs: - copy(self, "*.dylib", dep.cpp_info.libdirs[0], self.build_folder) + copy(self, "*.dylib", dep.cpp_info.libdirs[0], build_folder) def build(self): cmake = CMake(self) From 61a93dbc305fa46378b3da7e40539297a1a0a7a9 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 09:40:07 -0600 Subject: [PATCH 30/31] setup-multi.bat should install Debug and Release conan dependencies --- setup-multi.bat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup-multi.bat b/setup-multi.bat index 9c555594..b12a0c06 100644 --- a/setup-multi.bat +++ b/setup-multi.bat @@ -10,6 +10,13 @@ conan install . ^ --remote conancenter ^ --build missing ^ --profile:all %conan_profile% ^ + --settings:all build_type=Debug ^ + --output-folder %build_dir%/conan +conan install . ^ + --remote conancenter ^ + --build missing ^ + --profile:all %conan_profile% ^ + --settings:all build_type=Release ^ --output-folder %build_dir%/conan mkdir %build_dir% From 82cec1d7441c3c31766bd2f1a8d912187f318ff9 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sat, 30 Nov 2024 09:40:42 -0600 Subject: [PATCH 31/31] Fix clang-tidy-review conan install source directory --- .github/workflows/clang-tidy-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml index 1f26bd58..e2a1d57d 100644 --- a/.github/workflows/clang-tidy-review.yml +++ b/.github/workflows/clang-tidy-review.yml @@ -82,7 +82,7 @@ jobs: mkdir build cd build mkdir conan - conan install ./source/ ` + conan install ../source/ ` --remote conancenter ` --build missing ` --profile:all ${{ matrix.conan_profile }} `