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

OPENEXR_DLL issues #625

Closed
meshula opened this issue Nov 28, 2019 · 2 comments
Closed

OPENEXR_DLL issues #625

meshula opened this issue Nov 28, 2019 · 2 comments
Assignees
Labels
Enhancement A request for a change or enhancement. Needs Discussion To be discussed in the technical steering committee
Milestone

Comments

@meshula
Copy link
Contributor

meshula commented Nov 28, 2019

A very common error users encounter with OpenEXR on Windows is that they have not correctly set the OPENEXR_DLL preprocessor directive to match the OpenEXR build they are linking against. A solution, for CMake users on Windows at least, is that IlmBaseConfig.cmake and OpenEXRConfig.cmake could set the macro appropriately.

We also have generated IlmBaseConfig.h and OpenEXRConfig.h files that would be appropriate places, in a shared build, to add a chunk defining OPENEXR_DLL if it has not been set in the environment already.

See AcademySoftwareFoundation/OpenColorIO#894 for a recent example of the problem.

Historically we wanted one set of headers that would work with static and dynamic libraries living side by side in the build environment, in order to be able to have a lib directory that could be treated as a broad "SDK". A CMake driven build environment does not really work with that notion in mind, and so having a generated macro in the generated headers would better match current practice.

@hodoulp
Copy link
Member

hodoulp commented Nov 28, 2019

You could have a look to the OCIO export defines as an example. The goal is that external users of the library do not have to care about the linkage type.

Below is the OpenColorIO CMake change to correctly handle it:

if(NOT BUILD_SHARED_LIBS)
	target_compile_definitions(OpenColorIO
		PRIVATE
			OpenColorIO_SKIP_IMPORTS
	)
else()
	# Only exports selected symbols.
	target_compile_definitions(OpenColorIO
		PRIVATE
			OpenColorIO_EXPORTS
	)
endif()

@cary-ilm cary-ilm added the Needs Discussion To be discussed in the technical steering committee label Jan 9, 2020
@cary-ilm cary-ilm added the Enhancement A request for a change or enhancement. label Feb 7, 2020
@cary-ilm cary-ilm added this to the Next Minor Release milestone Feb 7, 2020
@cary-ilm
Copy link
Member

Discussed in the TSC, decided there was nothing to do here.

@cary-ilm cary-ilm modified the milestones: Next Minor Release, v2.5.0 Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A request for a change or enhancement. Needs Discussion To be discussed in the technical steering committee
Projects
None yet
Development

No branches or pull requests

3 participants