mtrojnar / osslsigncode

OpenSSL based Authenticode signing for PE/MSI/Java CAB files
Other
806 stars 131 forks source link

Linking fails when building with Nix on Darwin #246

Closed charles-dyfis-net closed 1 year ago

charles-dyfis-net commented 1 year ago

Testing for AppleClang appears not to be sufficient:

[100%] Linking C executable osslsigncode
clang-11: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
ld: unknown option: -z
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/osslsigncode.dir/build.make:116: osslsigncode] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/osslsigncode.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Adding the following clause to SetCompilerFlags.cmake appears to fix the build:

OR ((CMAKE_SYSTEM_NAME MATCHES Darwin) AND (CMAKE_C_COMPILER_ID MATCHES Clang))

mtrojnar commented 1 year ago

247 is merged.