Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang 7.0 support - individual warning levels #100

Merged
merged 110 commits into from
Feb 4, 2018
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
2421d75
disable warnings
gabyx Jan 20, 2018
638c0ad
warnings -Wall off
gabyx Jan 21, 2018
2b98560
correct install path for libraries -> lib instead of bin
gabyx Jan 21, 2018
adf2463
typos
gabyx Jan 21, 2018
eb2df6d
Merge branch 'correct-cmake-install' into disable-warnings
gabyx Jan 21, 2018
ef43f83
fix rpath on mac os, such that when linking with this library using c…
gabyx Jan 21, 2018
60c7257
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
839f13f
remove uneeded settings to fix the problem
gabyx Jan 21, 2018
9848f3b
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
60951cf
merged the good parts from warchant
gabyx Jan 21, 2018
4cff144
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
e1999ea
merged the good parts from warchant, restored some default behaviour
gabyx Jan 21, 2018
5f295e0
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
ee4f284
rpath and install_names fixed, on windows libraries go next to binari…
gabyx Jan 21, 2018
fc10657
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
c181f4e
fix, typo
gabyx Jan 21, 2018
9ba6b0d
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 21, 2018
4579a90
corrected rpath settings
gabyx Jan 22, 2018
4a22690
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 22, 2018
64105cd
permissions fix
gabyx Jan 22, 2018
a6661d7
default prefix fix
gabyx Jan 22, 2018
e3c1dc2
travis cmake update
gabyx Jan 22, 2018
0d60942
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 23, 2018
5b65744
Merge remote-tracking branch 'upstream/master'
gabyx Jan 23, 2018
c4990f8
Merge branch 'master' into fix-cmake-rpath-macos
gabyx Jan 23, 2018
86e190f
Merge branch 'master' into disable-warnings
gabyx Jan 23, 2018
d577f8a
individual warning levels
gabyx Jan 23, 2018
77124c2
gitignore
gabyx Jan 23, 2018
45979e8
cmake fixes
gabyx Jan 23, 2018
2d68e5d
warning levels for benchmarks/unit_tests decreased
gabyx Jan 23, 2018
28de4a7
cmake fixes
gabyx Jan 23, 2018
f975fff
cmake fixes, rpath for benchmarks
gabyx Jan 23, 2018
b78ef29
cmake fixes, typo
gabyx Jan 23, 2018
f52ec93
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 23, 2018
78a9b78
only from clang 5.0 -> noexcept-type
gabyx Jan 23, 2018
73f2899
added support for c++17 compilers
acki-m Jan 23, 2018
26e3f6c
fixed VS2013 build
acki-m Jan 24, 2018
02c7f37
removed several FORCE_INLINE marks, due to errors reported from MSVC
acki-m Jan 24, 2018
e0079ac
made code compile also with c++11 flag
acki-m Jan 24, 2018
b389a01
added clang 5.0.0 for linux travis builds
acki-m Jan 24, 2018
5e91693
fixed compile error for < c++17 compilers
acki-m Jan 24, 2018
27441b7
Review changes
gabyx Jan 24, 2018
87d0784
Review changes
gabyx Jan 24, 2018
f45e587
Review changes, everything into bin directory on windows..., fix for …
gabyx Jan 24, 2018
2049bc8
renaming, better read out GNUInstallDirs, set them, and use only the …
gabyx Jan 24, 2018
14781a0
Debug postfix
gabyx Jan 24, 2018
fc95f8e
Installation dir correction, make it explicit, set it in the config, …
gabyx Jan 24, 2018
d34f713
Review changes
gabyx Jan 24, 2018
764c0c7
typos
gabyx Jan 24, 2018
b86b099
Merge branch 'fix-cmake-rpath-macos' into disable-warnings
gabyx Jan 24, 2018
afd5818
one newline
gabyx Jan 24, 2018
9dae7a3
fixed compile error under linux, because of adjusted compiler version…
acki-m Jan 24, 2018
a1593e9
Merge remote-tracking branch 'upstream/master'
gabyx Jan 25, 2018
c03abbc
Merge branch 'master' into disable-warnings
gabyx Jan 25, 2018
6ed9c1e
Merge branch 'master' into feature-add-cpp17-compiler-support
acki-m Jan 25, 2018
7d0d8be
added missing EOL
acki-m Jan 25, 2018
b385191
small changes
gabyx Jan 25, 2018
4f9dc93
Merge remote-tracking branch 'acki-m/feature-add-cpp17-compiler-suppo…
gabyx Jan 25, 2018
b42102e
Compiles with clang7.0 (everything!)
gabyx Jan 25, 2018
8fc6067
Merge branch 'disable-warnings-merge' into disable-warnings
gabyx Jan 25, 2018
d7f3d57
fixed detection of clang noexcept function signature
acki-m Jan 27, 2018
6d9f8fe
fixed warning unused variable
acki-m Jan 27, 2018
dac092a
replaced the manual setting of the compiler flags and instead let cma…
acki-m Jan 29, 2018
ba1b782
used newest cmake release (3.10.2) for compiling @ travis
acki-m Jan 29, 2018
33b1173
fixed visibility issue with gcc
acki-m Jan 30, 2018
2ff1db4
marked project as CXX
acki-m Jan 30, 2018
f8cfde9
added missing architecture x64 to valgrind build
acki-m Jan 30, 2018
aac425a
added CXX to all projects - to avoid looking for C compiler
acki-m Jan 30, 2018
c33b093
fixed cmake warning (unused C flags)
acki-m Jan 30, 2018
8e25084
added 'linux-libc-dev:i386'
acki-m Jan 30, 2018
0e9a0c1
typo in travis script
acki-m Jan 30, 2018
f524bc8
added libstdc++ version to linux/clang builds
acki-m Jan 30, 2018
adcb982
for testing purpose, move code on top
acki-m Jan 30, 2018
23f2a83
removed warnings because of unused variables
acki-m Jan 30, 2018
47c7aa2
Merge remote-tracking branch 'acki-m/feature-add-cpp17-compiler-suppo…
gabyx Jan 31, 2018
06c77f1
added cmake function to test for latest c++ standard (17)
acki-m Jan 31, 2018
dfb9e9c
fixed cmake typo
acki-m Jan 31, 2018
84946ab
merged, set_compiler_warnings used mine, because like this I can buil…
gabyx Jan 31, 2018
583b01c
fixed benchmark for rttr_cast
acki-m Jan 31, 2018
e831119
fixed warning in test_classes.h
acki-m Jan 31, 2018
06cc1d5
Merge remote-tracking branch 'acki-m/feature-add-cpp17-compiler-suppo…
gabyx Jan 31, 2018
067d206
travis, cmake
gabyx Jan 31, 2018
b8dc30f
fixed MSVC build, when flag /:stdc++17 is used
acki-m Jan 31, 2018
708e0fa
distinguish apple clang version number in certain cases
gabyx Feb 1, 2018
ec92f29
lets try with <string> include
gabyx Feb 1, 2018
f4a294d
from apple clang 9.0.0
gabyx Feb 1, 2018
5843fa8
removed c++17 compilation for visual studio (compiler bug)
acki-m Feb 1, 2018
41d1cb8
fixed error message for clang on MacOSX
acki-m Feb 2, 2018
082083c
fixed preprocessor error
acki-m Feb 2, 2018
67d9920
try to fix compile error for clang-900.0.39.2 on apple
acki-m Feb 2, 2018
10ce403
Merge remote-tracking branch 'acki-m/feature-add-cpp17-compiler-suppo…
gabyx Feb 2, 2018
1c23369
merge fix
gabyx Feb 2, 2018
7b0ce08
lets see if everything builds
gabyx Feb 2, 2018
e1dec1c
Build Benchmarks on Apple too
gabyx Feb 2, 2018
aee0e83
and gcc7 too
gabyx Feb 2, 2018
7e44625
boost for gcc7 on travis
gabyx Feb 3, 2018
4db1725
gitignore
gabyx Feb 3, 2018
5e5b9de
Review Changes
gabyx Feb 3, 2018
e58cb53
Set Compiler Warning Function
gabyx Feb 3, 2018
cf17045
Forgot some files
gabyx Feb 3, 2018
9d91021
Review changes
gabyx Feb 3, 2018
1702b1c
typo
gabyx Feb 3, 2018
89c6db7
typo
gabyx Feb 3, 2018
c5f938e
typo
gabyx Feb 3, 2018
b1448a0
now we have a new compiler wa also need to check all other #if
gabyx Feb 4, 2018
93bb4cc
Testing xcode 9.0 as well on travis
gabyx Feb 4, 2018
a709f4f
more additional: RTTR_COMPILER == RTTR_COMPILER_APPLECLANG
gabyx Feb 4, 2018
253cd53
travis test
gabyx Feb 4, 2018
40b2428
final commit (hopefully ;-)
gabyx Feb 4, 2018
d0e9083
ok, now final commit
gabyx Feb 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
build
.vscode

