Skip to content

Commit

Permalink
Merge pull request #443 from Autodesk/sabrih/MAYA-103926/compiler_con…
Browse files Browse the repository at this point in the history
…figuration_plugin_pxr

plugin/pxr is now adopting mayaUsd_compile_config routine
  • Loading branch information
HamedSabri-adsk authored Apr 21, 2020
2 parents 9437400 + 7895ee9 commit b0c1441
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ option(BUILD_TESTS "Build tests." ON)
option(BUILD_STRICT_MODE "Enforce all warnings as errors." ON)
option(BUILD_SHARED_LIBS "Build libraries as shared or static." ON)
option(CMAKE_WANT_UFE_BUILD "Enable building with UFE (if found)." ON)
option(PXR_ENABLE_PYTHON_SUPPORT "Enable Python based components for USD" ON)
option(PXR_BUILD_TESTS "Build tests" ON)
option(PXR_BUILD_MONOLITHIC "Build a monolithic library." OFF)

#------------------------------------------------------------------------------
# internal flags to control build
Expand Down
21 changes: 0 additions & 21 deletions plugin/pxr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,11 @@ set(PXR_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${INSTALL_DIR_SUFFIX})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/cmake/modules
${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros
${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults
)

include(Version)
include(Options)
include(Public)
pxr_setup_python()

#------------------------------------------------------------------------------
# compiler configuration
#------------------------------------------------------------------------------
# CXXDefaults will set a variety of variables for the project.
# Consume them here. This is an effort to keep the most common
# build files readable.
include(CXXDefaults)
add_definitions(${_PXR_CXX_DEFINITIONS} -DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE)
set(CMAKE_CXX_FLAGS "${_PXR_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")

if(NOT WIN32)
set(CMAKE_CXX_FLAGS
-msse3
"${CMAKE_CXX_FLAGS} ${_PXR_CXX_FLAGS}"
)
endif()
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

#==============================================================================
# subdirectory
#==============================================================================
Expand Down
9 changes: 9 additions & 0 deletions plugin/pxr/cmake/macros/Private.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,10 @@ function(_pxr_python_module NAME)
SHARED
${args_CPPFILES}
)

# compiler configuration
mayaUsd_compile_config(${LIBRARY_NAME})

add_dependencies(python ${LIBRARY_NAME})
if(args_PYTHON_FILES)
add_dependencies(${LIBRARY_NAME} ${LIBRARY_NAME}_pythonfiles)
Expand Down Expand Up @@ -922,6 +926,7 @@ function(_pxr_python_module NAME)
target_compile_definitions(${LIBRARY_NAME}
PRIVATE
$<$<BOOL:${IS_MACOSX}>:OSMac_>
$<$<BOOL:${IS_LINUX}>:LINUX>
MFB_PACKAGE_NAME=${PXR_PACKAGE}
MFB_ALT_PACKAGE_NAME=${PXR_PACKAGE}
MFB_PACKAGE_MODULE=${pyModuleName}
Expand Down Expand Up @@ -1073,6 +1078,9 @@ function(_pxr_library NAME)
)
endif()

# compiler configuration
mayaUsd_compile_config(${NAME})

#
# Compute names and paths.
#
Expand Down Expand Up @@ -1173,6 +1181,7 @@ function(_pxr_library NAME)
${apiPublic}
PRIVATE
$<$<BOOL:${IS_MACOSX}>:OSMac_>
$<$<BOOL:${IS_LINUX}>:LINUX>
MFB_PACKAGE_NAME=${PXR_PACKAGE}
MFB_ALT_PACKAGE_NAME=${PXR_PACKAGE}
MFB_PACKAGE_MODULE=${pythonModuleName}
Expand Down
6 changes: 6 additions & 0 deletions plugin/pxr/cmake/macros/Public.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ function(pxr_build_test_shared_lib LIBRARY_NAME)
FOLDER "${folder}"
)

# compiler configuration
mayaUsd_compile_config(${LIBRARY_NAME})

# Find libraries under the install prefix, which has the core USD
# libraries.
mayaUsd_init_rpath(rpath "tests/lib")
Expand Down Expand Up @@ -821,6 +824,9 @@ function(pxr_monolithic_epilogue)
)
add_library(usd_m STATIC "${CMAKE_CURRENT_BINARY_DIR}/usd_m.cpp" ${objects})

# compiler configuration
mayaUsd_compile_config(usd_m)

_get_folder("" folder)
set_target_properties(usd_m
PROPERTIES
Expand Down

0 comments on commit b0c1441

Please sign in to comment.