Mov out libserene and serene-tblgen to the root

This commit is contained in:
Sameer Rahmani 2022-02-17 15:02:08 +00:00
parent 7afbbb5112
commit 58274835b1
79 changed files with 33 additions and 21 deletions

View File

@ -59,8 +59,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Setup the source locations
set(INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
set(SRC_DIR ${CMAKE_SOURCE_DIR}/src)
set(INCLUDE_DIR ${CMAKE_SOURCE_DIR}/libserene/include)
if(SERENE_ENABLE_TIDY)
find_program(CLANG_TIDY_PATH NAMES clang-tidy REQUIRED)
@ -203,12 +202,14 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Serene Setup ===================================
include_directories(${PROJECT_SOURCE_DIR}/include)
# We don't want the generated files from table gen
# to be treated as local since the contain warnings
include_directories(SYSTEM ${PROJECT_BINARY_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
#TODO: Can we move it to the libserene cmake somehow?
include_directories(SYSTEM ${PROJECT_BINARY_DIR}/libserene/include/)
include_directories(${PROJECT_BINARY_DIR}/include/)
# Make sure that our source directory is on the current cmake module path so
# that we can include cmake files from this directory.
@ -218,14 +219,15 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
)
include(tablegen-serene)
# Create the tools we use to compile Serene
add_subdirectory(tools)
add_subdirectory(serene-tblgen)
# The compiled library code is here
add_subdirectory(src)
# The executable code is here
add_subdirectory(include)
# The compiled library code is here
add_subdirectory(libserene)
if (SERENE_ENABLE_DOCS)
add_subdirectory(docs)

View File

@ -14,4 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_subdirectory(tbl-srn)
include_directories(${INCLUD_DIR})
add_subdirectory(include)
add_subdirectory(lib)
# Testing only available if this is the main app
# Emergency override SERENE_CMAKE_BUILD_TESTING provided as well
if(SERENE_BUILD_TESTING)
message("Build the test binary")
add_subdirectory(tests)
endif()

View File

@ -99,7 +99,7 @@ private:
SrcBuffer() = default;
SrcBuffer(SrcBuffer &&) noexcept;
SrcBuffer(const SrcBuffer &) = delete;
SrcBuffer(const SrcBuffer &) = delete;
SrcBuffer &operator=(const SrcBuffer &) = delete;
~SrcBuffer();
};
@ -128,12 +128,12 @@ private:
static std::string convertNamespaceToPath(std::string ns_name);
public:
SourceMgr() = default;
SourceMgr(const SourceMgr &) = delete;
SourceMgr() = default;
SourceMgr(const SourceMgr &) = delete;
SourceMgr &operator=(const SourceMgr &) = delete;
SourceMgr(SourceMgr &&) = default;
SourceMgr &operator=(SourceMgr &&) = default;
~SourceMgr() = default;
SourceMgr &operator=(SourceMgr &&) = default;
~SourceMgr() = default;
/// Set the `loadPaths` to the given \p dirs. `loadPaths` is a vector of
/// directories that Serene will look in order to find a file that constains a

View File

@ -14,16 +14,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
include_directories(${PROJECT_SOURCE_DIR}/tools/tbl-srn)
include_directories(${PROJECT_SOURCE_DIR}/serene-tblgen)
add_executable(tbl-srn
add_executable(serene-tblgen
serene/errors-backend.cpp
main.cpp
)
add_executable(SereneTablegen ALIAS tbl-srn)
add_executable(SereneTablegen ALIAS serene-tblgen)
set(SERENE_TABLEGEN $<TARGET_FILE:tbl-srn> CACHE
set(SERENE_TABLEGEN $<TARGET_FILE:serene-tblgen> CACHE
STRING "Native TableGen executable. Saves building one when cross-compiling.")
set(SERENE_TABLEGEN_EXE SereneTablegen
@ -31,5 +31,5 @@ set(SERENE_TABLEGEN_EXE SereneTablegen
set(SERENE_TABLEGEN_TARGET SereneTablegen CACHE
STRING "Target name for the tbl-srn")
target_link_libraries(tbl-srn PRIVATE LLVMTableGenGlobalISel ${llvm_libs})
set_target_properties(tbl-srn PROPERTIES FOLDER "tbl-srn")
target_link_libraries(serene-tblgen PRIVATE LLVMTableGenGlobalISel ${llvm_libs})
set_target_properties(serene-tblgen PROPERTIES FOLDER "serene-tblgen")

View File

@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
add_subdirectory(libserene)
add_subdirectory(serenec)
add_subdirectory(serene-repl)