Skip to content

Commit

Permalink
Use Release|Debug instead of release|debug for CMAKE_BUILD_TYPE (#1879
Browse files Browse the repository at this point in the history
)

We no longer change CMAKE_BUILD_TYPE, see #1873. We must use exactly
Release or Debug for some of our dependencies (SCIP).

```
CMake Error at /__w/Antares_Simulator/Antares_Simulator/_build/_deps/scip-src/CMakeLists.txt:111 (message):
--   Build type: release
  You have not selected a valid CMAKE_BUILD_TYPE.  Please select 'Release' or
  'Debug'.
```

See
https://github.com/AntaresSimulatorTeam/Antares_Simulator/actions/runs/7541339936/job/20527856062

Also, remove custom "tuning" value, since it is unused and not
documented.
  • Loading branch information
flomnes authored Jan 16, 2024
1 parent b82e718 commit 670628e
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 33 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 @@ -50,7 +50,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 @@ -71,7 +71,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 \
-DBUILD_TOOLS=OFF \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oracle8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
source /opt/rh/gcc-toolset-10/enable
cmake -B _build -S src \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_TOOLS=OFF \
-DBUILD_UI=OFF \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-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_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -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 @@ -94,7 +94,7 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-10 \
-DDEPS_INSTALL_DIR=${{github.workspace}}/rte-antares-deps-Release \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_not_system=OFF \
-DBUILD_TOOLS=ON \
Expand All @@ -103,7 +103,7 @@ jobs:
- name: Build
run: |
cmake --build _build --config release -j$(nproc)
cmake --build _build -j$(nproc)
# simtest
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_TOOLS=ON \
-DBUILD_not_system=OFF \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows-vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
-DCMAKE_PREFIX_PATH="${{ env.ORTOOLS_DIR }}/install" \
-DVCPKG_ROOT="${{env.VCPKG_ROOT}}" \
-DVCPKG_TARGET_TRIPLET=${{ env.triplet }} \
-DCMAKE_BUILD_TYPE=release \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON \
-DBUILD_TOOLS=ON \
-DBUILD_not_system=OFF \
Expand All @@ -151,7 +151,7 @@ jobs:
- name: Build
shell: bash
run: |
cmake --build _build --config release -j2
cmake --build _build --config Release -j2
# simtest
- name: Read simtest version
id: simtest-version
Expand Down
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,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 @@ -150,7 +150,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 @@ -197,7 +197,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 @@ -354,11 +354,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 @@ -24,7 +24,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 @@ -42,7 +42,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 @@ -61,12 +61,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 @@ -216,7 +210,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 @@ -227,7 +221,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 670628e

Please sign in to comment.