Very basic stuff working on linux 32-bit with dmd and phobos2.
3
.hgignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
.*\.cbp
|
||||
.*\.layout
|
||||
.*\.swp
|
5
cmaked/CMakeDCompilerABI.d
Normal file
|
@ -0,0 +1,5 @@
|
|||
int main( string[] args )
|
||||
{
|
||||
int require = 0;
|
||||
return require;
|
||||
}
|
33
cmaked/CMakeDCompilerId.d.in
Normal file
|
@ -0,0 +1,33 @@
|
|||
#elif defined(__dmd__)
|
||||
# define COMPILER_ID "DMD"
|
||||
|
||||
#elif defined(__gdc__)
|
||||
# define COMPILER_ID "gdc"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
|
||||
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ID_VOID_MAIN
|
||||
void main() {}
|
||||
#else
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
require += info_arch[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
#endif
|
9
tests/CMakeLists.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Tell cmake our project only concerns the D language.
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
PROJECT (CMAKED2_TESTS D)
|
||||
ADD_DEFINITIONS( -w -wi )
|
||||
enable_testing()
|
||||
ADD_SUBDIRECTORY (app_1)
|
||||
ADD_SUBDIRECTORY (app_2)
|
||||
ADD_SUBDIRECTORY (lib_1)
|
||||
ADD_SUBDIRECTORY (app_3)
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 97 B After Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 92 B After Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 55 B After Width: | Height: | Size: 55 B |
Before Width: | Height: | Size: 63 B After Width: | Height: | Size: 63 B |
Before Width: | Height: | Size: 65 B After Width: | Height: | Size: 65 B |
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 63 B After Width: | Height: | Size: 63 B |
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B |
2
tests/app_1/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
ADD_EXECUTABLE( app_1 app_1.d )
|
||||
ADD_TEST( app_1 app_1 )
|
7
tests/app_1/app_1.d
Normal file
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
Barebones app, depends on nothing.
|
||||
*/
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
2
tests/app_2/CMakeLists.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
ADD_EXECUTABLE( app_2 app_2.d )
|
||||
ADD_TEST( app_2 app_2 )
|
8
tests/app_2/app_2.d
Normal file
|
@ -0,0 +1,8 @@
|
|||
// barebones app, depends on the standard library
|
||||
import std.stdio;
|
||||
|
||||
int main()
|
||||
{
|
||||
writeln( "Hello World!" );
|
||||
return 0;
|
||||
}
|
5
tests/app_3/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
ADD_EXECUTABLE ( app_3 app_3.d )
|
||||
INCLUDE_DIRECTORIES( app3 ${PROJECT_SOURCE_DIR} )
|
||||
MESSAGE( "Project source dir is ${PROJECT_SOURCE_DIR}" )
|
||||
TARGET_LINK_LIBRARIES ( app_3 lib_1 )
|
||||
ADD_TEST( app_3 app_3 )
|
9
tests/app_3/app_3.d
Normal file
|
@ -0,0 +1,9 @@
|
|||
import lib_1.lib_1;
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 1;
|
||||
int y = lib_1_func( x );
|
||||
assert( y == x + 1 );
|
||||
return 0;
|
||||
}
|
1
tests/lib_1/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
ADD_LIBRARY (lib_1 lib_1.d)
|
6
tests/lib_1/lib_1.d
Normal file
|
@ -0,0 +1,6 @@
|
|||
module lib_1.lib_1_func;
|
||||
|
||||
int lib_1_func( uint x )
|
||||
{
|
||||
return( x + 1 );
|
||||
}
|