Commit 6034c288 authored by rmrf's avatar rmrf

Start cleaning up tests as well

parent 006fb5e1
cmake_minimum_required(VERSION 2.6)
project(systemc-clang)
# Use C++ standard version to c++17
set(CMAKE_CXX_STANDARD 17)
# Always keep it on
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(systemc-clang)
# Use C++ standard version to c++17
set(CMAKE_CXX_STANDARD 17)
# Always keep it on
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option (USE_SAUTO
option (USE_SAUTO
"Use suspension-automata library." OFF
)
set (ROOT_CPP
set (ROOT_CPP
driver-tooling.cpp
# ToolingTest.cpp
# ToolingTutorial.cpp
# ToolingTest.cpp
# ToolingTutorial.cpp
)
# set (CLANG_SRC_DIR
......@@ -21,10 +21,10 @@ cmake_minimum_required(VERSION 2.6)
# $ENV{LLVM_SRC_DIR}
# )
set (LLVM_BUILD_DIR
set (LLVM_BUILD_DIR
$ENV{LLVM_BUILD_DIR}
)
set (CMAKE_CXX_FLAGS
set (CMAKE_CXX_FLAGS
"$ENV{LLVM_CXX_FLAGS} $ENV{CMAKE_CXX_FLAGS} -DUSE_SAUTO=off"
)
......@@ -35,11 +35,11 @@ if (USE_SAUTO)
endif(USE_SAUTO)
set (LLVM_LD_FLAGS
set (LLVM_LD_FLAGS
"$ENV{LLVM_LD_FLAGS} -lpthread"
)
set (LLVM_LIBS
set (LLVM_LIBS
$ENV{LLVM_LIBS}
)
......@@ -47,7 +47,7 @@ endif(USE_SAUTO)
#LLVMJIT LLVMX86CodeGen LLVMX86AsmParser LLVMX86Disassembler LLVMExecutionEngine LLVMAsmPrinter LLVMSelectionDAG LLVMX86AsmPrinter LLVMX86Info LLVMMCParser LLVMCodeGen LLVMX86Utils LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMTarget LLVMCore LLVMMC LLVMSupport
set (CLANG_LIBS
set (CLANG_LIBS
clangTooling
clangFrontendTool
clangFrontend
......@@ -71,57 +71,56 @@ endif(USE_SAUTO)
)
set (CMAKE_MODULE_LINKER_FLAGS
set (CMAKE_MODULE_LINKER_FLAGS
$ENV{LLVM_LD_FLAGS}
)
set (TARGET
set (TARGET
"systemc-clang"
)
include_directories(
include_directories(
"${LLVM_BUILD_DIR}/include"
src
if (USE_SAUTO)
if (USE_SAUTO)
sauto
endif (USE_SAUTO)
endif (USE_SAUTO)
)
link_directories(
link_directories(
${LLVM_BUILD_DIR}/lib
)
add_subdirectory(src)
add_subdirectory(src)
add_subdirectory(tests)
if (USE_SAUTO)
add_subdirectory(sauto)
endif (USE_SAUTO)
set( SRC_LIB libsystemc-clang)
set( SRC_LIB libsystemc-clang )
if (USE_SAUTO)
set( SAUTO_LIB libsauto )
endif (USE_SAUTO)
add_executable(
add_executable(
${TARGET}
${ROOT_CPP} )
target_link_libraries(${TARGET} ${SRC_LIB})
target_link_libraries(${TARGET} ${SAUTO_LIB})
target_link_libraries(${TARGET} ${SRC_LIB})
target_link_libraries(${TARGET} ${SAUTO_LIB})
foreach (clang_lib ${CLANG_LIBS})
foreach (clang_lib ${CLANG_LIBS})
target_link_libraries( ${TARGET} ${clang_lib} )
endforeach()
endforeach()
foreach (ld_flag ${LLVM_LD_FLAGS})
foreach (ld_flag ${LLVM_LD_FLAGS})
target_link_libraries( ${TARGET} ${ld_flag} )
endforeach()
endforeach()
foreach (llvm_lib ${LLVM_LIBS})
foreach (llvm_lib ${LLVM_LIBS})
target_link_libraries( ${TARGET} ${llvm_lib} )
endforeach()
endforeach()
......@@ -50,7 +50,7 @@ using namespace clang::tooling;
#include "SCuitable/GlobalSuspensionAutomata.h"
#include "SuspensionAutomata.h"
#include "Utility.h"
#include "FindTemplateParameters.h" \
#include "FindTemplateParameters.h"
using namespace clang;
......