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

CMake XCode build on macOS fails #374

Closed
romanp-nexusgroup opened this issue Feb 16, 2017 · 4 comments
Closed

CMake XCode build on macOS fails #374

romanp-nexusgroup opened this issue Feb 16, 2017 · 4 comments

Comments

@romanp-nexusgroup
Copy link

I am trying to build latest crypto++ with CMake generated XCode project

macOS 10.12.3
XCode 8.2.1
cmake version 3.7.2
mkdir build
cd build
cmake -G Xcode ..
open cryptopp.xcodeproj
build

Getting following error:

echo "Creating symlinks"
Creating symlinks
/usr/local/Cellar/cmake/3.7.2/bin/cmake -E cmake_symlink_library /Users/user1/dev/cryptopp/build/Debug/libcryptopp.5.7.dylib /Users/user1/dev/cryptopp/build/Debug/libcryptopp.5.7.dylib /Users/user1/dev/cryptopp/build/Debug/libcryptopp.dylib
CMake Error: cmake_symlink_library: System Error: No such file or directory

I commented out a part of makefile that sets SOVERSION, this helped

-       if (BUILD_SHARED)
-               set_target_properties(cryptopp-shared
-                               PROPERTIES
-                               SOVERSION ${COMPAT_VERSION}
-                               OUTPUT_NAME cryptopp)
-       endif()
+       #if (BUILD_SHARED)
+       #       set_target_properties(cryptopp-shared
+       #                       PROPERTIES
+       #                       SOVERSION ${COMPAT_VERSION}
+       #                       OUTPUT_NAME cryptopp)
+       #endif()

But not for long, then I got this:

Ld build/Debug/cryptest.exe normal x86_64
    cd /Users/user1/dev/cryptopp
    export MACOSX_DEPLOYMENT_TARGET=10.12
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -L/Users/user1/dev/cryptopp/build/Debug -F/Users/user1/dev/cryptopp/build/Debug -filelist /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe.LinkFileList -mmacosx-version-min=10.12 -Xlinker -object_path_lto -Xlinker /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe_lto.o -Xlinker -no_deduplicate -march=native /Users/user1/dev/cryptopp/build/Debug/libcryptopp.a -Xlinker -dependency_info -Xlinker /Users/user1/dev/cryptopp/build/cryptopp.build/Debug/cryptest.build/Objects-normal/x86_64/cryptest.exe_dependency_info.dat -o /Users/user1/dev/cryptopp/build/Debug/cryptest.exe

clang: error: no such file or directory: '/Users/user1/dev/cryptopp/build/Debug/libcryptopp.a'

cryptest wants to link to static library and it wants it to be named libcryptopp.a, but XCode thinks otherwise. XCode produces a file build/cryptopp.build/Debug/cryptopp-object.build/Objects-normal/libcryptopp-object.a

At this point I am not sure what I need to change to make it work, the makefile looks too complicated for me

@romanp-nexusgroup
Copy link
Author

Setting USE_INTERMEDIATE_OBJECTS_TARGET to OFF makes XCode happy

@noloader noloader added the cmake label Feb 16, 2017
@noloader
Copy link
Collaborator

echo "Creating symlinks" is kind of weird because we don't create symlinks.

Its probably more Cmake goodness. It may be related to Issue 355: CMake-based Xcode build fails to build any library.

@romanp-nexusgroup
Copy link
Author

Looks like it is the case. Thank you!

@noloader
Copy link
Collaborator

Last call for CMake patches before removing it from the library and adding it to the patch page. If you have something to add, then now is the time to do it.

Also see Remove CMake from GitHub; add it to Patch Page on wiki? and Commit 1c740b0a097aecaa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants