1
0
forked from Alepha/Alepha

A lot of progress towards unifying the build system.

This commit is contained in:
2023-10-12 18:11:51 -04:00
parent eb803ee5e6
commit 57b68ef8a4
15 changed files with 54 additions and 28 deletions

View File

@ -0,0 +1 @@
unit_test( 0 )

View File

@ -1,3 +0,0 @@
CXXFLAGS+= -std=c++17 -I ../
all: 0

View File

@ -1,14 +1,29 @@
cmake_minimum_required( VERSION 3.25 ) cmake_minimum_required( VERSION 3.25 )
project( Alepha ) project( Alepha )
add_compile_options( -I . ; -std=c++20 ) include( cmake/rules.cmake )
set( VERBOSE 1 )
set( CMAKE_VERBOSE_MAKEFILE true )
file( CREATE_LINK ${CMAKE_SOURCE_DIR} Alepha SYMBOLIC )
add_library( alepha SHARED Console.cpp ProgramOptions.cpp string_algorithms.cpp word_wrap.cpp ) # The core alepha library:
add_library( alepha SHARED
Console.cpp
ProgramOptions.cpp
string_algorithms.cpp
word_wrap.cpp
)
# Everything else depends upon it
link_libraries( alepha ) link_libraries( alepha )
# The subdirs to build
add_subdirectory( Meta )
add_subdirectory( Reflection )
# The local subdir tests to build
add_subdirectory( AutoRAII.test )
add_subdirectory( comparisons.test )
add_subdirectory( Exception.test )
# Sample applications
add_executable( example example.cc ) add_executable( example example.cc )

View File

@ -0,0 +1 @@
unit_test( exception )

View File

@ -1,9 +0,0 @@
CXXFLAGS+= -std=c++2a -I ../
CXXFLAGS+= -g -O0
CXX=g++
CXXFLAGS+= -Wno-inline-namespace-reopened-noninline
CXXFLAGS+= -Wno-unused-comparison
CXXFLAGS+= -DAlepha=MyProject_Alepha
all: exception

1
Meta/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
add_subdirectory( Meta.test )

View File

@ -1,3 +0,0 @@
CXXFLAGS+= -std=c++17 -I ../
all: test

View File

@ -0,0 +1 @@
unit_test( traits )

View File

@ -0,0 +1 @@
add_subdirectory( tuplizeAggregate.test )

View File

@ -0,0 +1 @@
unit_test( 0 )

View File

@ -1,4 +0,0 @@
CXXFLAGS+= -std=c++17 -I .
CXXFLAGS+= -g -O0
all: 0

27
cmake/rules.cmake Normal file
View File

@ -0,0 +1,27 @@
#cmake_policy( SET CMP0002 OLD )
add_compile_options( -I ${CMAKE_BINARY_DIR} ; -std=c++20 )
list( APPEND CMAKE_CTEST_ARGUMENTS "-VV" )
set( VERBOSE 1 )
set( CMAKE_VERBOSE_MAKEFILE true )
file( CREATE_LINK ${CMAKE_SOURCE_DIR} Alepha SYMBOLIC )
include(CTest)
function( unit_test TEST_NAME )
get_filename_component( TEST_DOMAIN ${CMAKE_CURRENT_SOURCE_DIR} NAME )
set( FULL_TEST_NAME ${TEST_DOMAIN}.${TEST_NAME} )
add_executable( ${FULL_TEST_NAME} ${TEST_NAME}.cc )
add_test( ${FULL_TEST_NAME} ${FULL_TEST_NAME} )
endfunction( unit_test )

View File

@ -0,0 +1 @@
unit_test( 0 )

View File

@ -1,4 +0,0 @@
CXXFLAGS+= -std=c++17 -I ../
CXXFLAGS+= -g -O0
all: 0