From 692ac21982053007fda4ea9511e7c9038889783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Omn=C3=A8s?= <26088210+flomnes@users.noreply.github.com> Date: Tue, 16 Jan 2024 17:14:33 +0100 Subject: [PATCH] cherry pick 3 --- .github/workflows/centos7-system-deps-build.yml | 2 +- .github/workflows/centos7.yml | 2 +- .github/workflows/oracle8.yml | 3 +-- .github/workflows/sonarcloud.yml | 2 +- .github/workflows/ubuntu-system-deps-build.yml | 2 +- .github/workflows/ubuntu.yml | 4 ++-- .github/workflows/windows-release.yml | 2 +- .github/workflows/windows-vcpkg.yml | 6 +++--- src/CMakeLists.txt | 12 ++++++------ src/cmake/common-settings.cmake | 14 ++++---------- src/cmake/utils.cmake | 4 +--- src/ext/yuni/src/cmake/common-settings.cmake | 4 ++-- src/ext/yuni/src/cmake/target.cmake | 4 ++-- 13 files changed, 26 insertions(+), 35 deletions(-) diff --git a/.github/workflows/centos7-system-deps-build.yml b/.github/workflows/centos7-system-deps-build.yml index 89f5789fa5..bd00b30703 100644 --- a/.github/workflows/centos7-system-deps-build.yml +++ b/.github/workflows/centos7-system-deps-build.yml @@ -52,7 +52,7 @@ jobs: source /opt/rh/devtoolset-9/enable #git 2.x must be enabled for Coin compilation with CMake ExternalProject_Add source /opt/rh/rh-git227/enable - cmake -B _build -S src -DCMAKE_BUILD_TYPE=release -DBUILD_TESTING=ON + cmake -B _build -S src -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON - name: Build run: | diff --git a/.github/workflows/centos7.yml b/.github/workflows/centos7.yml index afc8a4cab5..7a29b6c5b3 100644 --- a/.github/workflows/centos7.yml +++ b/.github/workflows/centos7.yml @@ -65,7 +65,7 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DDEPS_INSTALL_DIR=/rte-antares-deps-Release \ - -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DBUILD_not_system=OFF \ -DCMAKE_PREFIX_PATH=${{ env.ORTOOLSDIR }}/install \ diff --git a/.github/workflows/oracle8.yml b/.github/workflows/oracle8.yml index 62c9fd2534..b89e2788b6 100644 --- a/.github/workflows/oracle8.yml +++ b/.github/workflows/oracle8.yml @@ -48,11 +48,10 @@ jobs: run: | source /opt/rh/gcc-toolset-9/enable cmake -B _build -S src \ - -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DBUILD_UI=OFF \ - - name: Build run: | source /opt/rh/gcc-toolset-9/enable diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index c5ff4d738a..c3fc74e165 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -109,7 +109,7 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DDEPS_INSTALL_DIR=./rte-antares-deps-Debug \ -DCODE_COVERAGE=ON \ - -DCMAKE_BUILD_TYPE=debug \ + -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_PREFIX_PATH="../install;${{ env.ORTOOLS_DIR }}/install" \ -DBUILD_TESTING=ON \ -DMZ_CODE_COVERAGE=ON \ diff --git a/.github/workflows/ubuntu-system-deps-build.yml b/.github/workflows/ubuntu-system-deps-build.yml index a5cee04842..f3635e6436 100644 --- a/.github/workflows/ubuntu-system-deps-build.yml +++ b/.github/workflows/ubuntu-system-deps-build.yml @@ -43,7 +43,7 @@ jobs: - name: Configure run: | - cmake -B _build -S src -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=release -DBUILD_TESTING=ON + cmake -B _build -S src -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON - name: Build run: | diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 29b958d07b..6e0a848037 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -90,14 +90,14 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DDEPS_INSTALL_DIR=${{github.workspace}}/rte-antares-deps-Release \ - -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DBUILD_not_system=OFF \ -DCMAKE_PREFIX_PATH=${{ env.ORTOOLS_DIR }}/install \ - name: Build run: | - cmake --build _build --config release -j2 + cmake --build _build -j$(nproc) - name: Run unfeasibility-related tests if: ${{ env.IS_PUSH == 'true' }} diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index 8e1d079a6e..0bcff13b52 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -100,7 +100,7 @@ jobs: -DCMAKE_PREFIX_PATH="${{env.ORTOOLS_DIR}}/install" \ -DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \ - -DCMAKE_BUILD_TYPE=release \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DBUILD_not_system=OFF diff --git a/.github/workflows/windows-vcpkg.yml b/.github/workflows/windows-vcpkg.yml index de5bee4f78..c5cc8b1b75 100644 --- a/.github/workflows/windows-vcpkg.yml +++ b/.github/workflows/windows-vcpkg.yml @@ -111,15 +111,15 @@ jobs: -DDEPS_INSTALL_DIR=rte-antares-deps-Release \ -DCMAKE_PREFIX_PATH="${{ env.ORTOOLS_DIR }}/install" \ -DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \ - -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \ - -DCMAKE_BUILD_TYPE=release \ + -DVCPKG_TARGET_TRIPLET=${{ env.triplet }} \ + -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DBUILD_not_system=OFF - name: Build shell: bash run: | - cmake --build _build --config release -j2 + cmake --build _build --config Release -j2 - name: Run unfeasibility-related tests run: | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb81c4edb9..1a95252446 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,7 +139,7 @@ OMESSAGE("") OMESSAGE("") #Display Build Configuration (debug or release) -if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") OMESSAGE("{antares} Build Configuration: RELEASE") else() OMESSAGE("{antares} Build Configuration: DEBUG") @@ -148,7 +148,7 @@ endif() # # Yuni Framework # -if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(YUNI_TARGET_MODE "release") set(ANTARES_VERSION_TARGET "release") else() @@ -192,7 +192,7 @@ endif() # Add DEPS_INSTALL_DIR with antares-xpansion CMAKE_BUILD_TYPE -if ("${CMAKE_BUILD_TYPE}" STREQUAL "release") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") string(REPLACE ${CMAKE_BUILD_TYPE} Release DEPS_INSTALL_DIR_XPANSION @@ -344,11 +344,11 @@ OMESSAGE("") # Informations for NSIS if(WIN32 OR WIN64) if(MSVC) - if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(NSIS_TARGET "Release") - else("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") + else() set(NSIS_TARGET "Debug") - endif("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") + endif() set(COMPILER_MARK "v") #set(COMPILER_INCLUDE "vs9") else(MSVC) diff --git a/src/cmake/common-settings.cmake b/src/cmake/common-settings.cmake index 86ece44167..81e732eaad 100644 --- a/src/cmake/common-settings.cmake +++ b/src/cmake/common-settings.cmake @@ -22,7 +22,7 @@ macro(EMBED_MANIFEST manifestfile target) if(MSVC AND NOT MSVC9) message(STATUS "{antares} :: adding rule for manifest ${manifestfile}") set(ANTARES_UI_BIN_TARGET "Debug\\") - if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(ANTARES_UI_BIN_TARGET "Release\\") endif() @@ -40,7 +40,7 @@ endmacro() # # Ex: cmake . -DCMAKE_BUILD_TYPE=release # -if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") # # Build Configuration: Release @@ -59,12 +59,6 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "t if (NOT MSVC) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=c99") endif() - - if("${CMAKE_BUILD_TYPE}" STREQUAL "tuning") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -pg --no-inline") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg --no-inline") - endif("${CMAKE_BUILD_TYPE}" STREQUAL "tuning") - else() # @@ -214,7 +208,7 @@ endmacro() macro(executable_strip TARGET) - if("${CMAKE_BUILD_TYPE}" STREQUAL "release") + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") if(NOT MSVC) if(WIN32) add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_STRIP} $) @@ -225,7 +219,7 @@ macro(executable_strip TARGET) endif() endmacro() -if("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "tuning") +if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") diff --git a/src/cmake/utils.cmake b/src/cmake/utils.cmake index b470a700fc..3e3aeb7e20 100644 --- a/src/cmake/utils.cmake +++ b/src/cmake/utils.cmake @@ -1,10 +1,8 @@ macro(copy_dependency deps target) - if("${CMAKE_BUILD_TYPE}" STREQUAL "release") - + if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") get_target_property( DEP_SHARED_LIB_PATH ${deps} IMPORTED_LOCATION_RELEASE ) else() - get_target_property( DEP_SHARED_LIB_PATH ${deps} IMPORTED_LOCATION_DEBUG ) endif() diff --git a/src/ext/yuni/src/cmake/common-settings.cmake b/src/ext/yuni/src/cmake/common-settings.cmake index 9c8410ad3b..d92357ebde 100644 --- a/src/ext/yuni/src/cmake/common-settings.cmake +++ b/src/ext/yuni/src/cmake/common-settings.cmake @@ -12,7 +12,7 @@ include(CheckCXXCompilerFlag) set_property(GLOBAL PROPERTY USE_FOLDERS true) -if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(YUNI_) else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") @@ -305,7 +305,7 @@ if(NOT "${YUNI_CXX_FLAGS_OVERRIDE_ADD_RELWITHDEBINFO}" STREQUAL "") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${YUNI_CXX_FLAGS_OVERRIDE_ADD_RELWITHDEBINFO}") endif() -if ("${CMAKE_BUILD_TYPE}" STREQUAL "release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE}") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") diff --git a/src/ext/yuni/src/cmake/target.cmake b/src/ext/yuni/src/cmake/target.cmake index b0e23cfff0..3f67bfc489 100644 --- a/src/ext/yuni/src/cmake/target.cmake +++ b/src/ext/yuni/src/cmake/target.cmake @@ -24,8 +24,8 @@ if(NO_BUILD_TYPE) endif() endif() -string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "debug" BUILD_TYPE_IS_DEBUG) -string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "release" BUILD_TYPE_IS_RELEASE) +string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "Debug" BUILD_TYPE_IS_DEBUG) +string(COMPARE EQUAL "${CMAKE_BUILD_TYPE}" "Release" BUILD_TYPE_IS_RELEASE) if(NOT BUILD_TYPE_IS_DEBUG AND NOT BUILD_TYPE_IS_RELEASE) set(CMAKE_BUILD_TYPE "debug") endif()