-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issues where CMakeCache.txt does not contain CMAKE_BUILD_TYPE
- Loading branch information
1 parent
9265549
commit 60969d1
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/tools/setup_helpers/env.py b/tools/setup_helpers/env.py | ||
index 6332a66e7be06a..208b504a65afc3 100644 | ||
--- a/tools/setup_helpers/env.py | ||
+++ b/tools/setup_helpers/env.py | ||
@@ -63,19 +63,6 @@ class BuildType: | ||
def __init__(self, cmake_build_type_env: str | None = None) -> None: | ||
if cmake_build_type_env is not None: | ||
self.build_type_string = cmake_build_type_env | ||
- return | ||
- | ||
- cmake_cache_txt = os.path.join(BUILD_DIR, "CMakeCache.txt") | ||
- if os.path.isfile(cmake_cache_txt): | ||
- # Found CMakeCache.txt. Use the build type specified in it. | ||
- from .cmake_utils import get_cmake_cache_variables_from_file | ||
- | ||
- with open(cmake_cache_txt) as f: | ||
- cmake_cache_vars = get_cmake_cache_variables_from_file(f) | ||
- # Normally it is anti-pattern to determine build type from CMAKE_BUILD_TYPE because it is not used for | ||
- # multi-configuration build tools, such as Visual Studio and XCode. But since we always communicate with | ||
- # CMake using CMAKE_BUILD_TYPE from our Python scripts, this is OK here. | ||
- self.build_type_string = cast(str, cmake_cache_vars["CMAKE_BUILD_TYPE"]) | ||
else: | ||
self.build_type_string = os.environ.get("CMAKE_BUILD_TYPE", "Release") | ||
|