Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ef9f22c
adhoc config parser and representation
rtbo Feb 24, 2017
2c50130
adapt config file to use adhoc parser
rtbo Feb 24, 2017
dd0cca8
change comment in config file template
rtbo Feb 24, 2017
031003d
cmake does not look for libconfig
rtbo Feb 24, 2017
172eb30
CI is not handling libconfig anymore
rtbo Feb 24, 2017
037d0d0
remove libconfig license
rtbo Feb 24, 2017
de8fd62
remove libconfig from README
rtbo Feb 24, 2017
7dcd7e2
config file grammar comment
rtbo Feb 24, 2017
d36d066
move config utility functions
rtbo Feb 25, 2017
94e7627
Misc. config tweaks (aesthetic ones + less C strings)
kinke Feb 25, 2017
47054d2
config unittest
rtbo Feb 25, 2017
8b05b82
config: fix underscore in names
rtbo Feb 25, 2017
1bcbf0a
remove config unittest
rtbo Feb 25, 2017
1af0a7b
driver/unittests.d with config file tests
rtbo Feb 25, 2017
003216a
add custom test executable
rtbo Feb 25, 2017
851ebcf
ldc2 unittests are run directly by CI
rtbo Feb 25, 2017
8619592
config: Read from string instead of file to aid unittesting
kinke Feb 25, 2017
2d38752
Build LDC D unittests on demand only
kinke Feb 26, 2017
e53c669
Close config file properly after reading
kinke Feb 26, 2017
93facb0
Add some more config parser unittests
kinke Feb 26, 2017
55e9126
Extend config file grammar by backtick-enclosed strings
kinke Feb 26, 2017
fdea747
Support config files with UTF-8 BOM
kinke Feb 26, 2017
a1f484b
Add extra diagnostics for not-found sections in config file.
JohanEngelen Mar 3, 2017
c08bc71
Make sure the configfile diagnostic tests also pass when LLVM X86 tar…
JohanEngelen Mar 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- libconfig++8-dev
- gdb
- gcc-4.9
- g++-4.9
Expand Down Expand Up @@ -71,7 +70,6 @@ before_install:
export LLVM_CONFIG="llvm-$LLVM_VERSION/bin/llvm-config";
install:
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then export CC="gcc-4.9"; export CXX="g++-4.9"; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update; brew install libconfig; fi;
- eval "${DC} --version"
- pip install --user lit
- python -c "import lit; lit.main();" --version | head -n 1
Expand All @@ -94,11 +92,13 @@ script:
make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest;
fi
# Run dmd-testsuite.
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
# Run LLVM IR testsuite.
- ctest --output-on-failure -V -R "lit-tests"
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite"
# Run lit testsuite.
- ctest -V -R "lit-tests"
# Build and run LDC D unittests.
- ctest --output-on-failure -R "ldc2-unittest"
# Link and run Phobos & druntime unittest runners.
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"

after_success:
-
Expand Down
28 changes: 17 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ project(ldc)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")

if(MSVC)
set(LIBCONFIG_DLL OFF CACHE BOOL "Use libconfig DLL instead of static library")
endif()

include(FindDCompiler)
include(CheckIncludeFile)
include(CheckLibraryExists)
Expand All @@ -29,11 +25,6 @@ math(EXPR LDC_LLVM_VER ${LLVM_VERSION_MAJOR}*100+${LLVM_VERSION_MINOR})
string(REGEX MATCH "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" LLVM_TABLEGEN_LIBRARY "${LLVM_LIBRARIES}")
string(REGEX REPLACE "^-.*LLVMTableGen[^;]*;|;-.*LLVMTableGen[^;]*" "" LLVM_LIBRARIES "${LLVM_LIBRARIES}")

#
# Locate libconfig.
#
find_package(LibConfig REQUIRED)

#
# Get info about used Linux distribution.
#
Expand Down Expand Up @@ -542,8 +533,8 @@ add_custom_target(${LDC_EXE} ALL DEPENDS ${LDC_EXE_FULL})
add_custom_target(${LDMD_EXE} ALL DEPENDS ${LDMD_EXE_FULL})

# Figure out how to link the main LDC executable, for which we need to take the
# libconfig/LLVM flags into account.
set(LDC_LINKERFLAG_LIST "${SANITIZE_LDFLAGS};${LIBCONFIG_LIBRARY};${LLVM_LIBRARIES};${LLVM_LDFLAGS}")
# LLVM flags into account.
set(LDC_LINKERFLAG_LIST "${SANITIZE_LDFLAGS};${LLVM_LIBRARIES};${LLVM_LDFLAGS}")

set(LDC_LINK_MANUALLY OFF)
if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")))
Expand Down Expand Up @@ -718,6 +709,21 @@ add_subdirectory(tools)
# Test and runtime targets. Note that enable_testing() is order-sensitive!
#
enable_testing()

# LDC unittest executable (D unittests only).
set(LDC_UNITTEST_EXE_FULL ${PROJECT_BINARY_DIR}/bin/${LDC_EXE_NAME}-unittest${CMAKE_EXECUTABLE_SUFFIX})
build_d_executable(
"${LDC_UNITTEST_EXE_FULL}"
"-unittest;${LDC_D_SOURCE_FILES}"
"$<TARGET_LINKER_FILE:${LDC_LIB}>"
"${LDC_D_SOURCE_FILES}"
"${LDC_LIB}"
)
add_custom_target(ldc2-unittest DEPENDS ${LDC_UNITTEST_EXE_FULL})
add_test(NAME build-ldc2-unittest COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ldc2-unittest)
add_test(NAME ldc2-unittest COMMAND ${LDC_UNITTEST_EXE_FULL} --version)
set_tests_properties(ldc2-unittest PROPERTIES DEPENDS build-ldc2-unittest)

