@@ -66,7 +66,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
66
66
67
67
include (GNUInstallDirs)
68
68
## Define supported version of clang and llvm
69
-
70
69
set (CLANG_MIN_SUPPORTED 13.0)
71
70
set (CLANG_MAX_SUPPORTED "19.1.x" )
72
71
set (CLANG_VERSION_UPPER_BOUND 20.0.0)
@@ -78,12 +77,10 @@ include(GNUInstallDirs)
78
77
set (LLVM_VERSION_UPPER_BOUND 20.0.0)
79
78
80
79
## Set Cmake packages search order
81
-
82
80
set (CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
83
81
set (CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
84
82
85
83
## Search packages HINTS and PATHS
86
-
87
84
if (DEFINED LLVM_DIR)
88
85
set (llvm_search_hints PATHS ${LLVM_DIR} HINTS "${LLVM_DIR} /lib/cmake/llvm" "${LLVM_DIR} /cmake" "${LLVM_CONFIG_EXTRA_PATH_HINTS} " )
89
86
set (clang_search_hints PATHS ${LLVM_DIR} HINTS "${LLVM_DIR} /lib/cmake/clang" "${LLVM_DIR} /cmake" )
@@ -102,7 +99,6 @@ include(GNUInstallDirs)
102
99
endif ()
103
100
104
101
## Find supported LLVM
105
-
106
102
if (CPPINTEROP_USE_CLING)
107
103
message (STATUS "Mode CPPINTEROP_USE_CLING = ON" )
108
104
find_package (LLVM REQUIRED CONFIG ${llvm_search_hints} NO_DEFAULT_PATH)
@@ -154,8 +150,7 @@ include(GNUInstallDirs)
154
150
message (STATUS "Found supported version: LLVM ${LLVM_PACKAGE_VERSION} " )
155
151
message (STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR} " )
156
152
157
- ## Find supported LLD only while building for webassembly against emscripten
158
-
153
+ ## Find supported LLD only while building for webassembly against emscripten
159
154
if (EMSCRIPTEN)
160
155
if (DEFINED LLD_VERSION)
161
156
if (LLD_VERSION VERSION_GREATER_EQUAL LLD_VERSION_UPPER_BOUND)
@@ -194,7 +189,6 @@ if(EMSCRIPTEN)
194
189
endif ()
195
190
196
191
## Find supported Clang
197
-
198
192
if (DEFINED CLANG_VERSION)
199
193
if (CLANG_VERSION VERSION_GREATER_EQUAL CLANG_VERSION_UPPER_BOUND)
200
194
set (CLANG_VERSION ${CLANG_VERSION_UPPER_BOUND} )
@@ -236,19 +230,18 @@ endif()
236
230
set (CMAKE_CXX_STANDARD 17)
237
231
endif ()
238
232
if (CMAKE_CXX_STANDARD LESS 17)
239
- message (fatal "LLVM/CppInterOp requires c ++17 or later" )
233
+ message (fatal "LLVM/CppInterOp requires C ++17 or later" )
240
234
endif ()
241
235
elseif (CLANG_VERSION_MAJOR GREATER_EQUAL 13)
242
236
if (NOT CMAKE_CXX_STANDARD)
243
237
set (CMAKE_CXX_STANDARD 14)
244
238
endif ()
245
239
if (CMAKE_CXX_STANDARD LESS 14)
246
- message (fatal "LLVM/CppInterOp requires c ++14 or later" )
240
+ message (fatal "LLVM/CppInterOp requires C ++14 or later" )
247
241
endif ()
248
242
endif ()
249
243
250
244
## Find supported Cling
251
-
252
245
if (CPPINTEROP_USE_CLING)
253
246
if (NOT Cling_FOUND AND DEFINED Cling_DIR)
254
247
find_package (Cling REQUIRED CONFIG ${cling_extra_hints} NO_DEFAULT_PATH)
@@ -274,8 +267,6 @@ endif()
274
267
# For consistency we should set it to the correct value.
275
268
set (LLVM_CONFIG_HAS_RTTI NO CACHE BOOL "" FORCE)
276
269
277
- ## Init
278
-
279
270
# In case this was a path to a build folder of llvm still try to find AddLLVM
280
271
list (APPEND CMAKE_MODULE_PATH "${LLVM_DIR} " )
281
272
@@ -352,7 +343,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
352
343
"`CMakeFiles'. Please delete them." )
353
344
endif ()
354
345
355
- # Add appropriate flags for GCC
346
+ ## Add appropriate flags for GCC
356
347
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
357
348
if (APPLE OR EMSCRIPTEN)
358
349
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings" )
@@ -383,7 +374,7 @@ include_directories(BEFORE SYSTEM
383
374
${CMAKE_CURRENT_SOURCE_DIR} /include
384
375
)
385
376
386
- #Removes flag due to issue with Google test download when LLVM_ENABLE_WERROR=On
377
+ # Removes flag due to issue with Google test download when LLVM_ENABLE_WERROR=On
387
378
string (REPLACE "-Wcovered-switch-default" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} " )
388
379
389
380
file (STRINGS "VERSION" CPPINTEROP_VERSION)
@@ -406,7 +397,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/
406
397
PATTERN "*.cmake"
407
398
)
408
399
409
-
410
400
install (DIRECTORY include /
411
401
DESTINATION include
412
402
FILES_MATCHING
0 commit comments