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 GMT_XXX_LIB_NAME when XXX_DLL_RENAME is set #3254

Merged
merged 4 commits into from
May 5, 2020

Conversation

seisman
Copy link
Member

@seisman seisman commented May 5, 2020

For the GMT core library, the properties OUTPUT_NAME and RUNTIME_OUTPUT_NAME are set to gmt by default (e.g. libgmt.dylib, libgmt.so and gmt.dll).

For Windows, if GMT_DLL_RENAME is set, then RUNTIME_OUTPUT_NAME is changed. Thus, we can use the property RUNTIME_OUTPUT_TIME to build the variable GMT_CORE_LIB_NAME.

@seisman seisman changed the base branch from master to external-lib-access May 5, 2020 02:32
@seisman
Copy link
Member Author

seisman commented May 5, 2020

@joa-quim I add a commit on top of @PaulWessel's branch. This should fix the problem for the gmt.dll library.

@seisman seisman changed the title Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set WIP: Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set May 5, 2020
ci/config-gmt-windows.sh Outdated Show resolved Hide resolved
@seisman
Copy link
Member Author

seisman commented May 5, 2020

With the changes in this PR, now we have:

Linux:

*  Build GMT core             : always [libgmt.so]
*  Build PSL library          : always [libpostscriptlight.so]
*  Build GMT supplements      : yes [supplements.so]

macOS

*  Build GMT core             : always [libgmt.dylib]
*  Build PSL library          : always [libpostscriptlight.dylib]
*  Build GMT supplements      : yes [supplements.so]

Windows (with XXX_DLL_RENAME set)

*  Build GMT core             : always [gmt_w64.dll]
*  Build PSL library          : always [postscriptlight_w64.dll]
*  Build GMT supplements      : yes [supplements_w64.dll]

@joa-quim
Copy link
Member

joa-quim commented May 5, 2020

Then no need to use any of the XXX_RENAME_DLL variables and just stick to the default gmt.dll, etc ...

@seisman
Copy link
Member Author

seisman commented May 5, 2020

Then no need to use any of the XXX_RENAME_DLL variables and just stick to the default gmt.dll, etc ...

Yes, just to test if XXX_DLL_RENAME work as we expect. I will remove them if this PR is going to be merged.

@joa-quim
Copy link
Member

joa-quim commented May 5, 2020

OK.

@seisman seisman changed the title WIP: Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set May 5, 2020
@seisman
Copy link
Member Author

seisman commented May 5, 2020

Now it's ready for reviewing and merging.

@seisman seisman changed the title Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set Fix GMT_XXX_LIB_NAME when XXX_DLL_RENAME is set May 5, 2020
@joa-quim
Copy link
Member

joa-quim commented May 5, 2020

OK, I tested this branch and see that config.h has

/* Name of core library */
#define GMT_CORE_LIB_NAME "gmt_w64.dll"

/* Name of supplemental library */
#define GMT_SUPPL_LIBRARY "supplements_w64.dll"

/* Name of PSL library */
#define PSL_LIB_NAME "postscriptlight_w64.dll"

So all seems fine.

@seisman seisman merged commit 4714900 into external-lib-access May 5, 2020
@seisman seisman deleted the gmtdllrename branch May 5, 2020 18:24
PaulWessel added a commit that referenced this pull request May 9, 2020
* Only open core lib if gmt.c is involved.

Trying to deal with #3233.

* Update gmt_api.c

* Update gmt_api.c

* Update gmt_api.c

* Add the DLL_RENAME mechanism to main CMakeList.
Fix typo

* Fix GMT_XXX_LIB_NAME when XXX_DLL_RENAME is set (#3254)

* Fix GMT_CORE_LIB_NAME when GMT_DLL_RENAME is set

* Use RUNTIME_OUTPUT_NAME for all libraries

* Remove XXX_DLL_RENAME settings

* Update src/gmt_api.c

Co-authored-by: Dongdong Tian <[email protected]>

Co-authored-by: Joaquim Luis <[email protected]>
Co-authored-by: Dongdong Tian <[email protected]>
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.

None yet

2 participants