mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
59 lines
1.5 KiB
CMake
59 lines
1.5 KiB
CMake
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")
|
|
set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
|
|
set(pch_src_filename "${CMAKE_CURRENT_SOURCE_DIR}/pch.h")
|
|
|
|
if(APPLE)
|
|
set(type objective-c++-header)
|
|
else()
|
|
set(type c++-header)
|
|
endif()
|
|
|
|
set_source_files_properties(
|
|
pch.h PROPERTIES
|
|
COMPILE_FLAGS "-x ${type}"
|
|
HEADER_FILE_ONLY 0
|
|
LANGUAGE CXX)
|
|
|
|
add_library(pch STATIC pch.h)
|
|
|
|
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
|
|
COMPILE_FLAGS "-include ${pch_out_filename}"
|
|
OBJECT_DEPENDS "${pch_lib_filename}")
|
|
endif(ENABLE_PCH)
|
|
endmacro(add_dolphin_library)
|
|
|
|
add_subdirectory(Core)
|
|
|
|
if (DSPTOOL)
|
|
add_subdirectory(DSPTool)
|
|
endif()
|
|
|
|
if (UNITTESTS)
|
|
add_subdirectory(UnitTests)
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# TODO: Add DSPSpy and TestSuite. Preferrably make them option()s and cpack components
|