Skip to content

Commit

Permalink
Revert "Don't include or link from impure paths with Nix"
Browse files Browse the repository at this point in the history
This reverts commit 5cb642a.
  • Loading branch information
ttuegel committed Nov 26, 2020
1 parent 6329d32 commit 7aa4718
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fl

if(APPLE)
set(BACKEND_TARGET_TRIPLE "x86_64-apple-darwin")
if(NOT NIX)
include_directories(AFTER SYSTEM /usr/local/include)
link_directories(AFTER /usr/local/lib)
set(ENV{PKG_CONFIG_PATH} "/usr/local/opt/libffi/lib/pkgconfig")
endif() # NOT NIX
else()
set(BACKEND_TARGET_TRIPLE "x86_64-unknown-linux-gnu")
endif() # APPLE
endif()

find_package(PkgConfig REQUIRED)
pkg_check_modules(FFI REQUIRED libffi)
Expand Down Expand Up @@ -101,12 +99,10 @@ macro(kllvm_add_tool name)

# Link against LLVM libraries
llvm_config(${name})
if(APPLE AND NOT NIX)
if(APPLE)
target_link_libraries(${name} PUBLIC "-ljemalloc" "-Wl,-rpath /usr/local/lib" "-ldl")
elseif(NOT NIX)
target_link_libraries(${name} PUBLIC "-ljemalloc" "-Wl,-rpath=/usr/local/lib" "-ldl")
else()
target_link_libraries(${name} PUBLIC "-ljemalloc" "-ldl")
target_link_libraries(${name} PUBLIC "-ljemalloc" "-Wl,-rpath=/usr/local/lib" "-ldl")
endif()
endmacro(kllvm_add_tool)

Expand Down
1 change: 0 additions & 1 deletion nix/llvm-backend.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ stdenv.mkDerivation {
cmakeFlags = [
''-DCMAKE_C_COMPILER=${lib.getBin stdenv.cc}/bin/cc''
''-DCMAKE_CXX_COMPILER=${lib.getBin stdenv.cc}/bin/c++''
''-DNIX=TRUE''
];
NIX_CFLAGS_COMPILE = [ "-Wno-error" ];

Expand Down

0 comments on commit 7aa4718

Please sign in to comment.