Skip to content

Commit

Permalink
Rename LPYTHON macro define to LCOMPILERS
Browse files Browse the repository at this point in the history
  • Loading branch information
Thirumalai-Shaktivel committed Jun 5, 2022
1 parent 7912a1b commit 61b1ea1
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_SOURCE_DIR}/cmake/UserOverride.cmake)

# We don't execute this if we have a tarball
if (LPYTHON_BUILD_ALL)
if (LCOMPILERS_BUILD_ALL)
execute_process(COMMAND "build0.sh")
endif()

Expand All @@ -24,11 +24,11 @@ if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR
endif ()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(LPYTHON_CXX_NO_RTTI_FLAG "-fno-rtti")
set(LCOMPILERS_CXX_NO_RTTI_FLAG "-fno-rtti")
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
set(LPYTHON_CXX_NO_RTTI_FLAG "-fno-rtti")
set(LCOMPILERS_CXX_NO_RTTI_FLAG "-fno-rtti")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(LPYTHON_CXX_NO_RTTI_FLAG "/GR-")
set(LCOMPILERS_CXX_NO_RTTI_FLAG "/GR-")
endif ()


Expand Down Expand Up @@ -70,8 +70,8 @@ endif()
set(WITH_LCOMPILERS_ASSERT ${WITH_LCOMPILERS_ASSERT_DEFAULT}
CACHE BOOL "Enable LCOMPILERS_ASSERT macro")

# LPYTHON_STATIC_BIN
set(LPYTHON_STATIC_BIN no CACHE BOOL "Build LPython as a static binary")
# LCOMPILERS_STATIC_BIN
set(LCOMPILERS_STATIC_BIN no CACHE BOOL "Build LPython as a static binary")

