some compilers don't support liking a static library into another shared

library. compiling xfile into an object file instead.
This commit is contained in:
Yuichi Nishiwaki 2014-03-05 16:06:35 +09:00
parent e4ead0da48
commit 19371d1d81
2 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.8)
PROJECT(picrin)
@ -15,12 +15,11 @@ execute_process(
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY lib)
set(CMAKE_C_FLAGS "-Wall -Wextra -std=c99")
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1")
# external libraries
add_library(xfile STATIC extlib/xfile/xfile.c)
add_library(xfile OBJECT extlib/xfile/xfile.c)
# build picrin
include_directories(include extlib)

View File

@ -5,5 +5,5 @@ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${PROJECT_SOURCE
# build!
file(GLOB C_SOURCES ${PROJECT_SOURCE_DIR}/src/*.c)
add_library(picrin SHARED ${C_SOURCES} ${FLEX_scan_OUTPUTS})
target_link_libraries(picrin m xfile)
add_library(picrin SHARED ${C_SOURCES} ${FLEX_scan_OUTPUTS} $<TARGET_OBJECTS:xfile>)
target_link_libraries(picrin m)