Skip to content

Conversation

ns6089
Copy link
Contributor

@ns6089 ns6089 commented Mar 26, 2023

Description

Stumbled upon this when setting up sunshine in vscode, where I was getting strange linker errors.

In CMakeLists.txt both CURL_STATIC_LDFLAGS and CURL_STATIC_CFLAGS are lists, when converted to string their items get semicolon-separated. CMAKE_CXX_FLAGS is a string, where flags are space-separated.

What basically happened, CURL_STATIC_LDFLAGS was always converted to single gibberish -L argument which just didn't trigger any errors. And CURL_STATIC_CFLAGS was properly converted only when the list had a single item (pkg-config --static --cflags libcurl returned only -DCURL_STATICLIB. When pkg-config gets called outside of msys environment, it prepends include directory with -I argument , and CURL_STATIC_CFLAGS breaks exactly like CURL_STATIC_LDFLAGS. To the end-user it looked like libcurl linking errors, because -DCURL_STATICLIB was not set.

This should fix building in vscode, and maybe some other scenarios. CURL_STATIC_LDFLAGS are not needed, because CURL_STATIC_LIBRARIES are already passed to target_link_libraries(), it's enough to set up include and library lookup directories for exotic libcurl installations.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2023

CLA assistant check
All committers have signed the CLA.

@ReenigneArcher ReenigneArcher requested a review from psyke83 March 27, 2023 00:44
@ReenigneArcher ReenigneArcher merged commit be74b74 into LizardByte:nightly Mar 27, 2023
@ns6089 ns6089 deleted the curl-flags branch April 16, 2023 12:52
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.

5 participants