[tools] Fix the use of cached command-line variables in build_omim.sh #8710

Merged
Tmpod merged 2 commits from fix/build_omim.sh-cached-variables into master 2024-07-26 14:25:39 +00:00
3 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View file

@ -146,6 +146,7 @@ iphone/Maps/app.omaps/
biodranik commented 2024-07-15 16:45:51 +00:00 (Migrated from github.com)
Review

Looks like the cmake is not used properly. All temporary files should be created in a different directory, not in the source directory. E.g.:

cd ..
mkdir omim-build-debug
cd omim-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug -GNinja ../organicmaps/
ninja [optional_target]
Looks like the cmake is not used properly. All temporary files should be created in a different directory, not in the source directory. E.g.: ```bash cd .. mkdir omim-build-debug cd omim-build-debug cmake -DCMAKE_BUILD_TYPE=Debug -GNinja ../organicmaps/ ninja [optional_target] ```
biodranik commented 2024-07-15 16:46:14 +00:00 (Migrated from github.com)
Review

All these lines should not be needed if cmake is used properly from a different directory.

All these lines should not be needed if cmake is used properly from a different directory.
Tmpod commented 2024-07-15 16:59:09 +00:00 (Migrated from github.com)
Review

Right, I must have messed it up when I was trying to understand the macdeployqt issue, but shouldn't we ignore those anyway? Or is it used for important files?

Right, I must have messed it up when I was trying to understand the macdeployqt issue, but shouldn't we ignore those anyway? Or is it used for important files?
biodranik commented 2024-07-15 18:00:42 +00:00 (Migrated from github.com)
Review

Please remove them, using cmake in the same dir as the source is an anti-pattern.

Please remove them, using cmake in the same dir as the source is an anti-pattern.
*.autosave
# CMake
cmake-build-*
build/

2
android/.gitignore vendored
View file

@ -22,3 +22,5 @@ local.properties
lint.xml
.gradletasknamecache
# Generated by Eclipse and JDTLS
biodranik commented 2024-07-15 16:46:34 +00:00 (Migrated from github.com)
Review

Which app creates this folder?

Which app creates this folder?
Tmpod commented 2024-07-15 16:57:28 +00:00 (Migrated from github.com)
Review

This appeared back when I was working on my PR with an Android UI fix. Don't know exactly what caused it, but I assume it was some gradle build step?

This appeared back when I was working on my PR with an Android UI fix. Don't know exactly what caused it, but I assume it was some gradle build step?
biodranik commented 2024-07-15 17:24:45 +00:00 (Migrated from github.com)
Review

What's inside?

What's inside?
Tmpod commented 2024-07-15 17:28:39 +00:00 (Migrated from github.com)
Review

Seems to be some preference files related to Eclipse (which I never used) and JDTLS (Eclipse's Java language server, which I use in my editor). We should probably keep it?

Seems to be some preference files related to Eclipse (which I never used) and [JDTLS](https://github.com/eclipse-jdtls/eclipse.jdt.ls) (Eclipse's Java language server, which I use in my editor). We should probably keep it?
biodranik commented 2024-07-15 18:00:15 +00:00 (Migrated from github.com)
Review

Yes, please add a comment why it's needed.

Yes, please add a comment why it's needed.
.settings/

View file

@ -22,11 +22,11 @@ while getopts ":cdrxtagjlpn:" opt; do
g) OPT_GCC=1 ;;
j) OPT_COMPILE_DATABASE=1
CMAKE_CONFIG="${CMAKE_CONFIG:-} -DCMAKE_EXPORT_COMPILE_COMMANDS=YES"
;;
;;
l) OPT_LAUNCH_BINARY=1 ;;
n) OPT_NJOBS="$OPTARG"
CMAKE_CONFIG="${CMAKE_CONFIG:-} -DNJOBS=${OPT_NJOBS}"
;;
;;
p) OPT_PATH="$OPTARG" ;;
r) OPT_RELEASE=1 ;;
t) OPT_DESIGNER=1 ;;
@ -132,12 +132,11 @@ build()
fi
cd "$DIRNAME"
if [ -z "$OPT_DESIGNER" ]; then
if [ -n "$OPT_STANDALONE" ]; then
"$CMAKE" "$CMAKE_GENERATOR" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" \
-DBUILD_STANDALONE:bool=True ${CMAKE_CONFIG:-}
else
"$CMAKE" "$CMAKE_GENERATOR" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" ${CMAKE_CONFIG:-}
fi
"$CMAKE" "$CMAKE_GENERATOR" "$OMIM_PATH" \
-DCMAKE_BUILD_TYPE="$CONF" \
-DBUILD_DESIGNER:BOOL=OFF \
-DBUILD_STANDALONE:BOOL=$([ "$OPT_STANDALONE" == 1 ] && echo "ON" || echo "OFF") \
${CMAKE_CONFIG:-}
echo ""
$MAKE_COMMAND $OPT_TARGET
if [ -n "$OPT_TARGET" ] && [ -n "$OPT_LAUNCH_BINARY" ]; then
@ -146,8 +145,7 @@ build()
done
fi
else
"$CMAKE" "$CMAKE_GENERATOR" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" \
-DBUILD_DESIGNER:bool=True ${CMAKE_CONFIG:-}
"$CMAKE" "$CMAKE_GENERATOR" "$OMIM_PATH" -DCMAKE_BUILD_TYPE="$CONF" -DBUILD_DESIGNER:BOOL=ON ${CMAKE_CONFIG:-}
$MAKE_COMMAND package
fi
if [ -n "$OPT_COMPILE_DATABASE" ]; then