Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a syntax error in build.sh #1205

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Fix a syntax error in build.sh #1205

merged 1 commit into from
Sep 11, 2023

Conversation

dgbeliveau
Copy link
Contributor

The correct syntax here is ${VARIABLE:-REPLACEMENT}. The dash is part of the operator.

Since the replacement also needs to start with a dash, two dashes are required.

For instance:

CMAKE_OPTS="${CMAKE_OPTS:-DBUILD_SHARED_LIBS=OFF}"
echo $CMAKE_OPTS

Will output

DBUILD_SHARED_LIBS=OFF

And

CMAKE_OPTS="${CMAKE_OPTS:--DBUILD_SHARED_LIBS=OFF}"
echo $CMAKE_OPTS

Will output

-DBUILD_SHARED_LIBS=OFF

This issue was causing the -DBUILD_SHARED_LIBS=OFF default to be ignored if a user did not set CMAKE_OPTS:

2023-09-06T22:39:53.3228622Z cmake -DMAC_ARCH=x86_64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PACKAGE_TYPE=deb -DCMAKE_CXX_FLAGS="-DHAVE_MAT_EVT_TRACEID=1" DBUILD_SHARED_LIBS=OFF ..

CMake Warning:
  Ignoring extra path from command line:

   "/mnt/s/out/DBUILD_SHARED_LIBS=OFF"

The correct syntax here is `${VARIABLE:-REPLACEMENT}`. Since the
replacement also needs to start with a dash, two dashes are required.
Copy link
Contributor

@lalitb lalitb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix.

Copy link
Contributor

@ThomsonTan ThomsonTan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.

@ThomsonTan ThomsonTan merged commit dee05c0 into microsoft:main Sep 11, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants