diff options
author | Jeremy Newton <Jeremy.Newton@amd.com> | 2019-03-22 14:36:17 -0400 |
---|---|---|
committer | Tom St Denis <tom.stdenis@amd.com> | 2019-03-26 11:27:11 -0400 |
commit | 5053d1025f5e32ca4bc34be782565aca03260458 (patch) | |
tree | e78e564cdf713a73e5b79927d056a0311e13a693 | |
parent | d03b2dd5f6f35233a2947ed5be2dd614a88adf6b (diff) |
Use CMAKE variables rather than ENV variables
Signed-off-by: Jeremy Newton <Jeremy.Newton@amd.com>
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0918119..f86183a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,14 +30,18 @@ include_directories(${CURSES_INCLUDE_DIRS}) find_package(PCIAccess REQUIRED) include_directories(${PCIACCESS_INCLUDE_DIR}) -if($ENV{UMR_NO_DRM}) +option(UMR_NO_DRM "Disable libdrm functions to read memory stats" OFF) +option(UMR_NO_LLVM "Disable LLVM shader disasm functions, suggested for LLVM < 7" OFF) +option(UMR_NEED_RT "Link against RT library, needed for older glibc versions" OFF) + +if(UMR_NO_DRM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUMR_NO_DRM") else() find_package(LibDRM REQUIRED) include_directories(${LIBDRM_INCLUDE_DIR}) endif() -if($ENV{UMR_NO_LLVM}) +if(UMR_NO_LLVM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUMR_NO_LLVM") else() find_package(LLVM REQUIRED COMPONENTS all) @@ -58,7 +62,7 @@ if(LLVM_CMAKE_DIR) endif() endif() -if($ENV{UMR_NEED_RT}) +if(UMR_NEED_RT) set(RT_LIBS "-lrt") else() set(RT_LIBS "") |