JuliaLang / PackageCompiler.jl

Compile your Julia Package
https://julialang.github.io/PackageCompiler.jl/dev/
MIT License
1.41k stars 189 forks source link

Exporting constants in the executable? #832

Open heyx3 opened 1 year ago

heyx3 commented 1 year ago

TL;DR how could I export constants with specific names for external programs that are examining my executable?

I'm trying to use PackageCompiler to make a windows executable for my Julia program that uses OpenGL. However, I need to hint to the graphics driver to prefer discrete GPU cards over integrated GPU's.

It can be done manually through GeForce Control Panel, but this is an arduous requirement. To make it work automatically, NVidia requires that the executable exports the constant uint32_t NvOptimusEnablement = 0x00000001;, and AMD requires a similar constant DWORD AmdPowerXpressRequestHighPerformance = 1;. Is there any way for these to be exposed from the executable that PackageCompiler generates?