diff --git a/CMakeLists.txt b/CMakeLists.txt index d2acefc01..4243f6676 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,5 +5,11 @@ project(evmjit) set_property(GLOBAL PROPERTY USE_FOLDERS ON) +# LLVM +find_package(LLVM REQUIRED CONFIG) +message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") +message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") + add_subdirectory(libevmjit) -add_subdirectory(libevmjit-cpp) \ No newline at end of file +add_subdirectory(libevmjit-cpp) +add_subdirectory(evmcc) \ No newline at end of file diff --git a/evmcc/CMakeLists.txt b/evmcc/CMakeLists.txt index a087539dc..e11baabbb 100644 --- a/evmcc/CMakeLists.txt +++ b/evmcc/CMakeLists.txt @@ -1,12 +1,15 @@ cmake_policy(SET CMP0015 NEW) -aux_source_directory(. SRC_LIST) +project(evmjit CXX) -include_directories(..) +file(GLOB SOURCES "*.cpp") +file(GLOB HEADERS "*.h") +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "tools") set(EXECUTABLE evmcc) +add_executable(${EXECUTABLE} ${HEADERS} ${SOURCES}) -add_executable(${EXECUTABLE} ${SRC_LIST}) +include_directories(../..) target_link_libraries(${EXECUTABLE} boost_program_options) target_link_libraries(${EXECUTABLE} devcore) @@ -31,18 +34,12 @@ else () endif () # LLVM specific commands - find_package(LLVM REQUIRED CONFIG) - -message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") -message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") - include_directories(${LLVM_INCLUDE_DIRS}) add_definitions(${LLVM_DEFINITIONS}) llvm_map_components_to_libnames(llvm_libs bitwriter) target_link_libraries(evmcc ${llvm_libs}) - # end of LLVM specific commands diff --git a/libevmjit-cpp/CMakeLists.txt b/libevmjit-cpp/CMakeLists.txt index 30035243b..1750b04ce 100644 --- a/libevmjit-cpp/CMakeLists.txt +++ b/libevmjit-cpp/CMakeLists.txt @@ -1,14 +1,17 @@ - -project(evmjit-cpp LANGUAGES CXX) +project(evmjit-cpp CXX) set(SOURCES - Ext.cpp Ext.h - Runtime.cpp Runtime.h - VM.cpp VM.h + Env.cpp + JitVM.cpp JitVM.h ) -source_group("" FILES ${SOURCES}) - add_library(${PROJECT_NAME} ${SOURCES}) -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs") +include_directories(../..) + +find_package(LLVM REQUIRED CONFIG) +include_directories(${LLVM_INCLUDE_DIRS}) +add_definitions(${LLVM_DEFINITIONS}) + +source_group("" FILES ${SOURCES}) +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs") \ No newline at end of file diff --git a/libevmjit/CMakeLists.txt b/libevmjit/CMakeLists.txt index 155a627c1..82ae0d3b1 100644 --- a/libevmjit/CMakeLists.txt +++ b/libevmjit/CMakeLists.txt @@ -1,13 +1,9 @@ - -project(evmjit LANGUAGES CXX) +project(evmjit CXX) file(GLOB SOURCES "*.cpp") file(GLOB HEADERS "*.h") -source_group("" FILES ${SOURCES}) -source_group("" FILES ${HEADERS}) add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) -set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs") #include_directories(..) @@ -31,17 +27,15 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs") # target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) # endif () - -# LLVM +# LLVM specific commands find_package(LLVM REQUIRED CONFIG) -# message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") -# message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") - include_directories(${LLVM_INCLUDE_DIRS}) -# add_definitions(${LLVM_DEFINITIONS}) +add_definitions(${LLVM_DEFINITIONS}) llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen) target_link_libraries(${PROJECT_NAME} ${LLVM_LIBS}) +# end of LLVM specific commands + # Boost find_package(Boost REQUIRED) @@ -50,3 +44,8 @@ include_directories(${Boost_INCLUDE_DIRS}) #install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) #install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) + + +source_group("" FILES ${HEADERS}) +source_group("" FILES ${SOURCES}) +set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs")