diff options
author | Juergen Herrmann <shadowrom@me.com> | 2014-02-24 20:53:14 +0400 |
---|---|---|
committer | Juergen Herrmann <shadowrom@me.com> | 2014-03-08 21:47:00 +0400 |
commit | 8df2d1c6b61e97534ae527b8c7bfc44ac9ee1d3c (patch) | |
tree | e7235baaf44cc9d4cc4dd32869bc79c3e6d05f09 | |
parent | 7461fead506ebac8bf730148e1ace66db116d18a (diff) |
Minor changes to CMakeLists.txt to enable debug builds on VS2013.
Fix for finding LLVM and OSL debug libs.
-rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 169aeffdbef..5365c93ffbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1290,7 +1290,27 @@ elseif(WIN32) if(WITH_LLVM) set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation") - file(GLOB LLVM_LIBRARY ${LLVM_DIRECTORY}/lib/*.lib) + file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_DIRECTORY}/lib/*.lib) + + if(EXISTS ${LLVM_DIRECTORY}/debug/lib) + foreach(LLVM_OPTIMIZED_LIB ${LLVM_LIBRARY_OPTIMIZED}) + get_filename_component(LIBNAME ${LLVM_OPTIMIZED_LIB} ABSOLUTE) + list(APPEND LLVM_LIBS optimized ${LIBNAME}) + endforeach(LLVM_OPTIMIZED_LIB) + + file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_DIRECTORY}/debug/lib/*.lib) + + foreach(LLVM_DEBUG_LIB ${LLVM_LIBRARY_DEBUG}) + get_filename_component(LIBNAME ${LLVM_DEBUG_LIB} ABSOLUTE) + list(APPEND LLVM_LIBS debug ${LIBNAME}) + endforeach(LLVM_DEBUG_LIB) + + set(LLVM_LIBRARY ${LLVM_LIBS}) + else() + message(WARNING "LLVM debug libs not present on this system. Using release libs for debug builds.") + set(LLVM_LIBRARY ${LLVM_LIBRARY_OPTIMIZED}) + endif() + endif() if(WITH_OPENCOLORIO) @@ -1579,7 +1599,10 @@ elseif(WIN32) find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib) find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib) find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib) - list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} ${OSL_LIB_EXEC} ${OSL_LIB_QUERY}) + find_library(OSL_LIB_EXEC_DEBUG NAMES oslexec_d PATHS ${CYCLES_OSL}/lib) + find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib) + find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib) + list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_COMP} optimized ${OSL_LIB_EXEC} optimized ${OSL_LIB_QUERY} debug ${OSL_LIB_EXEC_DEBUG} debug ${OSL_LIB_COMP_DEBUG} debug ${OSL_LIB_QUERY_DEBUG}) find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include) find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin) |