27 changes: 22 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ matrix:
packages: ['g++-4.8-multilib', 'libboost-all-dev']
env: COMPILER=g++-4.8 ARCH=x86_64 CONF=Release UNIT_TESTS=false BUILD_EXAMPLES=true BUILD_BENCHMARKS=true

# Linux / CLang
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8-multilib', 'libboost-all-dev']
env: LLVM_VERSION=3.8.0 ARCH=x86_64 CONF=Release UNIT_TESTS=false BUILD_EXAMPLES=true BUILD_BENCHMARKS=true

# Linux / CLang

# this config fails at the moment because of disabled APT on llvm
- os: linux
compiler: clang
Expand Down Expand Up @@ -177,17 +177,34 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8-multilib']
env: LLVM_VERSION=3.8.0 ARCH=x86_64 CONF=Release UNIT_TESTS=true

- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
packages: ['g++-6', 'clang-5.0',]
env: LLVM_VERSION=5.0.0 ARCH=x86_64 CONF=Release UNIT_TESTS=true

# OSX/Clang
- os: osx
osx_image: xcode7.3
osx_image: xcode9.2
compiler: clang
env: COMPILER=clang++ ARCH=x86 CONF=Release UNIT_TESTS=true

- os: osx
osx_image: xcode9.2
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true
- os: osx
osx_image: xcode8.3
compiler: clang
env: COMPILER=clang++ ARCH=x86 CONF=Release UNIT_TESTS=true

