getarch now compiles and sets config.h defines properly.
Still isn't parsed into CMake variables, and getarch_2 needs to get the same treatment.
This commit is contained in:
parent
1c5b6bb4f7
commit
8ede4a8da4
|
@ -68,29 +68,27 @@ include("${CMAKE_SOURCE_DIR}/cmake/f_check.cmake")
|
||||||
# compile getarch
|
# compile getarch
|
||||||
enable_language(ASM)
|
enable_language(ASM)
|
||||||
set(GETARCH_DIR "${PROJECT_BINARY_DIR}/getarch_build")
|
set(GETARCH_DIR "${PROJECT_BINARY_DIR}/getarch_build")
|
||||||
|
set(GETARCH_BIN "getarch${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
file(MAKE_DIRECTORY ${GETARCH_DIR})
|
file(MAKE_DIRECTORY ${GETARCH_DIR})
|
||||||
try_compile(GETARCH_RESULT ${GETARCH_DIR}
|
try_compile(GETARCH_RESULT ${GETARCH_DIR}
|
||||||
SOURCES ${CMAKE_SOURCE_DIR}/getarch.c ${CMAKE_SOURCE_DIR}/cpuid.S ${CPUIDEMO}
|
SOURCES ${CMAKE_SOURCE_DIR}/getarch.c ${CMAKE_SOURCE_DIR}/cpuid.S ${CPUIDEMO}
|
||||||
COMPILE_DEFINITIONS ${EXFLAGS} -I${CMAKE_SOURCE_DIR}
|
COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I${CMAKE_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE GETARCH_LOG
|
OUTPUT_VARIABLE GETARCH_LOG
|
||||||
|
COPY_FILE ${GETARCH_BIN}
|
||||||
)
|
)
|
||||||
|
|
||||||
message(STATUS "GETARCH RESULT: ${GETARCH_RESULT}")
|
message(STATUS "Running getarch")
|
||||||
message(STATUS "GETARCH LOG: ${GETARCH_LOG}")
|
|
||||||
|
|
||||||
# TODO: need to append output of getarch binary to TARGET_CONF, use COPY_FILE param (look at try_compile docs) to copy the resulting binary somewhere then run it
|
# use the cmake binary w/ the -E param to run a shell command in a cross-platform way
|
||||||
|
execute_process(COMMAND ${GETARCH_BIN} 0 OUTPUT_VARIABLE GETARCH_MAKE_OUT)
|
||||||
|
execute_process(COMMAND ${GETARCH_BIN} 1 OUTPUT_VARIABLE GETARCH_CONF_OUT)
|
||||||
|
|
||||||
#add_executable(getarch getarch.c cpuid.S ${CPUIDEMU}
|
message(STATUS "GETARCH results:\n${GETARCH_MAKE_OUT}")
|
||||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
|
||||||
#
|
# append config data from getarch even more to the TARGET file
|
||||||
## run getarch, which appends even more to the TARGET files
|
file(APPEND ${TARGET_CONF} ${GETARCH_CONF_OUT})
|
||||||
#message(STATUS "Running getarch")
|
|
||||||
#execute_process(COMMAND getarch 0 >> ${TARGET_MAKE}
|
## TODO: config.h is ready for getarch_2nd now, so compile that
|
||||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
|
||||||
#execute_process(COMMAND getarch 1 >> ${TARGET_CONF}
|
|
||||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
|
||||||
#
|
|
||||||
## config.h is ready for getarch_2nd now, so compile that
|
|
||||||
#set(GETARCH2_SOURCES getarch_2nd.c config.h)
|
#set(GETARCH2_SOURCES getarch_2nd.c config.h)
|
||||||
#add_executable(getarch_2nd getarch_2nd.c config.h)
|
#add_executable(getarch_2nd getarch_2nd.c config.h)
|
||||||
#
|
#
|
||||||
|
@ -101,13 +99,8 @@ message(STATUS "GETARCH LOG: ${GETARCH_LOG}")
|
||||||
#execute_process(COMMAND getarch_2nd 1 >> ${TARGET_CONF}
|
#execute_process(COMMAND getarch_2nd 1 >> ${TARGET_CONF}
|
||||||
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||||
|
|
||||||
# TODO: need to read in the vars from Makefile.conf/Makefile_kernel.conf
|
# TODO: parse the MAKE variables from getarch/getarch2 (GETARCH_MAKE_OUT) into CMAKE vars
|
||||||
|
# for now I temporarily hardcoded to get system.cmake working
|
||||||
# temporarily hardcoded to get system.cmake working
|
|
||||||
set(NUM_CORES 4)
|
set(NUM_CORES 4)
|
||||||
set(CORE "GENERIC")
|
set(CORE "GENERIC")
|
||||||
# TODO: this should be done by getarch! see above
|
|
||||||
file(APPEND ${TARGET_CONF}
|
|
||||||
"#define ${CORE}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ else ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (${SMP})
|
if (${SMP})
|
||||||
message("SMP enabled.")
|
message(STATUS "SMP enabled.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT DEFINED NEED_PIC)
|
if (NOT DEFINED NEED_PIC)
|
||||||
|
|
|
@ -82,7 +82,7 @@ set_target_properties(DBLAS_TU PROPERTIES COMPILE_DEFINITIONS TRANS)
|
||||||
|
|
||||||
set(DBLAS_TARGETS DBLAS_NONE DBLAS_T DBLAS_L DBLAS_U DBLAS_TU)
|
set(DBLAS_TARGETS DBLAS_NONE DBLAS_T DBLAS_L DBLAS_U DBLAS_TU)
|
||||||
|
|
||||||
foreach (${TARGET} ${DBLAS_TARGETS})
|
foreach (${DBLAS_TARGET} ${DBLAS_TARGETS})
|
||||||
set_target_properties(${TARGET} PROPERTIES COMPILE_DEFINITIONS DOUBLE)
|
set_target_properties(${DBLAS_TARGET} PROPERTIES COMPILE_DEFINITIONS DOUBLE)
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue