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

"Simplify" XGetopt usage #2678

Merged
merged 2 commits into from
Apr 11, 2023
Merged

"Simplify" XGetopt usage #2678

merged 2 commits into from
Apr 11, 2023

Conversation

DennisHeimbigner
Copy link
Collaborator

When "getopt()" is not available, various of the netcdf-c utilities use XGetopt instead. This occurs primarily when building under Window, so the build changes are restricted to CMake.

This PR tries to isolate XGetopt.c to the libdispatch directory and then builds the various utilities using this cliche:

IF(USE_X_GETOPT)
  SET(XGETOPTSRC "${CMAKE_CURRENT_SOURCE_DIR}/../libdispatch/XGetopt.c")
ENDIF()

This avoids the need to copy XGetopt.c to all the directories that use it. Instead they just add ${XGETOPSRC}
unconditionally to the source file list for each utility.

When "getopt()" is not available, various of the netcdf-c utilities
use XGetopt instead. This occurs primarily when building under Window,
so the build changes are restricted to CMake.

This PR tries to isolate XGetopt.c to the libdispatch directory
and then builds the various utilities using this cliche:
````
IF(USE_X_GETOPT)
  SET(XGETOPTSRC "${CMAKE_CURRENT_SOURCE_DIR}/../libdispatch/XGetopt.c")
ENDIF()
````

This avoids the need to copy XGetopt.c to all the directories that
use it.
@WardF WardF merged commit a42a218 into Unidata:main Apr 11, 2023
@DennisHeimbigner DennisHeimbigner deleted the xgetopt.dmh branch April 12, 2023 18:15
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.

2 participants