mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-26 19:33:34 +08:00
[cmake] unify CFLAGS to string
* move to common CMake function * escape CFLAGS
This commit is contained in:
parent
a3aa01214c
commit
a27d9508e2
11
cmake/CFlagsToVar.cmake
Normal file
11
cmake/CFlagsToVar.cmake
Normal file
@ -0,0 +1,11 @@
|
||||
function(CFlagsToVar NAME)
|
||||
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 "\$" "\\\$" C_FLAGS "${C_FLAGS}")
|
||||
string(REPLACE "\"" "\\\"" C_FLAGS "${C_FLAGS}")
|
||||
set(${NAME} ${C_FLAGS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
@ -38,11 +38,8 @@ 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()
|
||||
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)
|
||||
|
@ -33,11 +33,8 @@ FOREACH(var ${res})
|
||||
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()
|
||||
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)
|
||||
|
@ -15,11 +15,8 @@
|
||||
# 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()
|
||||
include(CFlagsToVar)
|
||||
CFlagsToVar(C_FLAGS)
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user