Skip to content

Commit

Permalink
Use -link-debuglib for debug-mode tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadlinger committed Sep 24, 2015
1 parent 8c428e6 commit 8b1e7ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -99,7 +99,7 @@ build_script:
- cd ninja-ldc
- cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=c:\projects\ldc-x64 -DLLVM_ROOT_DIR=c:/projects/llvm-x64 -DLIBCONFIG_INCLUDE_DIR=c:/projects/libconfig/lib -DLIBCONFIG_LIBRARY=c:/projects/libconfig/lib/x64/ReleaseStatic/libconfig.lib ..\ldc
# Work around LDC issue #930
- ps: (gc build.ninja).replace('runtime/std/string-unittest-debug.obj -w -d -g -unittest', 'runtime/std/string-unittest-debug.obj -w -d -unittest') | sc build.ninja
- ps: (gc build.ninja).replace('runtime/std/string-unittest-debug.obj -w -d -g -link-debuglib -unittest', 'runtime/std/string-unittest-debug.obj -w -d -link-debuglib -unittest') | sc build.ninja
# Build LDC, druntime and phobos
- ninja -j2

Expand Down
2 changes: 1 addition & 1 deletion runtime/CMakeLists.txt
Expand Up @@ -13,7 +13,7 @@ set(BUILD_BC_LIBS OFF CACHE BOOL
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/d CACHE PATH "Path to install D modules to")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Whether to build the runtime as a shared library")
set(D_FLAGS -w;-d CACHE STRING "Runtime build flags, separated by ;")
set(D_FLAGS_DEBUG -g CACHE STRING "Runtime build flags (debug libraries), separated by ;")
set(D_FLAGS_DEBUG -g;-link-debuglib CACHE STRING "Runtime build flags (debug libraries), separated by ;")
set(D_FLAGS_RELEASE -O3;-release CACHE STRING "Runtime build flags (release libraries), separated by ;")
if(MSVC)
set(LINK_WITH_MSVCRT ON CACHE BOOL "Link with MSVCRT.lib (DLL) instead of LIBCMT.lib (static)")
Expand Down
4 changes: 2 additions & 2 deletions tests/d2/CMakeLists.txt
Expand Up @@ -25,11 +25,11 @@ endfunction()
# Would like to specify the "-release" flag for relase builds, but some of the
# tests (e.g. 'testdstress') depend on contracts and invariants being active.
# Need a solution integrated with d_do_test.
add_testsuite("-debug" -gc ${host_model})
add_testsuite("-debug" "-gc -link-debuglib" ${host_model})
add_testsuite("" -O3 ${host_model})

if(MULTILIB AND host_model EQUAL 64)
# Also test in 32 bit mode on x86_64 multilib builds.
add_testsuite("-debug-32" -gc 32)
add_testsuite("-debug-32" "-gc -link-debuglib" 32)
add_testsuite("-32" -O3 32)
endif()

0 comments on commit 8b1e7ce

Please sign in to comment.