2013-10-17 04:06:34 +00:00
|
|
|
set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch <TARGET>")
|
|
|
|
if(ENABLE_PCH)
|
|
|
|
# This is actually a .h file, but trick cmake into compiling it as a source file
|
|
|
|
set(pch_out_filename "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/pch.dir/pch.h")
|
2013-10-29 00:59:03 +00:00
|
|
|
if (ANDROID)
|
|
|
|
set(pch_lib_filename "${LIBRARY_OUTPUT_PATH}/libpch.a")
|
|
|
|
else()
|
|
|
|
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
|
|
|
|
endif()
|
2014-08-15 06:51:13 +00:00
|
|
|
set(pch_src_filename "${CMAKE_CURRENT_SOURCE_DIR}/PCH/pch.h")
|
2013-10-17 04:06:34 +00:00
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
set(type objective-c++-header)
|
|
|
|
else()
|
|
|
|
set(type c++-header)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_source_files_properties(
|
2014-08-15 06:51:13 +00:00
|
|
|
PCH/pch.h PROPERTIES
|
2013-10-17 04:06:34 +00:00
|
|
|
COMPILE_FLAGS "-x ${type}"
|
|
|
|
HEADER_FILE_ONLY 0
|
|
|
|
LANGUAGE CXX)
|
|
|
|
|
2014-08-15 06:51:13 +00:00
|
|
|
add_library(pch STATIC PCH/pch.h)
|
2013-10-17 04:06:34 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
TARGET pch
|
|
|
|
PRE_LINK
|
|
|
|
COMMAND ln -fs "${pch_out_filename}.o" "${pch_out_filename}.gch"
|
|
|
|
COMMAND ln -fs "${pch_out_filename}.o" "${pch_out_filename}.pch"
|
|
|
|
COMMAND cp "${pch_src_filename}" "${pch_out_filename}")
|
|
|
|
|
|
|
|
set_target_properties(
|
|
|
|
pch PROPERTIES
|
|
|
|
LINKER_LANGUAGE FAKELANG)
|
|
|
|
endif(ENABLE_PCH)
|
|
|
|
macro(add_dolphin_library lib srcs libs)
|
|
|
|
add_library(${lib} STATIC ${srcs})
|
|
|
|
target_link_libraries(${lib} ${libs})
|
|
|
|
if(ENABLE_PCH)
|
|
|
|
add_dependencies(${lib} pch)
|
|
|
|
set_source_files_properties(
|
|
|
|
${srcs} PROPERTIES
|
2014-05-23 23:24:08 +00:00
|
|
|
COMPILE_FLAGS "-include '${pch_out_filename}'"
|
2013-10-17 04:06:34 +00:00
|
|
|
OBJECT_DEPENDS "${pch_lib_filename}")
|
|
|
|
endif(ENABLE_PCH)
|
|
|
|
endmacro(add_dolphin_library)
|
|
|
|
|
2010-11-01 15:47:02 +00:00
|
|
|
add_subdirectory(Core)
|
2016-01-20 16:32:53 +00:00
|
|
|
if (ANDROID)
|
|
|
|
add_subdirectory(Android/jni)
|
|
|
|
endif()
|
2014-03-03 02:38:46 +00:00
|
|
|
add_subdirectory(UnitTests)
|
2011-07-18 01:47:55 +00:00
|
|
|
|
|
|
|
if (DSPTOOL)
|
|
|
|
add_subdirectory(DSPTool)
|
|
|
|
endif()
|
|
|
|
|
2016-09-11 22:25:45 +00:00
|
|
|
# TODO: Add DSPSpy. Preferably make it option() and cpack component
|