Skip to content

Commit

Permalink
Changes for clang default C++ compiler level
Browse files Browse the repository at this point in the history
    * .github/workflows/linux.yml:
    * ACE/include/makeinclude/platform_linux_clang.GNU:
    * ACE/include/makeinclude/platform_macosx_common.GNU:
  • Loading branch information
jwillemsen committed Apr 23, 2024
1 parent 0655b61 commit 5efddd5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ jobs:
Repo: llvm-toolchain-$(lsb_release -cs)-15
platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
os: ubuntu-22.04
- CC: clang-16
CXX: clang++-16
PackageDeps: clang-16
Repo: llvm-toolchain-$(lsb_release -cs)-16
platform_file: include $(ACE_ROOT)/include/makeinclude/platform_linux_clang.GNU
os: ubuntu-22.04
- feature: CORBA/e micro
CC: gcc-10
CXX: g++-10
Expand Down
13 changes: 13 additions & 0 deletions ACE/include/makeinclude/platform_linux_clang.GNU
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ else
CXX_MAJOR_VERSION := $(shell $(CXX) -dumpversion | sed -e 's/[^0-9\.]//g' | sed -e 's/\..*$$//')
endif

# clang 16 and newer default to C++17
ifeq ($(CXX_MAJOR_VERSION),$(filter $(CXX_MAJOR_VERSION),6 7 8 9 10 11 12 13 14 15))
c++std ?= c++17
endif

CCFLAGS += $(CFLAGS)
DCFLAGS += -g
DLD = $(CXX)
Expand All @@ -35,6 +40,14 @@ ifeq ($(optimize),0)
CPPFLAGS += -O0
endif

ifeq ($(CXX_MAJOR_VERSION),7)
c++std ?= c++17
endif

ifneq ($(c++std),)
CCFLAGS += -std=$(c++std)
endif

ifeq ($(c++20),1)
CCFLAGS += -std=c++20
endif
Expand Down
2 changes: 1 addition & 1 deletion ACE/include/makeinclude/platform_macosx_common.GNU
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SOBUILD = -o $(VSHDIR)$*.dylib $<
ifeq ($(findstring g++,$(CXX)),)#
include $(ACE_ROOT)/include/makeinclude/platform_g++_common.GNU
else
c++17 ?= 1
c++std ?= c++17
include $(ACE_ROOT)/include/makeinclude/platform_clang_common.GNU
endif

Expand Down

0 comments on commit 5efddd5

Please sign in to comment.