mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 12:55:37 +00:00
cmake: Don't use the CFLAGS environment variable.
CMake has standard means of setting compiler flags, such as the -DCMAKE_C_FLAGS command line for general-purpose flags, and -DCMAKE_BUILD_TYPE for letting it choose reasonable release/debug/etc defaults. Trying to emulate the configure script is incorrect and confusing here. Fixes #1819.
This commit is contained in:
parent
114d1d46ac
commit
f79ac6a8de
|
@ -212,19 +212,8 @@ if(UNIX OR MINGW OR MSYS OR (USE_CLANG AND NOT WINDOWS) OR VITA)
|
||||||
set(OPT_DEF_LIBC ON)
|
set(OPT_DEF_LIBC ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Default flags, if not set otherwise
|
if(NOT ("$ENV{CFLAGS}" STREQUAL ""))
|
||||||
if("$ENV{CFLAGS}" STREQUAL "")
|
message(WARNING "SDL's CMakeLists.txt no longer checks the CFLAGS environment. Please use CMake's CMAKE_C_FLAGS and CMAKE_BUILD_TYPE variables directly.")
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "")
|
|
||||||
if(USE_GCC OR USE_CLANG)
|
|
||||||
set(CMAKE_C_FLAGS "-g -O3")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(CMAKE_C_FLAGS "$ENV{CFLAGS}")
|
|
||||||
list(APPEND EXTRA_CFLAGS "$ENV{CFLAGS}")
|
|
||||||
endif()
|
|
||||||
if(NOT ("$ENV{CFLAGS}" STREQUAL "")) # Hackish, but does the trick on Win32
|
|
||||||
list(APPEND EXTRA_LDFLAGS "$ENV{LDFLAGS}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|
Loading…
Reference in a new issue