summaryrefslogtreecommitdiff
path: root/example/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'example/CMakeLists.txt')
-rw-r--r--example/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
new file mode 100644
index 0000000..ea5871c
--- /dev/null
+++ b/example/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+set(LIB_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/lib.c)
+set(TARGET_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/target.c)
+
+set(CMAKE_SHARED_LIBRARY_PREFIX "")
+add_library(lib SHARED ${LIB_SOURCE})
+add_executable(target ${TARGET_SOURCE})
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ add_library(lib32 SHARED ${LIB_SOURCE})
+ set_target_properties(lib32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+ add_executable(target32 ${TARGET_SOURCE})
+ set_target_properties(target32 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+endif() \ No newline at end of file