Skip to content

Commit

Permalink
cherry pick 3
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes authored and payetvin committed Feb 12, 2024
1 parent 517615b commit 692ac21
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/centos7-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-system-deps-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 4 additions & 10 deletions src/cmake/common-settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
Expand All @@ -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()

#
Expand Down Expand Up @@ -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} $<TARGET_FILE:${TARGET}>)
Expand All @@ -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}")
Expand Down
4 changes: 1 addition & 3 deletions src/cmake/utils.cmake
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
4 changes: 2 additions & 2 deletions src/ext/yuni/src/cmake/common-settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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}")
Expand Down
4 changes: 2 additions & 2 deletions src/ext/yuni/src/cmake/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 692ac21

Please sign in to comment.