Tests fail to compile when `DISABLE_RCT2` is disabled. #5046

Closed
marijnvdwerf opened this Issue Jan 11, 2017 · 3 comments

Projects

None yet

2 participants

@marijnvdwerf
Member
cmake .. -GNinja -DDISABLE_RCT2=OFF -DWITH_TESTS=ON
ninja
...
[364/373] Linking CXX executable test/tests/test_languagepack
FAILED: test/tests/test_languagepack 
: && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++   -Wno-error=date-time -DDEBUG=0 -m32 -std=gnu++11  -fstrict-aliasing -Wundef -Wmissing-declarations -Winit-self -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-missing-braces -Wno-comment -fPIC -Wnon-virtual-dtor -Wl,-search_paths_first -Wl,-headerpad_max_install_names -sectcreate rct2_text __text /Users/Marijn/Projects/OpenRCT2/Main/build/openrct2_text -sectcreate rct2_data __data /Users/Marijn/Projects/OpenRCT2/Main/build/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -segaddr __TEXT 0x2000000 -read_only_relocs suppress  -m32 -fno-pie test/tests/CMakeFiles/test_languagepack.dir/LanguagePackTest.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/localisation/LanguagePack.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/core/Console.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/core/Diagnostics.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/core/Guard.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/core/String.cpp.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/diagnostic.c.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/localisation/format_codes.c.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/localisation/utf8.c.o test/tests/CMakeFiles/test_languagepack.dir/__/__/src/openrct2/util/util.c.o  -o test/tests/test_languagepack -L/usr/local/Cellar/jansson/2.9/lib  -L/usr/local/Cellar/libpng/1.6.26/lib  -L/usr/local/Cellar/openssl/1.0.2j/lib  -L/usr/local/Cellar/libzip/1.1.2/lib -Wl,-rpath,/usr/local/Cellar/jansson/2.9/lib -Wl,-rpath,/usr/local/Cellar/libpng/1.6.26/lib -Wl,-rpath,/usr/local/Cellar/openssl/1.0.2j/lib -Wl,-rpath,/usr/local/Cellar/libzip/1.1.2/lib  test/tests/googletest-prefix/src/googletest-build/libgtest.a test/tests/googletest-prefix/src/googletest-build/libgtest_main.a -lpthread -ldl -lz -lSDL2 -lSDL2_ttf -lssl -lcrypto && :
ld: can't open -sectcreate file: /Users/Marijn/Projects/OpenRCT2/Main/build/openrct2_text
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@marijnvdwerf marijnvdwerf added the build label Jan 11, 2017
@janisozaur
Member

Works for me 👍

@marijnvdwerf
Member

Found two problems:

  • It wants to read from ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_text, yet it writes to ${CMAKE_BINARY_DIR}/openrct2_data. (I had a differently-named build dir)
  • If your run ninja test_sawyercoding, in a clean environment, it doesn't depend on the segfiles yet it does inherit the linker flags for them. (That one probably also applies to Linux as well)
@janisozaur
Member

Fixed by #5044

@janisozaur janisozaur closed this Jan 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment