os/kernelhwsrv/kernel/eka/kernel/ekern.cmake
changeset 0 bde4ae8d615e
child 1 260cb5ec6c19
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/kernel/ekern.cmake	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,169 @@
     1.4 +# Copyright (c) 2009 Stéphane Lenclud.
     1.5 +# All rights reserved.
     1.6 +# This component and the accompanying materials are made available
     1.7 +# under the terms of the License "Eclipse Public License v1.0"
     1.8 +# which accompanies this distribution, and is available
     1.9 +# at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +#
    1.11 +# Initial Contributors:
    1.12 +# Stéphane Lenclud.
    1.13 +#
    1.14 +
    1.15 +push_target(ekern)
    1.16 +
    1.17 +#----------------------------------------------------------------
    1.18 +#Add current file to our source tree
    1.19 +add_cmake_source()
    1.20 +#Make sure all the output from all projects will go in one place
    1.21 +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
    1.22 +#Visual Studio IDE folders
    1.23 +source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
    1.24 +source_group(Includes REGULAR_EXPRESSION ".+\\.h$") 	
    1.25 +source_group(Def REGULAR_EXPRESSION ".+\\.def$") 	
    1.26 +#----------------------------------------------------------------
    1.27 +
    1.28 +
    1.29 +include_directories (../euser ../euser/unicode ../include 
    1.30 +../include/nkern ../include/nkern/win32 ../include/kernel ../include/kernel/win32 ../include/memmodel/emul/win32 ../include/memmodel/emul)
    1.31 +
    1.32 +#Define source for ekern
    1.33 +set (sourcepath ../nkern/)
    1.34 +add_source(
    1.35 +nkern.cpp nkerns.cpp sched.cpp dfcs.cpp nk_timer.cpp
    1.36 +nk_old.cpp
    1.37 +)
    1.38 +
    1.39 +set (sourcepath ../common/win32/)
    1.40 +add_source(
    1.41 +atomics.cpp
    1.42 +)
    1.43 +
    1.44 +set (sourcepath ../nkern/win32/)
    1.45 +add_source(
    1.46 +vectors.cpp ncsched.cpp nctimer.cpp ncutilf.cpp ncutils.cpp
    1.47 +ncthrd.cpp ncglob.cpp
    1.48 +)
    1.49 +
    1.50 +set (sourcepath ../common/win32/)
    1.51 +add_source(
    1.52 +seh.cpp
    1.53 +)
    1.54 +
    1.55 +#UID data seg. TODO: generate that?
    1.56 +set (sourcepath ./win32/)
    1.57 +add_source(
    1.58 +ekern_uid.cpp
    1.59 +)
    1.60 +
    1.61 +set (sourcepath ../kernel/win32/)
    1.62 +add_source(
    1.63 +cboot.cpp
    1.64 +cglobals.cpp cexec.cpp cinit.cpp
    1.65 +ckernel.cpp csched.cpp
    1.66 +cutils.cpp cache.cpp
    1.67 +k_entry.cpp #originally from kc_exe.mmp
    1.68 +#TODO: add our own entry point?
    1.69 +)
    1.70 +
    1.71 +
    1.72 +set (sourcepath ../kernel/)
    1.73 +add_source(
    1.74 +sglobals.cpp device.cpp eventq.cpp
    1.75 +sexec.cpp sinit.cpp skernel.cpp
    1.76 +scodeseg.cpp sipc.cpp notifier.cpp 
    1.77 +object.cpp power.cpp server.cpp
    1.78 +stimer.cpp sutils.cpp random.cpp
    1.79 +sprocess.cpp sthread.cpp 
    1.80 +smqueue.cpp
    1.81 +sproperty.cpp
    1.82 +ssharedio.cpp
    1.83 +ssecure.cpp
    1.84 +emi.cpp
    1.85 +objectix.cpp
    1.86 +sbtrace.cpp
    1.87 +stest.cpp
    1.88 +sshbuf.cpp smap.cpp
    1.89 +)
    1.90 +				
    1.91 +set (sourcepath ../klib/)
    1.92 +add_source(
    1.93 +dbase.cpp kdes8.cpp
    1.94 +kheap.cpp bma.cpp
    1.95 +)
    1.96 +
    1.97 +#
    1.98 +set (sourcepath ../common/)
    1.99 +add_source(
   1.100 +alloc.cpp array.cpp des8.cpp heap.cpp mem.cpp
   1.101 +secure.cpp
   1.102 +)
   1.103 +
   1.104 +set (sourcepath ../memmodel/emul/)
   1.105 +add_source(
   1.106 +pglobals.cpp
   1.107 +nvram.cpp
   1.108 +)
   1.109 +
   1.110 +#
   1.111 +set (sourcepath ../memmodel/emul/win32/)
   1.112 +add_source(
   1.113 +zrom.cpp
   1.114 +mchunk.cpp mglobals.cpp minit.cpp mkernel.cpp
   1.115 +mcodeseg.cpp mprocess.cpp mutils.cpp mshbuf.cpp
   1.116 +)
   1.117 +
   1.118 +#def export
   1.119 +set (sourcepath ../blike/)
   1.120 +add_source(
   1.121 +ekern.def
   1.122 +)
   1.123 +
   1.124 +#------------------------------------------------------------------------------------
   1.125 +# Define target
   1.126 +#------------------------------------------------------------------------------------
   1.127 +#It looks like exes on wins are still DLL but with a .exe extension 
   1.128 +get_source(source) 
   1.129 +add_library(ekern SHARED ${source})
   1.130 +set_target_properties(ekern PROPERTIES SUFFIX ".exe")
   1.131 +#add_executable(ekern ${source})
   1.132 +target_link_libraries(ekern kernel32 emulator scppnwdl_kern)
   1.133 +#------------------------------------------------------------------------------------
   1.134 +
   1.135 +#add_dependencies(ekern genexec)
   1.136 +#set_target_properties(ekern PROPERTIES LINK_FLAGS "/ENTRY:KernelMain /NODEFAULTLIB")
   1.137 +#target_link_libraries(ekern kernel32 msvcrt)
   1.138 +#set_target_properties(ekern PROPERTIES COMPILE_FLAGS "/Zl")
   1.139 +#install(TARGETS ekern DESTINATION ./symbian/bin)
   1.140 +
   1.141 +add_define(__EXPORT_MEMCPY__)				
   1.142 +add_define(__IN_KERNEL__)
   1.143 +add_define(__KERNEL_MODE__)
   1.144 +add_define(__MEMMODEL_EMUL_SINGLE_HOST_PROCESS__)
   1.145 +#__CPU_X86 is declared by __WINS__ 
   1.146 +#add_define(__CPU_X86)
   1.147 +#add_define(__DLL__)
   1.148 +
   1.149 +
   1.150 +##
   1.151 +##Copy ekern.dll to be next to epoc.exe
   1.152 +##
   1.153 +
   1.154 +#get_target_property(LIB_NAME ekern LOCATION)
   1.155 +#get_target_property(DEST_NAME epoc LOCATION)
   1.156 +#set(target_suffix .dll)
   1.157 +#Extract path from full filename
   1.158 +#string(REGEX REPLACE "(^.+)/epoc.exe" "\\1" DEST_NAME ${DEST_NAME})
   1.159 +#set(DEST_NAME ${DEST_NAME}/ekern${target_suffix})
   1.160 +
   1.161 +#message(${DEST_NAME})
   1.162 +
   1.163 +#add_custom_command (
   1.164 +# 	TARGET ekern
   1.165 +#   	POST_BUILD
   1.166 +#   	COMMAND ${CMAKE_COMMAND} -E copy ${LIB_NAME} ${DEST_NAME}
   1.167 +# 	)
   1.168 +	
   1.169 +######################
   1.170 +
   1.171 +
   1.172 +pop_target(ekern)
   1.173 \ No newline at end of file