# WITH_LCOMPILERS_BINARY_MODFILES
set(WITH_LCOMPILERS_BINARY_MODFILES YES
Expand All @@ -89,7 +89,7 @@ set(WITH_LLVM no CACHE BOOL "Build with LLVM support")
set(WITH_TARGET_AARCH64 no CACHE BOOL "Enable target AARCH64")
set(WITH_TARGET_X86 no CACHE BOOL "Enable target X86")
if (WITH_LLVM)
set(LPYTHON_LLVM_COMPONENTS core support mcjit orcjit native asmparser asmprinter)
set(LCOMPILERS_LLVM_COMPONENTS core support mcjit orcjit native asmparser asmprinter)
find_package(LLVM REQUIRED)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
Expand All @@ -108,7 +108,7 @@ if (WITH_LLVM)
message(FATAL_ERROR "The selected LLVM library doesn't have support for AArch64 targets")
endif()

list(APPEND LPYTHON_LLVM_COMPONENTS aarch64info aarch64utils aarch64desc aarch64asmparser aarch64codegen aarch64disassembler)
list(APPEND LCOMPILERS_LLVM_COMPONENTS aarch64info aarch64utils aarch64desc aarch64asmparser aarch64codegen aarch64disassembler)
add_definitions("-DHAVE_TARGET_AARCH64=1")
endif()

Expand All @@ -117,12 +117,12 @@ if (WITH_LLVM)
message(FATAL_ERROR "The selected LLVM library doesn't have support for X86 targets")
endif()

list(APPEND LPYTHON_LLVM_COMPONENTS x86info x86desc x86codegen x86asmparser x86disassembler)
list(APPEND LCOMPILERS_LLVM_COMPONENTS x86info x86desc x86codegen x86asmparser x86disassembler)
add_definitions("-DHAVE_TARGET_X86=1")
endif()

llvm_map_components_to_libnames(llvm_libs ${LPYTHON_LLVM_COMPONENTS})
unset(LPYTHON_LLVM_COMPONENTS)
llvm_map_components_to_libnames(llvm_libs ${LCOMPILERS_LLVM_COMPONENTS})
unset(LCOMPILERS_LLVM_COMPONENTS)

add_library(p::llvm INTERFACE IMPORTED)
set_property(TARGET p::llvm PROPERTY INTERFACE_INCLUDE_DIRECTORIES
Expand All @@ -132,7 +132,7 @@ if (WITH_LLVM)
#set_property(TARGET p::llvm PROPERTY INTERFACE_COMPILE_OPTIONS
# ${LLVM_DEFINITIONS})
set_property(TARGET p::llvm PROPERTY INTERFACE_COMPILE_OPTIONS
$<$<COMPILE_LANGUAGE:CXX>:${LPYTHON_CXX_NO_RTTI_FLAG}>)
$<$<COMPILE_LANGUAGE:CXX>:${LCOMPILERS_CXX_NO_RTTI_FLAG}>)
set_property(TARGET p::llvm PROPERTY INTERFACE_LINK_LIBRARIES
${llvm_libs})
if (MSVC)
Expand Down Expand Up @@ -251,7 +251,7 @@ else ()
endif ()
message("Installation prefix: ${CMAKE_INSTALL_PREFIX}")
message("WITH_LCOMPILERS_ASSERT: ${WITH_LCOMPILERS_ASSERT}")
message("LPYTHON_STATIC_BIN: ${LPYTHON_STATIC_BIN}")
message("LCOMPILERS_STATIC_BIN: ${LCOMPILERS_STATIC_BIN}")
message("WITH_STACKTRACE: ${WITH_STACKTRACE}")
message("WITH_UNWIND: ${WITH_UNWIND}")
message("WITH_BFD: ${WITH_BFD}")
Expand Down
2 changes: 1 addition & 1 deletion build1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -x
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DWITH_LLVM=yes \
-DLPYTHON_BUILD_ALL=yes \
-DLCOMPILERS_BUILD_ALL=yes \
-DWITH_STACKTRACE=yes \
-DWITH_LCOMPILERS_BINARY_MODFILES=no \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH_LPYTHON;$CONDA_PREFIX" \
Expand Down
2 changes: 1 addition & 1 deletion src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_executable(lpython lpython.cpp)
target_include_directories(lpython PRIVATE "tpl")
target_link_libraries(lpython lpython_lib)
if (LPYTHON_STATIC_BIN)
if (LCOMPILERS_STATIC_BIN)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Link statically on Linux with gcc or clang
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
Expand Down
4 changes: 2 additions & 2 deletions src/lpython/parser/parser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_PARSER_PARSER_H
#define LPYTHON_PARSER_PARSER_H
#ifndef LCOMPILERS_PARSER_PARSER_H
#define LCOMPILERS_PARSER_PARSER_H

#include <libasr/containers.h>
#include <libasr/diagnostics.h>
Expand Down
6 changes: 3 additions & 3 deletions src/lpython/parser/parser_exception.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_PARSER_PARSER_EXCEPTION_H
#define LPYTHON_PARSER_PARSER_EXCEPTION_H
#ifndef LCOMPILERS_PARSER_PARSER_EXCEPTION_H
#define LCOMPILERS_PARSER_PARSER_EXCEPTION_H

#include <libasr/exception.h>
#include <libasr/diagnostics.h>
Expand Down Expand Up @@ -46,4 +46,4 @@ namespace parser_local {
}


#endif // LPYTHON_PARSER_PARSER_EXCEPTION_H
#endif // LCOMPILERS_PARSER_PARSER_EXCEPTION_H
6 changes: 3 additions & 3 deletions src/lpython/parser/parser_stype.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_PARSER_STYPE_H
#define LPYTHON_PARSER_STYPE_H
#ifndef LCOMPILERS_PARSER_STYPE_H
#define LCOMPILERS_PARSER_STYPE_H

#include <cstring>
#include <lpython/python_ast.h>
Expand Down Expand Up @@ -62,4 +62,4 @@ typedef struct LCompilers::Location YYLTYPE;
#define YYLTYPE_IS_TRIVIAL 0


#endif // LPYTHON_PARSER_STYPE_H
#endif // LCOMPILERS_PARSER_STYPE_H
4 changes: 2 additions & 2 deletions src/lpython/parser/semantics.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_PARSER_SEMANTICS_H
#define LPYTHON_PARSER_SEMANTICS_H
#ifndef LCOMPILERS_PARSER_SEMANTICS_H
#define LCOMPILERS_PARSER_SEMANTICS_H

/*
This header file contains parser semantics: how the AST classes get
Expand Down
6 changes: 3 additions & 3 deletions src/lpython/parser/tokenizer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_SRC_PARSER_TOKENIZER_H
#define LPYTHON_SRC_PARSER_TOKENIZER_H
#ifndef LCOMPILERS_SRC_PARSER_TOKENIZER_H
#define LCOMPILERS_SRC_PARSER_TOKENIZER_H

#include <libasr/exception.h>
#include <libasr/alloc.h>
Expand Down Expand Up @@ -88,4 +88,4 @@ std::string pickle_token(int token, const YYSTYPE &yystype);

} // namespace LCompilers

#endif // LPYTHON_SRC_PARSER_TOKENIZER_H
#endif // LCOMPILERS_SRC_PARSER_TOKENIZER_H
6 changes: 3 additions & 3 deletions src/lpython/semantics/python_attribute_eval.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_ATTRIBUTE_EVAL_H
#define LPYTHON_ATTRIBUTE_EVAL_H
#ifndef LCOMPILERS_ATTRIBUTE_EVAL_H
#define LCOMPILERS_ATTRIBUTE_EVAL_H


#include <libasr/asr.h>
Expand Down Expand Up @@ -313,4 +313,4 @@ struct AttributeHandler {

} // namespace LCompilers

#endif /* LPYTHON_ATTRIBUTE_EVAL_H */
#endif /* LCOMPILERS_ATTRIBUTE_EVAL_H */
6 changes: 3 additions & 3 deletions src/lpython/semantics/python_comptime_eval.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LPYTHON_SEMANTICS_COMPTIME_EVAL_H
#define LPYTHON_SEMANTICS_COMPTIME_EVAL_H
#ifndef LCOMPILERS_SEMANTICS_COMPTIME_EVAL_H
#define LCOMPILERS_SEMANTICS_COMPTIME_EVAL_H

#include <complex>
#include <string>
Expand Down Expand Up @@ -842,4 +842,4 @@ struct PythonIntrinsicProcedures {

} // namespace LCompilers

#endif /* LPYTHON_SEMANTICS_COMPTIME_EVAL_H */
#endif /* LCOMPILERS_SEMANTICS_COMPTIME_EVAL_H */

0 comments on commit 61b1ea1

Please sign in to comment.