- os: osx
osx_image: xcode7.3
osx_image: xcode8.3
compiler: clang
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true
env: COMPILER=clang++ ARCH=x86_64 CONF=Release UNIT_TESTS=true

allow_failures:
- env: COMPILER=clang++-3.7 ARCH=x86_64 CONF=Release UNIT_TESTS=true
Expand Down
37 changes: 22 additions & 15 deletions CMake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,21 @@ endif()

enable_rtti(BUILD_WITH_RTTI)

# cxx default flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Werror")
message(STATUS "added flag -std=c++0x, -Wall, -Werror to g++")
set(ADDITIONAL_COMPILER_FLAGS "-std=c++0x -Wall")
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0.0")
set(ADDITIONAL_COMPILER_FLAGS "-std=c++17 -Wall")
SET(BUILD_BENCHMARKS FALSE)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
message(STATUS "added flag -std=c++11, -Wall, -Werror to g++")
set(ADDITIONAL_COMPILER_FLAGS "-std=c++11 -Wall")
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.0.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set(ADDITIONAL_COMPILER_FLAGS "${ADDITIONAL_COMPILER_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_COMPILER_FLAGS}")

if(MINGW)
set(GNU_STATIC_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
Expand All @@ -133,20 +137,22 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror")
message(STATUS "added flag -std=c++11, -Wall, -Werror to g++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
message(WARNING "clang support is currently experimental")

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.0.0")
set(ADDITIONAL_COMPILER_FLAGS "-std=c++17 -Wall")
else()
set(ADDITIONAL_COMPILER_FLAGS "-std=c++11 -Wall")
set(ADDITIONAL_COMPILER_FLAGS "${ADDITIONAL_COMPILER_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_COMPILER_FLAGS}")

set(CLANG_STATIC_LINKER_FLAGS "-stdlib=libc++ -static-libstdc++")
endif()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /WX")
replaceCompilerOption("/W3" "/W4")
message(STATUS "added flag /bigobj, /W4 to MSVC compiler")
message(STATUS "Treats all compiler warnings as errors.")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /Wall")
endif()
message(STATUS "Set the following CXX Flags: '${CMAKE_CXX_FLAGS}', Warning levels are added project level specific!")

# RelWithDepInfo should have the same option like the Release build
# but of course with Debug informations
Expand All @@ -163,6 +169,7 @@ else()
message(WARNING "Please adjust CMAKE_CXX_FLAGS_RELWITHDEBINFO flags for this compiler!")
endif()

# cmake config file
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/CMake/rttr-config-version.cmake"
Expand Down
49 changes: 47 additions & 2 deletions CMake/utility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,51 @@ function(activate_precompiled_headers _PRECOMPILED_HEADER _SOURCE_FILES)
endif()
endfunction()

####################################################################################
# Adds warnings compiler options to the target depending on the category
# _TARGET Target name
# _CATEGORY "library" or "unit_tests" or "benchmarks"
####################################################################################
macro( add_warning_levels _TARGET _CATEGORY)
if("${_CATEGORY}" STREQUAL "library" OR "${_CATEGORY}" STREQUAL "examples")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXX_FLAGS "-Werror")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CXX_FLAGS "-Werror")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CXX_FLAGS "/WX" "/W4")
else()
message(FATAL_ERROR "Unknown compiler to set warning levels: ${_CATEGORY} for target ${_TARGET}! ")
endif()
elseif("${_CATEGORY}" STREQUAL "unit_tests")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXX_FLAGS "-Werror" "-Wno-unused-private-field" "-Wno-delete-non-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CXX_FLAGS "-Werror" "-Wno-unused-private-field" "-Wno-delete-non-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CXX_FLAGS "/WX" "/W4")
else()
message(FATAL_ERROR "Unknown compiler to set warning levels: ${_CATEGORY} for target ${_TARGET}! ")
endif()
elseif("${_CATEGORY}" STREQUAL "benchmarks")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXX_FLAGS "-Werror" "-Wno-unused-private-field" "-Wno-delete-non-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CXX_FLAGS "-Werror" "-Wno-unused-private-field" "-Wno-delete-non-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CXX_FLAGS "/WX" "/W4")
else()
message(FATAL_ERROR "Unknown compiler to set warning levels: ${_CATEGORY} for target ${_TARGET}! ")
endif()
endif()

