Browse Source

CMakeLists.txt cleanup (in progress)

cl-refactor
Artur Zawłocki 10 years ago
parent
commit
c9f5694a28
  1. 8
      CMakeLists.txt
  2. 15
      evmcc/CMakeLists.txt
  3. 19
      libevmjit-cpp/CMakeLists.txt
  4. 21
      libevmjit/CMakeLists.txt

8
CMakeLists.txt

@ -5,5 +5,11 @@ project(evmjit)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) 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)
add_subdirectory(libevmjit-cpp) add_subdirectory(libevmjit-cpp)
add_subdirectory(evmcc)

15
evmcc/CMakeLists.txt

@ -1,12 +1,15 @@
cmake_policy(SET CMP0015 NEW) 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) 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} boost_program_options)
target_link_libraries(${EXECUTABLE} devcore) target_link_libraries(${EXECUTABLE} devcore)
@ -31,18 +34,12 @@ else ()
endif () endif ()
# LLVM specific commands # LLVM specific commands
find_package(LLVM REQUIRED CONFIG) 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}) include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS}) add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs bitwriter) llvm_map_components_to_libnames(llvm_libs bitwriter)
target_link_libraries(evmcc ${llvm_libs}) target_link_libraries(evmcc ${llvm_libs})
# end of LLVM specific commands # end of LLVM specific commands

19
libevmjit-cpp/CMakeLists.txt

@ -1,14 +1,17 @@
project(evmjit-cpp CXX)
project(evmjit-cpp LANGUAGES CXX)
set(SOURCES set(SOURCES
Ext.cpp Ext.h Env.cpp
Runtime.cpp Runtime.h JitVM.cpp JitVM.h
VM.cpp VM.h
) )
source_group("" FILES ${SOURCES})
add_library(${PROJECT_NAME} ${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")

21
libevmjit/CMakeLists.txt

@ -1,13 +1,9 @@
project(evmjit CXX)
project(evmjit LANGUAGES CXX)
file(GLOB SOURCES "*.cpp") file(GLOB SOURCES "*.cpp")
file(GLOB HEADERS "*.h") file(GLOB HEADERS "*.h")
source_group("" FILES ${SOURCES})
source_group("" FILES ${HEADERS})
add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS})
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs")
#include_directories(..) #include_directories(..)
@ -31,17 +27,15 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs")
# target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) # target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT})
# endif () # endif ()
# LLVM specific commands
# LLVM
find_package(LLVM REQUIRED CONFIG) 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}) 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) llvm_map_components_to_libnames(LLVM_LIBS core support mcjit x86asmparser x86codegen)
target_link_libraries(${PROJECT_NAME} ${LLVM_LIBS}) target_link_libraries(${PROJECT_NAME} ${LLVM_LIBS})
# end of LLVM specific commands
# Boost # Boost
find_package(Boost REQUIRED) find_package(Boost REQUIRED)
@ -50,3 +44,8 @@ include_directories(${Boost_INCLUDE_DIRS})
#install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) #install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
#install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) #install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} )
source_group("" FILES ${HEADERS})
source_group("" FILES ${SOURCES})
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "libs")

Loading…
Cancel
Save