mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-20 20:46:02 +08:00
cmake: Prefix all options with "SDL_"
This makes it clear which options came from SDL's CMake project when building SDL as a subdirectory of a parent CMake project. Fixes #4139.
This commit is contained in:
+154
-153
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,7 @@ cd checker-buildbot
|
||||
# The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
|
||||
|
||||
# You might want to do this for CMake-backed builds instead...
|
||||
scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
|
||||
scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DSDL_ASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
|
||||
|
||||
# ...or run configure without the scan-build wrapper...
|
||||
#CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0 -Wno-deprecated-declarations" LDFLAGS="-Wno-liblto" ../configure --enable-assertions=enabled
|
||||
|
||||
@@ -24,7 +24,7 @@ mkdir codechecker-buildbot
|
||||
cd codechecker-buildbot
|
||||
|
||||
# We turn off deprecated declarations, because we don't care about these warnings during static analysis.
|
||||
cmake -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
|
||||
cmake -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DSDL_ASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
|
||||
|
||||
# CMake on macOS adds "-arch arm64" or whatever is appropriate, but this confuses CodeChecker, so strip it out.
|
||||
perl -w -pi -e 's/\-arch\s+.*?\s+//g;' compile_commands.json
|
||||
|
||||
+11
-5
@@ -42,12 +42,18 @@ macro(MESSAGE_TESTED_OPTION _NAME)
|
||||
if(${ARGC} EQUAL 2)
|
||||
set(_PAD ${ARGV1})
|
||||
endif()
|
||||
if(NOT HAVE_${_NAME})
|
||||
set(HAVE_${_NAME} OFF)
|
||||
elseif("${HAVE_${_NAME}}" MATCHES "1|TRUE|YES|Y")
|
||||
set(HAVE_${_NAME} ON)
|
||||
string(SUBSTRING "${_NAME}" 0 4 _NAMESTART)
|
||||
if(_NAMESTART STREQUAL "SDL_")
|
||||
string(SUBSTRING "${_NAME}" 4 -1 _STRIPPEDNAME)
|
||||
else()
|
||||
set(_STRIPPEDNAME "${_NAME}")
|
||||
endif()
|
||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_NAME}}")
|
||||
if(NOT HAVE_${_STRIPPEDNAME})
|
||||
set(HAVE_${_STRIPPEDNAME} OFF)
|
||||
elseif("${HAVE_${_STRIPPEDNAME}}" MATCHES "1|TRUE|YES|Y")
|
||||
set(HAVE_${_STRIPPEDNAME} ON)
|
||||
endif()
|
||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||
endmacro()
|
||||
|
||||
macro(LISTTOSTR _LIST _OUTPUT)
|
||||
|
||||
+119
-118
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user