2021-09-27 13:05:15 +01:00
|
|
|
# Serene programming language.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2019-2021 Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
# SOFTWARE.
|
2021-03-23 22:31:20 +00:00
|
|
|
|
2020-07-10 18:06:26 +01:00
|
|
|
# Make an automatic library - will be static or dynamic based on user setting
|
2021-03-28 23:14:32 +01:00
|
|
|
add_library(serene
|
2021-04-05 19:02:30 +01:00
|
|
|
exprs/symbol.cpp
|
|
|
|
exprs/list.cpp
|
2021-04-11 00:02:56 +01:00
|
|
|
exprs/number.cpp
|
2021-04-17 19:36:25 +01:00
|
|
|
exprs/expression.cpp
|
|
|
|
exprs/def.cpp
|
2021-04-24 14:39:43 +01:00
|
|
|
exprs/fn.cpp
|
2021-05-09 12:21:26 +01:00
|
|
|
exprs/call.cpp
|
|
|
|
|
|
|
|
context.cpp
|
2020-07-16 15:48:06 +01:00
|
|
|
serene.cpp
|
2020-07-25 15:49:19 +01:00
|
|
|
namespace.cpp
|
2021-08-17 08:52:26 +01:00
|
|
|
jit.cpp
|
2021-09-05 15:57:28 +01:00
|
|
|
source_mgr.cpp
|
2021-09-12 14:01:02 +01:00
|
|
|
diagnostics.cpp
|
2021-03-28 23:14:32 +01:00
|
|
|
|
|
|
|
# Reader
|
|
|
|
reader/reader.cpp
|
|
|
|
reader/location.cpp
|
2021-04-17 00:18:13 +01:00
|
|
|
reader/semantics.cpp
|
2021-03-28 23:14:32 +01:00
|
|
|
|
2021-04-19 23:34:39 +01:00
|
|
|
# Errors
|
|
|
|
errors/error.cpp
|
|
|
|
|
2021-03-28 23:14:32 +01:00
|
|
|
# IR
|
2021-08-15 12:06:56 +01:00
|
|
|
slir/slir.cpp
|
2021-06-08 22:01:08 +01:00
|
|
|
slir/dialect.cpp
|
|
|
|
slir/value_op.cpp
|
2021-06-13 22:40:58 +01:00
|
|
|
slir/generatable.cpp
|
|
|
|
slir/utils.cpp
|
2021-06-23 20:34:57 +01:00
|
|
|
slir/ops.cpp
|
2021-06-11 22:06:44 +01:00
|
|
|
passes/slir_lowering.cpp
|
2021-06-17 13:19:19 +01:00
|
|
|
passes/to_llvm_dialect.cpp
|
2021-09-27 13:05:15 +01:00
|
|
|
)
|
|
|
|
#${HEADER_LIST}
|
2021-03-28 23:14:32 +01:00
|
|
|
|
2021-03-25 00:53:44 +00:00
|
|
|
# Make sure to generate files related to the dialects first
|
2021-03-28 23:14:32 +01:00
|
|
|
add_dependencies(serene SereneDialectGen)
|
2020-07-10 18:06:26 +01:00
|
|
|
|
2021-04-07 19:56:54 +01:00
|
|
|
if (CPP_20_SUPPORT)
|
|
|
|
target_compile_features(serene PUBLIC cxx_std_20)
|
|
|
|
else()
|
2021-04-11 18:36:00 +01:00
|
|
|
target_compile_features(serene PUBLIC cxx_std_17)
|
2021-04-07 19:56:54 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
2020-07-10 18:06:26 +01:00
|
|
|
# We need this directory, and users of our library will need it too
|
2021-09-27 13:05:15 +01:00
|
|
|
target_include_directories(serene PUBLIC ${INCLUDE_DIR})
|
2021-03-28 23:14:32 +01:00
|
|
|
target_include_directories(serene PUBLIC ${PROJECT_BINARY_DIR})
|
2020-07-10 18:06:26 +01:00
|
|
|
|
2021-06-17 13:19:19 +01:00
|
|
|
|
2020-07-10 18:06:26 +01:00
|
|
|
source_group(TREE "${INCLUDE_DIR}" PREFIX "Header Files" FILES ${HEADER_LIST})
|
2021-03-28 23:14:32 +01:00
|
|
|
#target_precompile_headers(serene PRIVATE ${HEADER_LIST})
|
2021-06-17 13:19:19 +01:00
|
|
|
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
|
|
|
|
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
|
|
|
|
# This depends on (header only) boost
|
|
|
|
target_link_libraries(serene
|
2021-09-27 13:05:15 +01:00
|
|
|
PUBLIC
|
2021-06-17 13:19:19 +01:00
|
|
|
${dialect_libs}
|
|
|
|
${conversion_libs}
|
|
|
|
MLIRAnalysis
|
|
|
|
MLIRCallInterfaces
|
|
|
|
MLIRCastInterfaces
|
|
|
|
MLIRExecutionEngine
|
|
|
|
MLIRIR
|
|
|
|
MLIRLLVMToLLVMIRTranslation
|
|
|
|
MLIRParser
|
|
|
|
MLIRPass
|
|
|
|
MLIRSideEffectInterfaces
|
|
|
|
MLIRTargetLLVMIRExport
|
|
|
|
MLIRTransforms
|
2021-08-17 08:52:26 +01:00
|
|
|
${llvm_libs})
|
|
|
|
|
2021-09-05 15:57:28 +01:00
|
|
|
# target_precompile_headers(serene
|
|
|
|
# PRIVATE
|
|
|
|
# <serene_precompiles.h>
|
|
|
|
# )
|