Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter03/calc: ninja: error: unknown target 'install' #27

Open
WCatchE opened this issue Oct 30, 2023 · 2 comments
Open

Chapter03/calc: ninja: error: unknown target 'install' #27

WCatchE opened this issue Oct 30, 2023 · 2 comments

Comments

@WCatchE
Copy link

WCatchE commented Oct 30, 2023

I can use 'ninja' to compile the code, but I cannot use 'ninja install'.
And there is nothing about install appear in the 'build.ninja' file.

$ninja [6/6] Linking CXX executable src/calc $ninja install ninja: error: unknown target 'install'

@completezealous
Copy link

I can use 'ninja' to compile the code, but I cannot use 'ninja install'. And there is nothing about install appear in the 'build.ninja' file.

$ninja [6/6] Linking CXX executable src/calc $ninja install ninja: error: unknown target 'install'

I have the same problem,have you solved it?

@keegan-sherman
Copy link

I just finished working through this chapter and noticed the same problem. I was able to solve it by changing the CMakeLists.txt file in the src directory to read

add_executable(calc
  Calc.cpp
  CodeGen.cpp
  Lexer.cpp
  Parser.cpp
  Sema.cpp
)
target_link_libraries(calc PRIVATE ${llvm_libs})
install(TARGETS calc
        RUNTIME DESTINATION bin
        COMPONENT calc)

Essentially, just add the install command at the end. Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants