Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ file(GLOB_RECURSE SOURCES "src/*.cpp")
# executable
add_executable(yuc ${SOURCES})
link_directories(${LLVM_LIBRARY_DIRS})
target_link_libraries(yuc LLVM)
# CentOS 8 need stdc++fs option
target_link_libraries(yuc LLVM stdc++fs)

# build Yu standard library and examples after generation
add_custom_command(
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Before building YuLang compiler, please make sure you have installed the followi

* `cmake` 3.13 or later
* `llvm` 10.0 or later
* `llvm-devel` for CentOS/RedHat 8, provides the `llvm-config`
* C++ compiler supporting C++17

You may want to check the toolchain configuration in `toolchain.mk`. Then you can build this repository by executing the following command lines:
Expand Down
7 changes: 4 additions & 3 deletions toolchain.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ else
endif

# compile toolchain prefix
LLVM_HOME := /usr/local/opt/llvm/bin
#LLVM_HOME := /usr/local/opt/llvm/bin

# Yu compiler
YUFLAGS := -Werror $(YU_OPT_ARG)
Expand All @@ -23,11 +23,12 @@ export YUC := $(YUC_BIN) $(YUFLAGS)

# LLVM compiler
LLCFLAGS := $(C_OPT_ARG) -filetype=obj
export LLC := $(LLVM_HOME)/llc $(LLCFLAGS)
export LLC := llc $(LLCFLAGS)

# linker
# Ubuntu needs -no-pie option
LDFLAGS :=
export LD := clang $(LDFLAGS)
export LD := clang -no-pie $(LDFLAGS)

# archiver
ARFLAGS := ru
Expand Down