Skip to content

Commit 7c4a114

Browse files
committed
add config options for FetchContent and martty's llvm fixes
1 parent 0da4120 commit 7c4a114

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
1111
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1212

1313
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
14+
option(SHADY_USE_FETCHCONTENT "Use FetchContent to grab json-c" ON)
15+
option(SHADY_WIN32_FIX_PARTIAL_LLVM_INSTALL "If you install LLVM on windows, it doesn't come with header files. This fixes it" ON)
1416

1517
if (MSVC)
1618
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
@@ -22,7 +24,7 @@ endif()
2224

2325
add_subdirectory(SPIRV-Headers)
2426

25-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
27+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24" AND ${SHADY_USE_FETCHCONTENT})
2628
FetchContent_Declare(
2729
json-c
2830
GIT_REPOSITORY https://github.com/json-c/json-c
@@ -39,7 +41,7 @@ else ()
3941
endif ()
4042

4143
find_package(LLVM QUIET)
42-
if(NOT ${LLVM_FOUND} AND WIN32)
44+
if(NOT ${LLVM_FOUND} AND WIN32 AND ${SHADY_WIN32_FIX_PARTIAL_LLVM_INSTALL})
4345
find_program(clang_exe "clang.exe")
4446
if(${clang_exe} STREQUAL "clang_exe-NOTFOUND")
4547
message(STATUS "Win32: Installed LLVM not found")

0 commit comments

Comments
 (0)