[cmake] generate full buildflags.h CFLAGS

Combine current configuration flags with CMAKE_C_FLAGS
This commit is contained in:
akallabeth 2024-10-23 19:48:07 +02:00
parent 98f4a2b022
commit aa9b03df25
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
6 changed files with 22 additions and 3 deletions

View File

@ -38,6 +38,12 @@ if (WIN32)
string(REPLACE "\\" "\\\\" NATIVE_FREERDP_PROXY_PLUGINDIR "${NATIVE_FREERDP_PROXY_PLUGINDIR}")
endif()
set(C_FLAGS ${CMAKE_C_FLAGS})
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE)
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")
endif()
cleaning_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h)
cleaning_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h)
cleaning_configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/config.h)

View File

@ -1,7 +1,7 @@
#ifndef FREERDP_BUILD_FLAGS_H
#define FREERDP_BUILD_FLAGS_H
#define FREERDP_CFLAGS "${CMAKE_C_FLAGS}"
#define FREERDP_CFLAGS "${C_FLAGS}"
#define FREERDP_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define FREERDP_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define FREERDP_TARGET_ARCH "${TARGET_ARCH}"

View File

@ -32,6 +32,13 @@ FOREACH(var ${res})
LIST(APPEND UWAC_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()
set(C_FLAGS ${CMAKE_C_FLAGS})
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE)
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")
endif()
string(REPLACE ";" " " UWAC_BUILD_CONFIG "${UWAC_BUILD_CONFIG_LIST}")
cleaning_configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/version.h)
cleaning_configure_file(buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/../include/uwac/buildflags.h)

View File

@ -1,7 +1,7 @@
#ifndef UWAC_BUILD_FLAGS_H
#define UWAC_BUILD_FLAGS_H
#define UWAC_CFLAGS "${CMAKE_C_FLAGS}"
#define UWAC_CFLAGS "${C_FLAGS}"
#define UWAC_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define UWAC_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define UWAC_TARGET_ARCH "${TARGET_ARCH}"

View File

@ -15,6 +15,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
set(C_FLAGS ${CMAKE_C_FLAGS})
if (CMAKE_BUILD_TYPE)
string(TOUPPER "${CMAKE_BUILD_TYPE}" CAPS_BUILD_TYPE)
string(APPEND C_FLAGS " ${CMAKE_C_FLAGS_${CAPS_BUILD_TYPE}}")
endif()
cleaning_configure_file(config/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/version.h)
cleaning_configure_file(config/wtypes.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/wtypes.h)
cleaning_configure_file(config/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/build-config.h)

View File

@ -1,7 +1,7 @@
#ifndef WINPR_BUILD_FLAGS_H
#define WINPR_BUILD_FLAGS_H
#define WINPR_CFLAGS "${CMAKE_C_FLAGS}"
#define WINPR_CFLAGS "${C_FLAGS}"
#define WINPR_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define WINPR_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define WINPR_TARGET_ARCH "${TARGET_ARCH}"