add_subdirectory(runtime)
if(D_VERSION EQUAL 2)
add_subdirectory(tests/d2)
Expand Down
513 changes: 0 additions & 513 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ libraries is available on the project wiki for
[Linux and OS X](http://wiki.dlang.org/Building_LDC_from_source) and
[Windows](http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC).

If you have a working C++ build environment, CMake, a current LLVM (>= 3.5),
and [libconfig](http://hyperrealm.com/libconfig/libconfig.html) available
there should be no big surprises.
If you have a working C++ build environment, CMake, and a current LLVM (>= 3.5)
available, there should be no big surprises.
Building LDC also requires a working D compiler, DMD and LDC are supported.
(LDC 0.17 is the last version that does not need a D compiler,
and for that reason we try to maintain it in the 'ltsmaster' branch).
Expand Down
27 changes: 10 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ install:
- cd ldc
- git submodule update --init --recursive
- cd ..
# Clone libconfig (v1.6 does not work due to https://github.com/hyperrealm/libconfig/issues/47)
- git clone https://github.com/hyperrealm/libconfig.git libconfig
- cd libconfig
- git checkout 7585cf6
- cd ..
# Download & extract libcurl
- appveyor DownloadFile "http://d.darktech.org/libcurl-7.48.0-WinSSL-zlib-x86-x64.zip" -FileName libcurl.zip
- md libcurl
Expand Down Expand Up @@ -118,18 +113,14 @@ install:
#---------------------------------#

before_build:
- cd c:\projects
# Build libconfig
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( msbuild libconfig\lib\libconfig.vcxproj /p:Configuration=ReleaseStatic /p:Platform=x64 )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( msbuild libconfig\lib\libconfig.vcxproj /p:Configuration=ReleaseStatic /p:Platform=Win32 )

build_script:
- cd c:\projects
# Generate build files for LDC
- md ninja-ldc
- cd ninja-ldc
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( 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 )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=c:\projects\ldc-x86 -DLLVM_ROOT_DIR=c:/projects/llvm-x86 -DLIBCONFIG_INCLUDE_DIR=c:/projects/libconfig/lib -DLIBCONFIG_LIBRARY=c:/projects/libconfig/lib/ReleaseStatic/libconfig.lib ..\ldc )
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=c:\projects\ldc-x64 -DLLVM_ROOT_DIR=c:/projects/llvm-x64 ..\ldc )
- if "%APPVEYOR_JOB_ARCH%"=="x86" ( cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=c:\projects\ldc-x86 -DLLVM_ROOT_DIR=c:/projects/llvm-x86 ..\ldc )
# Build LDC, druntime and phobos
- ninja -j2

Expand Down Expand Up @@ -195,14 +186,16 @@ test_script:
- hello.exe
# Compile the druntime & phobos unit tests
- ninja -j2 druntime-ldc-unittest-debug phobos2-ldc-unittest-debug druntime-ldc-unittest phobos2-ldc-unittest
# Execute dmd-testsuite
# Run dmd-testsuite
- if "%APPVEYOR_JOB_ARCH%"=="x64" ( set OS=Win_64) else ( set OS=Win_32)
- set DMD_TESTSUITE_MAKE_ARGS=-j2
- ctest --verbose -R dmd-testsuite
# Execute the LLVM IR tests
- ctest --output-on-failure -V -R lit-tests
# Execute the unit tests
- ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests"
- ctest -V -R "dmd-testsuite"
# Run lit testsuite
- ctest -V -R "lit-tests"
# Build and run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Link and run Phobos & druntime unittest runners
- ctest -j2 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"

#---------------------------------#
# deployment configuration #
Expand Down
11 changes: 6 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:

override:
- sudo apt-get remove clang llvm
- sudo apt-get install libconfig++8-dev libedit-dev
- sudo apt-get install libedit-dev
- sudo apt-get install llvm-4.0 llvm-4.0-dev clang-4.0
- pip install --user lit
post:
Expand Down Expand Up @@ -63,9 +63,10 @@ test:
override:
- make -j2 phobos2-ldc-unittest-debug phobos2-ldc-unittest
- make -j3 druntime-ldc-unittest-debug druntime-ldc-unittest
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest --verbose -R "dmd-testsuite"
- ctest --output-on-failure -V -R "lit-tests"
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests"
- CC="" DMD_TESTSUITE_MAKE_ARGS=-j3 ctest -V -R "dmd-testsuite"
- ctest -V -R "lit-tests"
- ctest --output-on-failure -R "ldc2-unittest"
- ctest -j3 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"

# To add more value the test results could be collected, see https://circleci.com/docs/test-metadata
# A way how to convert the ctest output is described here:
Expand All @@ -75,7 +76,7 @@ test:
# The containers were started but only the tests from container 0 were run.
# Containers 1-3 also started the tests but stop with the message
# "No tests were found!!!"
#
#
# - ? |
# echo $CIRCLE_NODE_INDEX
# case $CIRCLE_NODE_INDEX in
Expand Down
15 changes: 0 additions & 15 deletions cmake/Modules/FindLibConfig.cmake

This file was deleted.

Loading