Commit 528c1111 authored by Sergei Golubchik's avatar Sergei Golubchik
parents 648fb98e cdc38712
...@@ -1459,3 +1459,4 @@ libmysql/libmysql_versions.ld ...@@ -1459,3 +1459,4 @@ libmysql/libmysql_versions.ld
scripts/mysql_config.pl scripts/mysql_config.pl
pcre/pcre_chartables.c pcre/pcre_chartables.c
pcre/test*grep pcre/test*grep
import_executables.cmake
...@@ -386,6 +386,11 @@ ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO") ...@@ -386,6 +386,11 @@ ELSEIF(MYSQL_MAINTAINER_MODE MATCHES "AUTO")
SET(CMAKE_CXX_FLAGS_DEBUG "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS_DEBUG}") SET(CMAKE_CXX_FLAGS_DEBUG "${MY_MAINTAINER_CXX_WARNINGS} ${CMAKE_CXX_FLAGS_DEBUG}")
ENDIF() ENDIF()
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Path to import_executables.cmake from a native build")
INCLUDE(${IMPORT_EXECUTABLES})
ENDIF()
IF(WITH_UNIT_TESTS) IF(WITH_UNIT_TESTS)
ENABLE_TESTING() ENABLE_TESTING()
ADD_SUBDIRECTORY(unittest/mytap) ADD_SUBDIRECTORY(unittest/mytap)
...@@ -451,6 +456,13 @@ IF(WIN32) ...@@ -451,6 +456,13 @@ IF(WIN32)
ENDIF() ENDIF()
ADD_SUBDIRECTORY(packaging/solaris) ADD_SUBDIRECTORY(packaging/solaris)
IF(NOT CMAKE_CROSSCOMPILING)
SET(EXPORTED comp_err comp_sql factorial gen_lex_hash)
# minimal target to build only binaries for export
ADD_CUSTOM_TARGET(import_executables DEPENDS ${EXPORTED})
EXPORT(TARGETS ${EXPORTED} FILE ${CMAKE_BINARY_DIR}/import_executables.cmake)
ENDIF()
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h) CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h)
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h) CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
......
...@@ -24,8 +24,10 @@ TARGET_LINK_LIBRARIES(dbug mysys) ...@@ -24,8 +24,10 @@ TARGET_LINK_LIBRARIES(dbug mysys)
ADD_EXECUTABLE(tests tests.c) ADD_EXECUTABLE(tests tests.c)
TARGET_LINK_LIBRARIES(tests dbug) TARGET_LINK_LIBRARIES(tests dbug)
ADD_EXECUTABLE(factorial my_main.c factorial.c) IF(NOT CMAKE_CROSSCOMPILING)
TARGET_LINK_LIBRARIES(factorial dbug) ADD_EXECUTABLE(factorial my_main.c factorial.c)
TARGET_LINK_LIBRARIES(factorial dbug)
ENDIF()
IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode) IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
FIND_PROGRAM(GROFF groff) FIND_PROGRAM(GROFF groff)
...@@ -36,11 +38,11 @@ IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode) ...@@ -36,11 +38,11 @@ IF(NOT WIN32 AND NOT CMAKE_GENERATOR MATCHES Xcode)
SET(SOURCE_INC factorial.r main.r example1.r example2.r example3.r) SET(SOURCE_INC factorial.r main.r example1.r example2.r example3.r)
ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT_INC} ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT_INC}
DEPENDS factorial DEPENDS factorial
COMMAND ./factorial 1 2 3 4 5 > output1.r COMMAND factorial 1 2 3 4 5 > output1.r
COMMAND ./factorial -\#t:o 2 3 > output2.r COMMAND factorial -\#t:o 2 3 > output2.r
COMMAND ./factorial -\#d:t:o 3 > output3.r COMMAND factorial -\#d:t:o 3 > output3.r
COMMAND ./factorial -\#d,result:o 4 > output4.r COMMAND factorial -\#d,result:o 4 > output4.r
COMMAND ./factorial -\#d:f,factorial:F:L:o 3 > output5.r) COMMAND factorial -\#d:f,factorial:F:L:o 3 > output5.r)
FOREACH(file ${SOURCE_INC}) FOREACH(file ${SOURCE_INC})
STRING(REGEX REPLACE "\\.r" ".c" srcfile ${file}) STRING(REGEX REPLACE "\\.r" ".c" srcfile ${file})
ADD_CUSTOM_COMMAND(OUTPUT ${file} DEPENDS ${srcfile} ADD_CUSTOM_COMMAND(OUTPUT ${file} DEPENDS ${srcfile}
......
...@@ -218,7 +218,9 @@ RUN_BISON( ...@@ -218,7 +218,9 @@ RUN_BISON(
) )
# Gen_lex_hash # Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc) IF(NOT CMAKE_CROSSCOMPILING)
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
ENDIF()
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment