From 9ac7c8b83cc6fba6a8b408d5faf6da128641189c Mon Sep 17 00:00:00 2001 From: Florian Lukas Date: Thu, 22 Aug 2013 13:46:45 +0200 Subject: [PATCH] cmake: allow build outside project root Change the aspect weaver project path to all source paths (src, simulators, debuggers, tools) and the /src path. Without this change "external" builds do work but do not weave in any experiments. This change also allows multiple build directories within the project root, as the weaver will no longer use aspects from all builds. When further source directories are added to the project root, these definitions will need to be updated. Change-Id: If3d3d9fe61427fcba8b815171c8acdcdeb06cb69 --- cmake/bochs.cmake | 2 +- cmake/compilerconfig.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/bochs.cmake b/cmake/bochs.cmake index 0f73e19e..25697045 100644 --- a/cmake/bochs.cmake +++ b/cmake/bochs.cmake @@ -79,7 +79,7 @@ if(BUILD_BOCHS) set(bochs_configure_params --enable-a20-pin --enable-x86-64 --enable-cpu-level=6 --enable-ne2000 --enable-acpi --enable-pci --enable-usb --enable-trace-cache --enable-fast-function-calls --enable-host-specific-asms --enable-disasm --enable-readline --enable-clgd54xx --enable-fpu --enable-vmx=2 --enable-monitor-mwait --enable-cdrom --enable-sb16=linux --enable-gdb-stub --disable-docbook --with-all-libs CACHE STRING "Bochs default configure parameters") ## Bochs CXX args for calling make - set(bochs_build_CXX CXX=ag++\ -p\ ${PROJECT_SOURCE_DIR}\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler) + set(bochs_build_CXX CXX=ag++\ -p\ ${PROJECT_SOURCE_DIR}/src\ -p\ ${PROJECT_SOURCE_DIR}/simulators\ -p\ ${PROJECT_SOURCE_DIR}/debuggers\ -p\ ${PROJECT_SOURCE_DIR}/tools\ -p\ ${PROJECT_BINARY_DIR}/src\ -I${PROJECT_SOURCE_DIR}/src/core\ -I${CMAKE_BINARY_DIR}/src/core\ ${CMAKE_AGPP_FLAGS}\ --Xcompiler) ## Bochs libtool command. set(bochs_build_LIBTOOL LIBTOOL=/bin/sh\ ./libtool\ --tag=CXX) diff --git a/cmake/compilerconfig.cmake b/cmake/compilerconfig.cmake index 7122892c..926fd283 100644 --- a/cmake/compilerconfig.cmake +++ b/cmake/compilerconfig.cmake @@ -11,7 +11,7 @@ set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "ag++") set(CMAKE_AGPP_FLAGS "--real-instances" CACHE STRING "Additional ag++ flags, e.g. --real-instances --keep_woven") ## Here we add the build dir holding the generated header files (protobuf) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --Xweaver -p ${CMAKE_SOURCE_DIR} ${CMAKE_AGPP_FLAGS} --Xcompiler") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --Xweaver -p ${PROJECT_SOURCE_DIR}/src -p ${PROJECT_SOURCE_DIR}/simulators -p ${PROJECT_SOURCE_DIR}/debuggers -p ${PROJECT_SOURCE_DIR}/tools -p ${PROJECT_BINARY_DIR}/src ${CMAKE_AGPP_FLAGS} --Xcompiler") add_definitions(-D_FILE_OFFSET_BITS=64)