mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[cmake,flags] print all configuration flags
Since we do not know wich configuration will be build with multiconfiguration generators print out all C_FLAGS_XXX and CXX_FLAGS_XXX variables
This commit is contained in:
@@ -15,4 +15,5 @@ set(WITH_FFMPEG OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_SWSCALE OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_SIMD ON CACHE BOOL "iOS preload")
|
||||
set(WITH_OPUS OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_MANPAGES OFF CACHE BOOL "iOS preload")
|
||||
set(BUILD_SHARED_LIBS ON CACHE BOOL "iOS preload")
|
||||
|
||||
@@ -15,4 +15,5 @@ set(WITH_FFMPEG OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_SWSCALE OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_SIMD ON CACHE BOOL "iOS preload")
|
||||
set(WITH_OPUS OFF CACHE BOOL "iOS preload")
|
||||
set(WITH_MANPAGES OFF CACHE BOOL "iOS preload")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "iOS preload")
|
||||
|
||||
@@ -74,3 +74,7 @@ endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "default CXXFLAGS")
|
||||
message("Using CXXFLAGS ${CMAKE_CXX_FLAGS}")
|
||||
message("Using CXXFLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message("Using CXXFLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
message("Using CXXFLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||
message("Using CXXFLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
|
||||
@@ -4,8 +4,44 @@
|
||||
# Handy if the generated files might have changed
|
||||
#
|
||||
|
||||
function(cleaning_configure_file SRC DST)
|
||||
include(CFlagsToVar)
|
||||
|
||||
function(cleaning_configure_file RSRC RDST)
|
||||
get_filename_component(SRC "${RSRC}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
get_filename_component(DST "${RDST}" ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
get_filename_component(DST_DIR "${DST}" DIRECTORY)
|
||||
if(CMAKE_CONFIGURATION_TYPES)
|
||||
foreach(CFG ${CMAKE_CONFIGURATION_TYPES})
|
||||
set(CURRENT_BUILD_CONFIG ${CFG})
|
||||
cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG})
|
||||
configure_file(${SRC} ${DST}_${CFG} ${ARGN})
|
||||
unset(CURRENT_BUILD_CONFIG)
|
||||
unset(CURRENT_C_FLAGS)
|
||||
endforeach()
|
||||
else()
|
||||
# We call this also from CMake scripts without a CMAKE_BUILD_TYPE
|
||||
# Fall back to an explicitly unsupported build type to point out something is wrond
|
||||
# if this variable is used during such a call
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(CURRENT_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(CURRENT_BUILD_CONFIG "InvalidBuildType")
|
||||
endif()
|
||||
cflagstovar(CURRENT_C_FLAGS ${CURRENT_BUILD_CONFIG})
|
||||
configure_file(${SRC} ${DST}_${CMAKE_BUILD_TYPE} ${ARGN})
|
||||
unset(CURRENT_BUILD_CONFIG)
|
||||
unset(CURRENT_C_FLAGS)
|
||||
endif()
|
||||
|
||||
configure_file(${SRC} ${DST} ${ARGN})
|
||||
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${DST})
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${SRC} ${DST})
|
||||
|
||||
string(SHA256 DST_HASH "${DST}")
|
||||
if(NOT TARGET ct-${DST_HASH})
|
||||
add_custom_target(
|
||||
ct-${DST_HASH} ALL COMMAND ${CMAKE_COMMAND} "-E" "make_directory" "${DST_DIR}"
|
||||
COMMAND ${CMAKE_COMMAND} "-E" "copy" "${DST}_$<CONFIG>" "${DST}" COMMAND ${CMAKE_COMMAND} "-E" "sha256sum"
|
||||
"${DST}_$<CONFIG>" > ${DST}.hash
|
||||
DEPENDS ${DST} BYPRODUCTS ${DST}.hash
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -65,3 +65,7 @@ endif()
|
||||
|
||||
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "default CFLAGS")
|
||||
message("Using CFLAGS ${CMAKE_C_FLAGS}")
|
||||
message("Using CFLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE}")
|
||||
message("Using CFLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}")
|
||||
message("Using CFLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL}")
|
||||
message("Using CFLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
get_filename_component(GENERATE_MANPAGES_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE)
|
||||
list(APPEND CMAKE_MODULE_PATH ${GENERATE_MANPAGES_SCRIPT_DIR})
|
||||
|
||||
include(CleaningConfigureFile)
|
||||
|
||||
set(SRC "${CURRENT_SOURCE_DIR}/${target}.${section}.in")
|
||||
cleaning_configure_file(${SRC} ${manpage}.tmp @ONLY IMMEDIATE)
|
||||
configure_file(${SRC} ${manpage}.tmp @ONLY IMMEDIATE)
|
||||
|
||||
# write header (aka name of the manpage), truncate existing
|
||||
file(READ ${CURRENT_BINARY_DIR}/${manpage}.tmp CONTENTS)
|
||||
@@ -21,10 +19,10 @@ foreach(DEP IN LISTS DEPS)
|
||||
|
||||
if(EXISTS ${SRC_IN})
|
||||
message("using generated ${DST} from ${SRC_IN}")
|
||||
cleaning_configure_file(${SRC_IN} ${DST} @ONLY IMMEDIATE)
|
||||
configure_file(${SRC_IN} ${DST} @ONLY IMMEDIATE)
|
||||
elseif(EXISTS ${DST_IN})
|
||||
message("using generated ${DST} from ${DST_IN}")
|
||||
cleaning_configure_file(${DST_IN} ${DST} @ONLY IMMEDIATE)
|
||||
configure_file(${DST_IN} ${DST} @ONLY IMMEDIATE)
|
||||
elseif(EXISTS ${SRC})
|
||||
set(DST ${SRC})
|
||||
message("using ${DST}")
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
include(CleaningConfigureFile)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
@@ -24,14 +22,14 @@ if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
cleaning_configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
|
||||
cleaning_configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
set(HEAD_HASH "${HEAD_REF}")
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
cleaning_configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
|
||||
@@ -38,9 +38,6 @@ if(WIN32)
|
||||
string(REPLACE "\\" "\\\\" NATIVE_FREERDP_PROXY_PLUGINDIR "${NATIVE_FREERDP_PROXY_PLUGINDIR}")
|
||||
endif()
|
||||
|
||||
include(CFlagsToVar)
|
||||
cflagstovar(C_FLAGS)
|
||||
|
||||
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
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef FREERDP_BUILD_FLAGS_H
|
||||
#define FREERDP_BUILD_FLAGS_H
|
||||
|
||||
#define FREERDP_CFLAGS "${C_FLAGS}"
|
||||
#define FREERDP_CFLAGS "${CURRENT_C_FLAGS}"
|
||||
#define FREERDP_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
|
||||
#define FREERDP_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
|
||||
#define FREERDP_TARGET_ARCH "${TARGET_ARCH}"
|
||||
#define FREERDP_BUILD_CONFIG "${FREERDP_BUILD_CONFIG}"
|
||||
#define FREERDP_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||
#define FREERDP_BUILD_TYPE "${CURRENT_BUILD_CONFIG}"
|
||||
|
||||
#endif /* FREERDP_BUILD_FLAGS_H */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef RDTK_BUILD_FLAGS_H
|
||||
#define RDTK_BUILD_FLAGS_H
|
||||
|
||||
#define RDTK_CFLAGS "${CMAKE_C_FLAGS}"
|
||||
#define RDTK_CFLAGS "${CMAKE_CURRENT_C_FLAGS}"
|
||||
#define RDTK_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
|
||||
#define RDTK_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
|
||||
#define RDTK_TARGET_ARCH "${TARGET_ARCH}"
|
||||
#define RDTK_BUILD_CONFIG "${RDTK_BUILD_CONFIG}"
|
||||
#define RDTK_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||
#define RDTK_BUILD_TYPE "${CURRENT_BUILD_CONFIG}"
|
||||
|
||||
#endif /* RDTK_BUILD_FLAGS_H */
|
||||
|
||||
@@ -32,10 +32,6 @@ project(proxy-bitmap-filter-plugin VERSION ${FREERDP_DEFAULT_PROJECT_VERSION} LA
|
||||
|
||||
message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
|
||||
|
||||
project(proxy-bitmap-filter-plugin VERSION ${FREERDP_DEFAULT_PROJECT_VERSION} LANGUAGES CXX)
|
||||
|
||||
message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/)
|
||||
include(CommonConfigOptions)
|
||||
include(CXXCompilerFlags)
|
||||
|
||||
@@ -30,9 +30,6 @@ foreach(var ${res})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
include(CFlagsToVar)
|
||||
cflagstovar(C_FLAGS)
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef UWAC_BUILD_FLAGS_H
|
||||
#define UWAC_BUILD_FLAGS_H
|
||||
|
||||
#define UWAC_CFLAGS "${C_FLAGS}"
|
||||
#define UWAC_CFLAGS "${CURRENT_C_FLAGS}"
|
||||
#define UWAC_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
|
||||
#define UWAC_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
|
||||
#define UWAC_TARGET_ARCH "${TARGET_ARCH}"
|
||||
#define UWAC_BUILD_CONFIG "${UWAC_BUILD_CONFIG}"
|
||||
#define UWAC_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||
#define UWAC_BUILD_TYPE "${CURRENT_BUILD_CONFIG}"
|
||||
|
||||
#endif /* UWAC_BUILD_FLAGS_H */
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include(CFlagsToVar)
|
||||
cflagstovar(C_FLAGS)
|
||||
|
||||
cleaning_configure_file(config/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/version.h)
|
||||
cleaning_configure_file(config/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/build-config.h)
|
||||
cleaning_configure_file(config/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/buildflags.h)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef WINPR_BUILD_FLAGS_H
|
||||
#define WINPR_BUILD_FLAGS_H
|
||||
|
||||
#define WINPR_CFLAGS "${C_FLAGS}"
|
||||
#define WINPR_CFLAGS "${CURRENT_C_FLAGS}"
|
||||
#define WINPR_COMPILER_ID "${CMAKE_C_COMPILER_ID}"
|
||||
#define WINPR_COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
|
||||
#define WINPR_TARGET_ARCH "${TARGET_ARCH}"
|
||||
#define WINPR_BUILD_CONFIG "${WINPR_BUILD_CONFIG}"
|
||||
#define WINPR_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
|
||||
#define WINPR_BUILD_TYPE "${CURRENT_BUILD_CONFIG}"
|
||||
|
||||
#endif /* WINPR_BUILD_FLAGS_H */
|
||||
|
||||
Reference in New Issue
Block a user