Cherry pick changes from wip-scritchui which should be mainline.
[SquirrelJME.git] / nanocoat / frontend / emulator / CMakeLists.txt
blob049d4342bc6cfe0bff822a0f184eab3ece506616
1 # ---------------------------------------------------------------------------
2 # SquirrelJME
3 #     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
4 # ---------------------------------------------------------------------------
5 # SquirrelJME is under the Mozilla Public License Version 2.0.
6 # See license.mkd for licensing and copyright information.
7 # ---------------------------------------------------------------------------
8 # DESCRIPTION: SquirrelJME emulator interface (Java SE)
10 # We need JNI for this to work
11 squirreljme_include("jni.cmake")
13 # Declare library
14 add_library(libEmulator SHARED
15         $<TARGET_OBJECTS:CorePIC>
16         emu.c
17         jniHelper.c
18         nativeAllocLink.c
19         nativeAllocPool.c
20         nativeAllocSizeOf.c
21         nativeFlatList.c
22         nativeNvmBootParam.c
23         nativeNvmFrame.c
24         nativeNvmState.c
25         nativeNvmThread.c
26         nativeVirtualLibrary.c
27         nativeVirtualSuite.c)
29 # Always make this position independent
30 set_property(TARGET libEmulator
31         PROPERTY POSITION_INDEPENDENT_CODE ON)
33 # The base SquirrelJME core needs to be built
34 add_dependencies(libEmulator
35         CorePIC)
37 # We need to find all of the includes and such
38 target_include_directories(libEmulator PUBLIC
39         "${CMAKE_SOURCE_DIR}/include"
40         ${JNI_INCLUDE_DIRS})
42 # It is easier to find this when it is in the build root
43 squirreljme_target_binary_output(libEmulator
44         "${SQUIRRELJME_DYLIB_OUTPUT_DIR}")
46 # Use a simpler name for the library
47 squirreljme_target_binary_name(libEmulator
48         "emulator-nanocoat")