target_compile_options(${_TARGET} PRIVATE ${CXX_FLAGS} )
target_compile_options(${_TARGET} PRIVATE $<$<CONFIG:Debug>:${CXX_FLAGS_DEBUG}> )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this call will be done automatically by CMake. So this call is redundant IMHO.
See my newest changes in my PR #107 , there I have fine grained your idea with the warnings and settings per target.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah jeah, all my changes, except the individual warning levels are redundant! your changes in #107. Is I think already ahead :)

target_compile_options(${_TARGET} PRIVATE $<$<CONFIG:Release>:${CXX_FLAGS_RELEASE}> )
target_compile_options(${_TARGET} PRIVATE $<$<CONFIG:MinSizeRel>:${CXX_FLAGS_MINSIZEREL}> )
target_compile_options(${_TARGET} PRIVATE $<$<CONFIG:RelWithDebInfo>:${CXX_FLAGS_RELWITHDEBINFO}> )
endmacro()

####################################################################################
# Adds or replace a compiler option
# _OLD_OPTION The option which should be replaced
Expand All @@ -396,7 +441,7 @@ macro( replaceCompilerOption _OLD_OPTION _NEW_OPTION)
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES ${_OLD_OPTION})
string(REGEX REPLACE ${_OLD_OPTION} ${_NEW_OPTION} ${flag_var} "${${flag_var}}")
string(REGEX REPLACE "${_OLD_OPTION}" "${_NEW_OPTION}" ${flag_var} "${${flag_var}}")
else()
set(${flag_var} "${${flag_var}} ${_NEW_OPTION}")
endif()
Expand Down Expand Up @@ -504,4 +549,4 @@ macro(generateLibraryVersionVariables MAJOR MINOR PATCH PRODUCT_NAME PRODUCT_CPY
set(LIBRARY_PRODUCT_NAME ${PRODUCT_NAME})
set(LIBRARY_COPYRIGHT ${PRODUCT_CPY_RIGHT})
set(LIBRARY_LICENSE ${PRODUCT_LICENSE})
endmacro()
endmacro()
4 changes: 4 additions & 0 deletions src/benchmarks/bench_method/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ if(MSVC)
set_target_properties(bench_method PROPERTIES COMPILE_FLAGS "/Zm200")
endif()

add_warning_levels(bench_method "benchmarks")
set_target_properties(bench_method PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -81,6 +82,7 @@ if (BUILD_STATIC)
set_target_properties(bench_method_lib PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_method_lib "benchmarks")
set_target_properties(bench_method_lib PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -110,6 +112,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_method_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_method_s "benchmarks")
set_target_properties(bench_method_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -146,6 +149,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_method_lib_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_method_lib_s "benchmarks")
set_target_properties(bench_method_lib_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down
4 changes: 4 additions & 0 deletions src/benchmarks/bench_rttr_cast/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ target_compile_definitions(bench_rttr_cast PUBLIC BOOST_ALL_NO_LIB)
if(MSVC)
set_target_properties(bench_rttr_cast PROPERTIES COMPILE_FLAGS "/Zm200")
endif()
add_warning_levels(bench_rttr_cast "benchmarks")
set_target_properties(bench_rttr_cast PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -81,6 +82,7 @@ if (BUILD_STATIC)
set_target_properties(bench_rttr_cast_lib PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_rttr_cast_lib "benchmarks")
set_target_properties(bench_rttr_cast_lib PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -110,6 +112,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_rttr_cast_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_rttr_cast_s "benchmarks")
set_target_properties(bench_rttr_cast_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -146,6 +149,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_rttr_cast_lib_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_rttr_cast_lib_s "benchmarks")
set_target_properties(bench_rttr_cast_lib_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down
4 changes: 4 additions & 0 deletions src/benchmarks/bench_variant/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ if(MSVC)
set_target_properties(bench_variant PROPERTIES COMPILE_FLAGS "/Zm200")
endif()

add_warning_levels(bench_variant "benchmarks")
set_target_properties(bench_variant PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -82,6 +83,7 @@ if (BUILD_STATIC)
set_target_properties(bench_variant_lib PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_variant_lib "benchmarks")
set_target_properties(bench_variant_lib PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -111,6 +113,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_variant_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_variant_s "benchmarks")
set_target_properties(bench_variant_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down Expand Up @@ -147,6 +150,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
set_target_properties(bench_variant_lib_s PROPERTIES COMPILE_FLAGS "/Zm200 /bigobj")
endif()

add_warning_levels(bench_variant_lib_s "benchmarks")
set_target_properties(bench_variant_lib_s PROPERTIES DEBUG_POSTFIX _d
FOLDER "Benchmarks"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")
Expand Down
1 change: 1 addition & 0 deletions src/examples/json_serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ set_target_properties(json_serialization PROPERTIES DEBUG_POSTFIX _d
FOLDER "Examples"
INSTALL_RPATH "${RTTR_EXECUTABLE_INSTALL_RPATH}")

add_warning_levels(json_serialization "examples")

message(STATUS "Scanning " ${PROJECT_NAME} " module finished!")
message(STATUS "")
28 changes: 18 additions & 10 deletions src/rttr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ if (${BUILD_RTTR_DYNAMIC})
target_compile_definitions(rttr_core PRIVATE RTTR_DLL_EXPORTS)
target_compile_definitions(rttr_core PUBLIC RTTR_DLL)

add_warning_levels(rttr_core "library")

set_target_properties(rttr_core PROPERTIES
VERSION ${RTTR_VERSION} SOVERSION ${RTTR_VERSION}
EXPORT_NAME Core
Expand Down Expand Up @@ -77,7 +79,9 @@ endif()
if (BUILD_STATIC)
add_library(rttr_core_lib STATIC ${UnityBuild} ${SRC_FILES} ${HPP_FILES})
add_library(RTTR::Core_Lib ALIAS rttr_core_lib)


add_warning_levels(rttr_core_lib "library")

set_target_properties(rttr_core_lib PROPERTIES
VERSION ${RTTR_VERSION} SOVERSION ${RTTR_VERSION}
EXPORT_NAME Core_Lib
Expand All @@ -89,7 +93,7 @@ if (BUILD_STATIC)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rttr_core_lib PROPERTIES OUTPUT_NAME rttr_core)
else()
message(SEND_ERROR "Do now know how to to name the static library.")
message(SEND_ERROR "Do not know how to name the static library.")
endif()

target_include_directories(rttr_core_lib PUBLIC
Expand All @@ -113,10 +117,12 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
target_compile_definitions(rttr_core_s PRIVATE RTTR_DLL_EXPORTS)
target_compile_definitions(rttr_core_s PUBLIC RTTR_DLL)

add_warning_levels(rttr_core_s "library")

target_include_directories(rttr_core_s PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<INSTALL_INTERFACE:include>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<INSTALL_INTERFACE:include>)

set_target_properties(rttr_core_s PROPERTIES
VERSION ${RTTR_VERSION} SOVERSION ${RTTR_VERSION}
Expand All @@ -130,7 +136,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rttr_core_s PROPERTIES LINK_FLAGS ${CLANG_STATIC_LINKER_FLAGS})
else()
message(SEND_ERROR "Do now know how to statically link against the standard library with this compiler.")
message(SEND_ERROR "Do not know how to statically link against the standard library with this compiler.")
endif()

if (BUILD_INSTALLER)
Expand All @@ -146,10 +152,12 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
add_library(rttr_core_lib_s STATIC ${UnityBuild} ${SRC_FILES} ${HPP_FILES})
add_library(RTTR::Core_Lib_STL ALIAS rttr_core_lib_s)

add_warning_levels(rttr_core_lib_s "library")

target_include_directories(rttr_core_lib_s PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<INSTALL_INTERFACE:include>)
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<INSTALL_INTERFACE:include>)

set_target_properties(rttr_core_lib_s PROPERTIES
VERSION ${RTTR_VERSION} SOVERSION ${RTTR_VERSION}
Expand All @@ -163,7 +171,7 @@ if (BUILD_WITH_STATIC_RUNTIME_LIBS)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(rttr_core_lib_s PROPERTIES LINK_FLAGS ${CLANG_STATIC_LINKER_FLAGS} OUTPUT_NAME rttr_core_s)
else()
message(SEND_ERROR "Do now know how to statically link against the standard library with this compiler.")
message(SEND_ERROR "Do not know how to statically link against the standard library with this compiler.")
endif()

if (BUILD_INSTALLER)
Expand Down
Loading