Skip to content

Commit 955ed03

Browse files
authored
Merge branch 'main' into cling-ci
2 parents c15d76b + f794dee commit 955ed03

21 files changed

+1347
-284
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ IncludeCategories:
1414
- Regex: '^"llvm/'
1515
Priority: 40
1616
- Regex: '^<'
17-
Priority: 50
17+
Priority: 50

.github/workflows/ci.yml

Lines changed: 115 additions & 43 deletions
Large diffs are not rendered by default.

.github/workflows/clang-tidy-review-post.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
steps:
2222
- name: Post review comments
2323
id: post-review
24-
uses: ZedThree/clang-tidy-review/post@v0.18.0
24+
uses: ZedThree/clang-tidy-review/post@v0.20.1
2525
with:
2626
max_comments: 10
2727

.github/workflows/clang-tidy-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pip install lit
3232

3333
- name: Run clang-tidy
34-
uses: ZedThree/clang-tidy-review@v0.18.0
34+
uses: ZedThree/clang-tidy-review@v0.20.1
3535
id: review
3636
with:
3737
build_dir: build
@@ -49,4 +49,4 @@ jobs:
4949
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
5050
5151
- name: Upload artifacts
52-
uses: ZedThree/clang-tidy-review/upload@v0.18.0
52+
uses: ZedThree/clang-tidy-review/upload@v0.20.1

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
*.dylib
1717
*.dll
1818

19-
# Fortran module files
20-
*.mod
21-
*.smod
22-
2319
# Compiled Static libraries
2420
*.lai
2521
*.la
@@ -36,4 +32,4 @@ build
3632
install
3733

3834
# CLion files
39-
.idea
35+
.idea

CMakeLists.txt

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
4545
option(USE_CLING "Use Cling as backend" OFF)
4646
option(USE_REPL "Use clang-repl as backend" OFF)
4747

48-
if (USE_CLING)
49-
add_definitions(-DUSE_CLING)
50-
endif()
51-
if (USE_REPL)
52-
add_definitions(-DUSE_REPL)
53-
endif()
54-
5548
if (USE_CLING AND USE_REPL)
5649
message(FATAL_ERROR "We can only use Cling (USE_CLING=On) or Repl (USE_REPL=On), but not both of them.")
5750
endif()
@@ -226,53 +219,60 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
226219
# Fix bug in some AddLLVM.cmake implementation (-rpath "" problem)
227220
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
228221

229-
include(AddLLVM)
230-
include(HandleLLVMOptions)
231-
232-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
222+
set( CPPINTEROP_BUILT_STANDALONE 1 )
223+
endif()
233224

234-
# In rare cases we might want to have clang installed in a different place
235-
# than llvm and the header files should be found first (even though the
236-
# LLVM_INCLUDE_DIRS) contain clang headers, too.
237-
if (USE_CLING)
238-
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
239-
endif(USE_CLING)
240-
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
241-
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
242-
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
243-
add_definitions(${LLVM_DEFINITIONS_LIST})
225+
include(AddLLVM)
226+
include(HandleLLVMOptions)
244227

245-
if (USE_CLING)
246-
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
247-
endif(USE_CLING)
248-
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
249-
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
250-
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")
251-
252-
# If the llvm sources are present add them with higher priority.
253-
if (LLVM_BUILD_MAIN_SRC_DIR)
254-
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
255-
# build directories. Since we cannot just include ClangConfig.cmake (see
256-
# fixme above) we have to do a little more work to get the right include
257-
# paths for clang.
258-
#
259-
# FIXME: We only support in-tree builds of clang, that is clang being built
260-
# in llvm_src/tools/clang.
261-
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)
262-
263-
if (NOT LLVM_BUILD_BINARY_DIR)
264-
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
265-
endif()
228+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
266229

267-
include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
230+
# In rare cases we might want to have clang installed in a different place
231+
# than llvm and the header files should be found first (even though the
232+
# LLVM_INCLUDE_DIRS) contain clang headers, too.
233+
if (USE_CLING)
234+
add_definitions(-DUSE_CLING)
235+
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
236+
else()
237+
if (NOT USE_REPL)
238+
message(FATAL_ERROR "We need either USE_CLING or USE_REPL")
239+
endif()
240+
add_definitions(-DUSE_REPL)
241+
242+
endif(USE_CLING)
243+
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
244+
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
245+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
246+
add_definitions(${LLVM_DEFINITIONS_LIST})
247+
248+
if (USE_CLING)
249+
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
250+
endif(USE_CLING)
251+
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
252+
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
253+
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")
254+
255+
# If the llvm sources are present add them with higher priority.
256+
if (LLVM_BUILD_MAIN_SRC_DIR)
257+
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
258+
# build directories. Since we cannot just include ClangConfig.cmake (see
259+
# fixme above) we have to do a little more work to get the right include
260+
# paths for clang.
261+
#
262+
# FIXME: We only support in-tree builds of clang, that is clang being built
263+
# in llvm_src/tools/clang.
264+
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)
265+
266+
if (NOT LLVM_BUILD_BINARY_DIR)
267+
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
268268
endif()
269269

270-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/)
271-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
272-
273-
set( CPPINTEROP_BUILT_STANDALONE 1 )
270+
include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
274271
endif()
275272

273+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/)
274+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
275+
276276
## Code Coverage Configuration
277277
add_library(coverage_config INTERFACE)
278278
option(CODE_COVERAGE "Enable coverage reporting" OFF)
@@ -299,11 +299,15 @@ endif()
299299

300300
# Add appropriate flags for GCC
301301
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
302-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
302+
if (APPLE)
303+
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")
304+
else()
305+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
306+
endif ()
303307
endif ()
304308

305309
# Fixes "C++ exception handler used, but unwind semantics are not enabled" warning Windows
306-
if (WIN32)
310+
if (MSVC)
307311
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
308312
endif ()
309313

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ on Windows.
9696

9797
##### Build Clang-REPL
9898
Clang-REPL is an interpreter that CppInterOp works alongside. Build Clang (and
99-
Clang-REPL along with it). On Linux and MaxOS you do this by executing the following
99+
Clang-REPL along with it). On Linux and MacOS you do this by executing the following
100100
command
101101
```
102102
mkdir build

cmake/modules/GoogleTest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ExternalProject_Add(
2424
googletest
2525
GIT_REPOSITORY https://github.com/google/googletest.git
2626
GIT_SHALLOW 1
27-
GIT_TAG release-1.12.1
27+
GIT_TAG v1.15.2
2828
UPDATE_COMMAND ""
2929
# # Force separate output paths for debug and release builds to allow easy
3030
# # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands

0 commit comments

Comments
 (0)