[GNC-dev] Unable to run test on mac os.

John Ralls jralls at ceridwen.us
Mon Mar 23 12:34:29 EDT 2020


Jean,

At this point the build messages from libgtest.a are more interesting because that's what we're trying to coerce Xcode into putting somewhere different.

I trust that you started fresh from an empty build dir after changing common/test-core/CMakeLists.txt.

Regards,
John Ralls

> On Mar 22, 2020, at 4:04 PM, jean <ripngo at gmail.com> wrote:
> 
> I tried your suggestion, modified common/test-core/CMakeLists.txt (in the src directory I assume). But I'm still getting the same issue trying to build check.
> 
> 
> Showing Recent Messages
> Ld /Users/Shari/gnucash-stable/build_xcode/bin/test-gnc-rational normal x86_64
>    cd /Users/Shari/gnucash-stable/src/gnucash-git
>    export MACOSX_DEPLOYMENT_TARGET=10.14
> /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.14.sdk -L/Users/Shari/gnucash-stable/build_xcode/bin -F/Users/Shari/gnucash-stable/build_xcode/bin -filelist /Users/Shari/gnucash-stable/build_xcode/libgnucash/engine/test/gnucash.build/Debug/test-gnc-rational.build/Objects-normal/x86_64/test-gnc-rational.LinkFileList -mmacosx-version-min=10.14 -Xlinker -object_path_lto -Xlinker /Users/Shari/gnucash-stable/build_xcode/libgnucash/engine/test/gnucash.build/Debug/test-gnc-rational.build/Objects-normal/x86_64/test-gnc-rational_lto.o -Xlinker -no_deduplicate -L/usr/local/opt/openblas/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/Users/Shari/gnucash-stable/lib -lintl -lglib-2.0 -L/Users/Shari/gnucash-stable/lib -lgobject-2.0 -lintl -lglib-2.0 -L/Users/Shari/gnucash-stable/lib -lgmodule-2.0 -lintl -lglib-2.0 -L/Users/Shari/gnucash-stable/lib -lgthread-2.0 -lintl -lglib-2.0 -L/Users/Shari/gnucash-stable/lib -licui18n -licuuc -licudata /Users/Shari/gnucash-stable/lib/libboost_date_time.dylib /Users/Shari/gnucash-stable/lib/libboost_regex.dylib /Users/Shari/gnucash-stable/lib/libboost_locale.dylib /Users/Shari/gnucash-stable/lib/libboost_filesystem.dylib /Users/Shari/gnucash-stable/lib/libboost_system.dylib /Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -licui18n -licuuc -licudata /Users/Shari/gnucash-stable/lib/libboost_date_time.dylib /Users/Shari/gnucash-stable/lib/libboost_regex.dylib /Users/Shari/gnucash-stable/lib/libboost_locale.dylib /Users/Shari/gnucash-stable/lib/libboost_filesystem.dylib /Users/Shari/gnucash-stable/lib/libboost_system.dylib /Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a -Xlinker -dependency_info -Xlinker /Users/Shari/gnucash-stable/build_xcode/libgnucash/engine/test/gnucash.build/Debug/test-gnc-rational.build/Objects-normal/x86_64/test-gnc-rational_dependency_info.dat -o /Users/Shari/gnucash-stable/build_xcode/bin/test-gnc-rational
> 
> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
> 
> 
> 
> On 3/22/20 3:25 PM, John Ralls wrote:
>>> On Mar 22, 2020, at 2:48 PM, jean <ripngo at gmail.com> wrote:
>>> 
>>> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
>>> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
>>> 
>>> The missing .a files are here:
>>> ./common/test-core/Debug/libgtest.a
>>> 
>>> I.e. xcode expects common/test-core/libgtest.a but instead I have ./common/test-core/Debug/libgtest.a
>> That's because Xcode lets you select the build type from the GUI and of course Cmake doesn't know about that at configure time so it can't adjust the locations. I'm actually a bit surprised that this is the only thing that broke.
>> This stackoverflow seems to address the problem: https://stackoverflow.com/questions/18393813/how-do-i-suppress-xcode-from-generating-a-folder-named-after-the-build-configura
>> Since it's just ligbtest maybe just tweaking that one target will work. Try adding to common/test-core/CMakeLists.txt at line 80
>>     if (CMAKE_GENERATOR STREQUAL Xcode)
>>        set_target_properties(gtest PROPERTIES
>>                              ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}
>>                              ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}
>>                              )
>>     endif()
>> and re-run cmake.
>> Regards,
>> John Ralls



More information about the gnucash-devel mailing list