Open Arvinzhu opened 5 years ago
I guss just like this:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
这个问题网上肯定有,干嘛不查一下再问。。。
example:
➜ cat orig.c
#include <stdio.h>
int main(int argc, char const *argv[])
{
int x = 0;
if (x > 0) {
printf("%s", "tigger.");
}
else
{
printf("%s", "Hello, world.");
}
return 0;
}
➜ ./../work/ollvm-build/bin/clang -O0 orig.c -mllvm -fla -o test.elf
➜ ./test.elf
Hello, world.
The wiki documentation is like this, but I have a few more questions.
What does CC and CFLAGS mean?
For example.I have a C cmake project.The steps to compile this project are
cmake ..
andmake
. Can you tell me how to use ollvm compile this project ?