diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a7f3e7a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +# CMake configuration for ttmath +cmake_minimum_required (VERSION 3.0) +project(ttmath) +enable_testing() +include_directories(${ttmath_SOURCE_DIR}) +add_subdirectory(samples) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 0000000..cf035a8 --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,16 @@ +# CMake configuration for ttmath/samples + +# Building with Visual C++ x86_64 needs to compile the asm utilities first +if (MSVC AND "x${CMAKE_VS_PLATFORM_NAME}" STREQUAL "xx64") + set(TTMATH_MSVC64_ASM ttmathuint_x86_64_msvc.asm) + enable_language(ASM_MASM) + message(STATUS "Enabled MASM to compile '${TTMATH_MSVC64_ASM}'") + set(TTMATH_SRC_ASM ${ttmath_SOURCE_DIR}/ttmath/${TTMATH_MSVC64_ASM}) +endif() + +set(SAMPLES big big2 int uint parser) +foreach(sample ${SAMPLES}) + add_executable(${sample} ${sample}.cpp ${TTMATH_SRC_ASM}) + # Allow to run all utilities at once as a test + add_test(${sample} ${sample}) +endforeach() \ No newline at end of file