mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 12:56:26 +00:00
1053, 1009, 1054 cmake update (#1055)
* #1053 #1009 cmake configure correct clang libs * #1054 fix sie-rework to be compatible with CMake build closes #1053 closes #1009 closes #1054
This commit is contained in:
parent
c9f060c94f
commit
5bb32279b5
17
CMakeTestFiles/TestICGLinkedLibs.cpp
Normal file
17
CMakeTestFiles/TestICGLinkedLibs.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "llvm/Support/Host.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
#include "clang/Basic/Builtins.h"
|
||||
#include "clang/Frontend/CompilerInstance.h"
|
||||
#include "clang/Basic/TargetOptions.h"
|
||||
#include "clang/Basic/TargetInfo.h"
|
||||
#include "clang/Basic/FileManager.h"
|
||||
#include "clang/Lex/Preprocessor.h"
|
||||
#include "clang/Lex/PreprocessorOptions.h"
|
||||
#include "clang/Basic/Diagnostic.h"
|
||||
#include "clang/Parse/ParseAST.h"
|
||||
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
@ -14,7 +14,9 @@ while(my $line = <$classes_resource>) {
|
||||
close($classes_resource);
|
||||
|
||||
open(my $sim_services_resource, "<", "$ENV{TRICK_HOME}/trick_source/sim_services/include/sim_services_classes.resource")
|
||||
or die "cannot open trick/trick_source/sim_services/include/sim_services_classes.resource";
|
||||
or open(my $sim_services_resource, "<", "$ENV{TRICK_HOME}/temp_src/io_src/sim_services_classes.resource")
|
||||
or die "cannot open sim_services_classes.resource";
|
||||
|
||||
while(my $line = <$sim_services_resource>) {
|
||||
print $S_sie_resource $line;
|
||||
}
|
||||
|
@ -23,6 +23,26 @@ set ( ICG_SRC
|
||||
../../sim_services/UdUnits/map_trick_units_to_udunits
|
||||
)
|
||||
|
||||
set (ICG_CLANGLIBS
|
||||
-lclangFrontend
|
||||
-lclangDriver
|
||||
-lclangSerialization
|
||||
-lclangParse
|
||||
-lclangSema
|
||||
-lclangAnalysis
|
||||
-lclangEdit
|
||||
-lclangAST
|
||||
-lclangLex
|
||||
-lclangBasic
|
||||
)
|
||||
|
||||
try_compile(haveOldLibs "${CMAKE_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/CMakeTestFiles/TestICGLinkedLibs.cpp" CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${LLVM_INCLUDE_DIRS}")
|
||||
if(NOT haveOldLibs)
|
||||
set (ICG_CLANGLIBS
|
||||
-lclang-cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable( trick-ICG ${ICG_SRC} )
|
||||
target_compile_options( trick-ICG PUBLIC -g -DTRICK_VERSION="${TRICK_MAJOR}.${TRICK_MINOR}.${TRICK_TINY}" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS)
|
||||
target_compile_options( trick-ICG PUBLIC -DEXTERNAL_BUILD)
|
||||
@ -34,16 +54,7 @@ set_property(SOURCE trick-ICG APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}
|
||||
set_target_properties( trick-ICG PROPERTIES CXX_STANDARD 14)
|
||||
|
||||
target_link_libraries( trick-ICG
|
||||
-lclangFrontend
|
||||
-lclangDriver
|
||||
-lclangSerialization
|
||||
-lclangParse
|
||||
-lclangSema
|
||||
-lclangAnalysis
|
||||
-lclangEdit
|
||||
-lclangAST
|
||||
-lclangLex
|
||||
-lclangBasic
|
||||
${ICG_CLANGLIBS}
|
||||
${LLVM_LDFLAGS}
|
||||
${LLVM_LIBRARIES}
|
||||
${UDUNITS2_LIBRARIES}
|
||||
|
@ -276,7 +276,11 @@ void PrintAttributes::printEnum(EnumValues* ev) {
|
||||
void PrintAttributes::printSieClass( ClassValues * cv ) {
|
||||
std::string xmlFileName;
|
||||
if(sim_services_flag) {
|
||||
#ifdef EXTERNAL_BUILD
|
||||
xmlFileName = output_dir + "/sim_services_classes.resource";
|
||||
#else
|
||||
xmlFileName = std::string(getenv("TRICK_HOME")) + "/trick_source/sim_services/include/sim_services_classes.resource";
|
||||
#endif
|
||||
} else {
|
||||
xmlFileName = "build/classes.resource";
|
||||
}
|
||||
@ -313,7 +317,12 @@ void PrintAttributes::printSieClass( ClassValues * cv ) {
|
||||
void PrintAttributes::printSieEnum( EnumValues * ev ) {
|
||||
std::string xmlFileName;
|
||||
if(sim_services_flag) {
|
||||
#ifdef EXTERNAL_BUILD
|
||||
xmlFileName = output_dir + "/sim_services_classes.resource";
|
||||
#else
|
||||
xmlFileName = std::string(getenv("TRICK_HOME")) + "/trick_source/sim_services/include/sim_services_classes.resource";
|
||||
#endif
|
||||
|
||||
} else {
|
||||
xmlFileName = "build/classes.resource";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user